summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2011-06-22 12:00:09 -0300
committerAlexis Menard <alexis.menard@trolltech.com>2011-06-22 12:00:09 -0300
commit1b46b28ddac18fd0f5edc250218dfb15ac05e652 (patch)
tree57b0fe3414941d5deda54a7b658c7b3d2b0f2268
parent20ec7b41ac600fe670c3c8e6305cc12b10440c30 (diff)
parente4cce8849bf45be9a111072e3fca7bdf67364e8a (diff)
Merge branch '4.8' of git://gitorious.org/qt/qt into 4.8
-rw-r--r--.commit-template2
-rw-r--r--config.profiles/symbian/bld.inf2
-rw-r--r--config.profiles/symbian/qt.iby4
-rw-r--r--config.profiles/symbian/qt.pkg3
-rwxr-xr-xconfigure6
-rw-r--r--demos/deform/main.cpp4
-rw-r--r--demos/demos.pro4
-rw-r--r--demos/glhypnotizer/glhypnotizer.pro21
-rw-r--r--demos/glhypnotizer/hypnotizer.qrc6
-rw-r--r--demos/glhypnotizer/main.cpp356
-rw-r--r--demos/glhypnotizer/qt-logo.pngbin0 -> 2493 bytes
-rw-r--r--demos/glhypnotizer/spiral.svg100
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.pro6
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro6
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro6
-rw-r--r--demos/pathstroke/main.cpp4
-rw-r--r--demos/qtdemo/xml/examples.xml4
-rw-r--r--doc/src/declarative/declarativeui.qdoc8
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc81
-rw-r--r--doc/src/declarative/qtbinding.qdoc30
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc2
-rw-r--r--doc/src/declarative/righttoleft.qdoc11
-rw-r--r--doc/src/declarative/whatsnew.qdoc52
-rw-r--r--doc/src/demos/glhypnotizer.qdoc38
-rw-r--r--doc/src/deployment/deployment.qdoc2
-rw-r--r--doc/src/development/designer-manual.qdoc2
-rw-r--r--doc/src/development/qmake-manual.qdoc16
-rw-r--r--doc/src/development/qtestlib.qdoc4
-rw-r--r--doc/src/diagrams/webkit-webplugin.pngbin0 -> 70787 bytes
-rw-r--r--doc/src/examples/activeqt/dotnet.qdoc2
-rw-r--r--doc/src/examples/applicationicon.qdoc88
-rw-r--r--doc/src/examples/broadcastreceiver.qdoc2
-rw-r--r--doc/src/examples/codeeditor.qdoc4
-rw-r--r--doc/src/examples/combowidgetmapper.qdoc2
-rw-r--r--doc/src/examples/cube.qdoc178
-rw-r--r--doc/src/examples/dragdroprobot.qdoc2
-rw-r--r--doc/src/examples/elasticnodes.qdoc2
-rw-r--r--doc/src/examples/elidedlabel.qdoc162
-rw-r--r--doc/src/examples/fingerpaint.qdoc6
-rw-r--r--doc/src/examples/maemovibration.qdoc164
-rw-r--r--doc/src/examples/orientation.qdoc143
-rw-r--r--doc/src/examples/portedasteroids.qdoc5
-rw-r--r--doc/src/examples/portedcanvas.qdoc4
-rw-r--r--doc/src/examples/recipes.qdoc2
-rw-r--r--doc/src/examples/rsslisting.qdoc2
-rw-r--r--doc/src/examples/schema.qdoc4
-rw-r--r--doc/src/examples/simplewebplugin.qdoc181
-rw-r--r--doc/src/examples/symbianvibration.qdoc192
-rw-r--r--doc/src/examples/syntaxhighlighter.qdoc10
-rw-r--r--doc/src/examples/webftpclient.qdoc336
-rw-r--r--doc/src/examples/webplugin.qdoc157
-rw-r--r--doc/src/external-resources.qdoc30
-rw-r--r--doc/src/frameworks-technologies/richtext.qdoc10
-rw-r--r--doc/src/getting-started/examples.qdoc7
-rw-r--r--doc/src/getting-started/gettingstartedqt.qdoc2
-rw-r--r--doc/src/getting-started/how-to-learn-qt.qdoc232
-rw-r--r--doc/src/getting-started/installation.qdoc636
-rw-r--r--doc/src/images/appicon_packagecontents.pngbin0 -> 21266 bytes
-rw-r--r--doc/src/images/appicon_screenshot.pngbin0 -> 150183 bytes
-rw-r--r--doc/src/images/cube.pngbin0 -> 40459 bytes
-rw-r--r--doc/src/images/cube_faces.pngbin0 -> 63082 bytes
-rw-r--r--doc/src/images/elidedlabel-example.pngbin0 -> 24876 bytes
-rw-r--r--doc/src/images/glhypnotizer-demo.pngbin0 -> 46888 bytes
-rw-r--r--doc/src/images/maemovibration-example.pngbin0 -> 54782 bytes
-rw-r--r--doc/src/images/orientation-landscape-ui.pngbin0 -> 18077 bytes
-rw-r--r--doc/src/images/orientation-landscape.pngbin0 -> 46496 bytes
-rw-r--r--doc/src/images/orientation-portrait-ui.pngbin0 -> 9785 bytes
-rw-r--r--doc/src/images/orientation-portrait.pngbin0 -> 17377 bytes
-rw-r--r--doc/src/images/qml-listview-snippet.pngbin0 -> 2048 bytes
-rw-r--r--doc/src/images/symbianvibration-example.pngbin0 -> 23217 bytes
-rw-r--r--doc/src/images/webkit-webftpclient.pngbin0 -> 105098 bytes
-rw-r--r--doc/src/images/webkit-webplugin.pngbin0 -> 131192 bytes
-rw-r--r--doc/src/platforms/emb-install.qdoc3
-rw-r--r--doc/src/platforms/symbian-introduction.qdoc8
-rw-r--r--doc/src/qt-webpages.qdoc225
-rw-r--r--doc/src/snippets/declarative/grid/grid-items.qml58
-rw-r--r--doc/src/snippets/declarative/grid/grid-no-spacing.qml57
-rw-r--r--doc/src/snippets/declarative/grid/grid-spacing.qml60
-rw-r--r--doc/src/snippets/declarative/listview/listview-snippet.qml52
-rw-r--r--doc/src/snippets/declarative/mousearea/mousearea-snippet.qml82
-rw-r--r--doc/src/snippets/declarative/qml-intro/images/qt-logo.svg104
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h2
-rw-r--r--doc/src/snippets/qmake/qt_version.pro7
-rw-r--r--doc/src/snippets/textdocument-listitemstyles/main.cpp52
-rw-r--r--doc/src/snippets/textdocument-listitemstyles/mainwindow.cpp84
-rw-r--r--doc/src/snippets/textdocument-listitemstyles/mainwindow.h65
-rw-r--r--doc/src/snippets/textdocument-listitemstyles/textdocument-listitemstyles.pro3
-rw-r--r--doc/src/snippets/xml/streamreader/traverse.cpp78
-rw-r--r--doc/src/snippets/xml/streamreader/traverse.pro2
-rw-r--r--doc/src/tutorials/modelview.qdoc1
-rw-r--r--doc/src/windows-and-dialogs/mainwindow.qdoc11
-rw-r--r--examples/animation/animatedtiles/animatedtiles.desktop11
-rw-r--r--examples/animation/animatedtiles/animatedtiles.pro1
-rw-r--r--examples/animation/animatedtiles/main.cpp4
-rw-r--r--examples/animation/appchooser/appchooser.desktop11
-rw-r--r--examples/animation/appchooser/appchooser.pro1
-rw-r--r--examples/animation/appchooser/main.cpp30
-rw-r--r--examples/animation/easing/easing.desktop11
-rw-r--r--examples/animation/easing/easing.pro9
-rw-r--r--examples/animation/easing/form.ui95
-rw-r--r--examples/animation/easing/main.cpp8
-rw-r--r--examples/animation/easing/window.cpp7
-rw-r--r--examples/animation/easing/window.h3
-rw-r--r--examples/animation/moveblocks/main.cpp41
-rw-r--r--examples/animation/moveblocks/moveblocks.desktop11
-rw-r--r--examples/animation/moveblocks/moveblocks.pro1
-rw-r--r--examples/animation/states/main.cpp38
-rw-r--r--examples/animation/states/states.desktop11
-rw-r--r--examples/animation/states/states.pro1
-rw-r--r--examples/animation/stickman/graphicsview.cpp5
-rw-r--r--examples/animation/stickman/graphicsview.h1
-rw-r--r--examples/animation/stickman/lifecycle.cpp6
-rw-r--r--examples/animation/stickman/lifecycle.h3
-rw-r--r--examples/animation/stickman/main.cpp34
-rw-r--r--examples/animation/stickman/rectbutton.cpp73
-rw-r--r--examples/animation/stickman/rectbutton.h65
-rw-r--r--examples/animation/stickman/stickman.desktop11
-rw-r--r--examples/animation/stickman/stickman.pro7
-rw-r--r--examples/dbus/complexpingpong/complexping.desktop11
-rw-r--r--examples/dbus/complexpingpong/complexping.pro4
-rw-r--r--examples/dbus/complexpingpong/complexpong.desktop11
-rw-r--r--examples/dbus/complexpingpong/complexpong.pro4
-rw-r--r--examples/dbus/dbus-chat/dbus-chat.desktop11
-rw-r--r--examples/dbus/dbus-chat/dbus-chat.pro4
-rw-r--r--examples/dbus/dbus.pro1
-rw-r--r--examples/dbus/listnames/listnames.desktop11
-rw-r--r--examples/dbus/listnames/listnames.pro5
-rw-r--r--examples/dbus/pingpong/ping.desktop11
-rw-r--r--examples/dbus/pingpong/ping.pro3
-rw-r--r--examples/dbus/pingpong/pong.desktop11
-rw-r--r--examples/dbus/pingpong/pong.pro3
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.desktop11
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.pro4
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.desktop11
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.pro4
-rw-r--r--examples/dbus/remotecontrolledcar/remotecontrolledcar.pro1
-rw-r--r--examples/declarative/animation/basics/color-animation/coloranimation.desktop11
-rw-r--r--examples/declarative/animation/basics/color-animation/coloranimation.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/coloranimation.pro39
-rw-r--r--examples/declarative/animation/basics/color-animation/coloranimation.svg93
-rw-r--r--examples/declarative/animation/basics/color-animation/main.cpp54
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/basics.qmlproject (renamed from examples/declarative/animation/animation.qmlproject)0
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation.qml110
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/images/face-smile.png (renamed from examples/declarative/animation/basics/images/face-smile.png)bin15408 -> 15408 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/images/moon.png (renamed from examples/declarative/animation/basics/images/moon.png)bin2433 -> 2433 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/images/shadow.png (renamed from examples/declarative/animation/basics/images/shadow.png)bin425 -> 425 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/images/star.png (renamed from examples/declarative/animation/basics/images/star.png)bin349 -> 349 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/images/sun.png (renamed from examples/declarative/animation/basics/images/sun.png)bin8153 -> 8153 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/property-animation.qml105
-rw-r--r--examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/animation/basics/property-animation/main.cpp54
-rw-r--r--examples/declarative/animation/basics/property-animation/propertyanimation.desktop11
-rw-r--r--examples/declarative/animation/basics/property-animation/propertyanimation.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/propertyanimation.pro39
-rw-r--r--examples/declarative/animation/basics/property-animation/propertyanimation.svg93
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/basics.qmlproject (renamed from examples/declarative/animation/easing/easing.qmlproject)0
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/color-animation.qml110
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/images/face-smile.png (renamed from examples/declarative/toys/dynamicscene/images/face-smile.png)bin15408 -> 15408 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/images/moon.pngbin0 -> 2433 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/images/shadow.pngbin0 -> 425 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/images/star.png (renamed from examples/declarative/toys/dynamicscene/images/star.png)bin349 -> 349 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/images/sun.png (renamed from examples/declarative/toys/dynamicscene/images/sun.png)bin8153 -> 8153 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation.qml105
-rw-r--r--examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop11
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behaviorexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro39
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg93
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/main.cpp54
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml62
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml118
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qml/behaviors.qmlproject (renamed from examples/declarative/animation/states/states.qmlproject)0
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml108
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/animation/easing/easing.desktop11
-rw-r--r--examples/declarative/animation/easing/easing.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/easing/easing.pro39
-rw-r--r--examples/declarative/animation/easing/easing.svg93
-rw-r--r--examples/declarative/animation/easing/main.cpp54
-rw-r--r--examples/declarative/animation/easing/qml/content/QuitButton.qml52
-rw-r--r--examples/declarative/animation/easing/qml/content/quit.png (renamed from examples/declarative/animation/easing/content/quit.png)bin583 -> 583 bytes
-rw-r--r--examples/declarative/animation/easing/qml/easing.qml159
-rw-r--r--examples/declarative/animation/easing/qml/easing.qmlproject (renamed from examples/declarative/examples.qmlproject)0
-rw-r--r--examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/animation/states/main.cpp54
-rw-r--r--examples/declarative/animation/states/qml/qt-logo.png (renamed from examples/declarative/animation/states/qt-logo.png)bin5149 -> 5149 bytes
-rw-r--r--examples/declarative/animation/states/qml/states.qml101
-rw-r--r--examples/declarative/animation/states/qml/states.qmlproject (renamed from examples/declarative/i18n/i18n.qmlproject)0
-rw-r--r--examples/declarative/animation/states/qml/transitions.qml130
-rw-r--r--examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/animation/states/states.desktop11
-rw-r--r--examples/declarative/animation/states/states.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/states/states.pro39
-rw-r--r--examples/declarative/animation/states/states.svg93
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro1
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.pro1
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.pro1
-rw-r--r--examples/declarative/demos/calculator/calculator.desktop11
-rw-r--r--examples/declarative/demos/calculator/calculator.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/calculator/calculator.pro39
-rw-r--r--examples/declarative/demos/calculator/calculator.svg93
-rw-r--r--examples/declarative/demos/calculator/main.cpp54
-rw-r--r--examples/declarative/demos/calculator/qml/Core/Button.qml80
-rw-r--r--examples/declarative/demos/calculator/qml/Core/Display.qml68
-rw-r--r--examples/declarative/demos/calculator/qml/Core/calculator.js91
-rw-r--r--examples/declarative/demos/calculator/qml/Core/images/button-.pngbin0 -> 1288 bytes
-rw-r--r--examples/declarative/demos/calculator/qml/Core/images/button-blue.pngbin0 -> 1565 bytes
-rw-r--r--examples/declarative/demos/calculator/qml/Core/images/button-green.pngbin0 -> 1543 bytes
-rw-r--r--examples/declarative/demos/calculator/qml/Core/images/button-purple.pngbin0 -> 1566 bytes
-rw-r--r--examples/declarative/demos/calculator/qml/Core/images/button-red.pngbin0 -> 1586 bytes
-rw-r--r--examples/declarative/demos/calculator/qml/Core/images/display.pngbin0 -> 998 bytes
-rw-r--r--examples/declarative/demos/calculator/qml/Core/qmldir2
-rw-r--r--examples/declarative/demos/calculator/qml/calculator.qml158
-rw-r--r--examples/declarative/demos/calculator/qml/calculator.qmlproject (renamed from examples/declarative/imageelements/borderimage/borderimage.qmlproject)0
-rw-r--r--examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/flickr/flickr.desktop11
-rw-r--r--examples/declarative/demos/flickr/flickr.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/flickr/flickr.pro39
-rw-r--r--examples/declarative/demos/flickr/flickr.svg93
-rw-r--r--examples/declarative/demos/flickr/main.cpp54
-rw-r--r--examples/declarative/demos/flickr/qml/common/Progress.qml73
-rw-r--r--examples/declarative/demos/flickr/qml/common/RssModel.qml66
-rw-r--r--examples/declarative/demos/flickr/qml/common/ScrollBar.qml81
-rw-r--r--examples/declarative/demos/flickr/qml/common/Slider.qml91
-rw-r--r--examples/declarative/demos/flickr/qml/common/qmldir10
-rw-r--r--examples/declarative/demos/flickr/qml/flickr-90.qml52
-rw-r--r--examples/declarative/demos/flickr/qml/flickr.qml125
-rw-r--r--examples/declarative/demos/flickr/qml/flickr.qmlproject (renamed from examples/declarative/imageelements/image/image.qmlproject)0
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/Button.qml79
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml111
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml186
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml64
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/TitleBar.qml128
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/ToolBar.qml69
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/gloss.pngbin0 -> 1236 bytes
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci5
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/stripes.pngbin0 -> 257 bytes
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci5
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci5
-rw-r--r--examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/photoviewer/main.cpp54
-rw-r--r--examples/declarative/demos/photoviewer/photoviewer.desktop11
-rw-r--r--examples/declarative/demos/photoviewer/photoviewer.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/photoviewer/photoviewer.pro39
-rw-r--r--examples/declarative/demos/photoviewer/photoviewer.svg93
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml146
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml50
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml72
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml86
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml188
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml57
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml54
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml91
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png (renamed from examples/declarative/imageelements/borderimage/content/shadow.png)bin588 -> 588 bytes
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.pngbin0 -> 8844 bytes
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir8
-rw-r--r--examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js27
-rw-r--r--examples/declarative/demos/photoviewer/qml/i18n/base.ts30
-rw-r--r--examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qmbin0 -> 268 bytes
-rw-r--r--examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts30
-rw-r--r--examples/declarative/demos/photoviewer/qml/photoviewer.qml110
-rw-r--r--examples/declarative/demos/photoviewer/qml/photoviewer.qmlproject (renamed from examples/declarative/imageelements/imageelements.qmlproject)0
-rw-r--r--examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/rssnews/main.cpp54
-rw-r--r--examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml53
-rw-r--r--examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml82
-rw-r--r--examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml71
-rw-r--r--examples/declarative/demos/rssnews/qml/content/RssFeeds.qml59
-rw-r--r--examples/declarative/demos/rssnews/qml/content/ScrollBar.qml107
-rw-r--r--examples/declarative/demos/rssnews/qml/content/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--examples/declarative/demos/rssnews/qml/content/images/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--examples/declarative/demos/rssnews/qml/rssnews.qml111
-rw-r--r--examples/declarative/demos/rssnews/qml/rssnews.qmlproject (renamed from examples/declarative/keyinteraction/focus/focus.qmlproject)0
-rw-r--r--examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/rssnews/rssnews.desktop11
-rw-r--r--examples/declarative/demos/rssnews/rssnews.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/rssnews/rssnews.pro39
-rw-r--r--examples/declarative/demos/rssnews/rssnews.svg93
-rw-r--r--examples/declarative/demos/samegame/main.cpp54
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml109
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/Button.qml75
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml77
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/background.pngbin0 -> 313930 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.pngbin0 -> 278 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.pngbin0 -> 3054 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.pngbin0 -> 273 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.pngbin0 -> 2932 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.pngbin0 -> 274 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.pngbin0 -> 2902 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/star.pngbin0 -> 262 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.pngbin0 -> 3056 bytes
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/qmldir3
-rw-r--r--examples/declarative/demos/samegame/qml/SamegameCore/samegame.js238
-rw-r--r--examples/declarative/demos/samegame/qml/highscores/README1
-rw-r--r--examples/declarative/demos/samegame/qml/highscores/score_data.xml2
-rw-r--r--examples/declarative/demos/samegame/qml/highscores/score_style.xsl28
-rw-r--r--examples/declarative/demos/samegame/qml/highscores/scores.php34
-rw-r--r--examples/declarative/demos/samegame/qml/samegame.qml161
-rw-r--r--examples/declarative/demos/samegame/qml/samegame.qmlproject (renamed from examples/declarative/keyinteraction/keyinteraction.qmlproject)0
-rw-r--r--examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/samegame/samegame.desktop11
-rw-r--r--examples/declarative/demos/samegame/samegame.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/samegame/samegame.pro39
-rw-r--r--examples/declarative/demos/samegame/samegame.svg93
-rw-r--r--examples/declarative/demos/twitter/main.cpp54
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/Button.qml90
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml105
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/Input.qml65
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml49
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml60
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml76
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml124
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml130
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml64
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml65
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.pngbin0 -> 1236 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci5
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/loading.pngbin0 -> 813 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.pngbin0 -> 257 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci5
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci5
-rw-r--r--examples/declarative/demos/twitter/qml/TwitterCore/qmldir10
-rw-r--r--examples/declarative/demos/twitter/qml/twitter.qml134
-rw-r--r--examples/declarative/demos/twitter/qml/twitter.qmlproject (renamed from examples/declarative/modelviews/modelviews.qmlproject)0
-rw-r--r--examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/twitter/twitter.desktop11
-rw-r--r--examples/declarative/demos/twitter/twitter.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/twitter/twitter.pro39
-rw-r--r--examples/declarative/demos/twitter/twitter.svg93
-rw-r--r--examples/declarative/demos/webbrowser/main.cpp54
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/Button.qml65
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml195
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/Header.qml150
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml107
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/UrlInput.qml96
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/display.pngbin0 -> 998 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.pngbin0 -> 408 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.pngbin0 -> 1310 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.pngbin0 -> 1080 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.pngbin0 -> 213 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.pngbin0 -> 2182 bytes
-rw-r--r--examples/declarative/demos/webbrowser/qml/webbrowser.qml79
-rw-r--r--examples/declarative/demos/webbrowser/qml/webbrowser.qmlproject (renamed from examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject)0
-rw-r--r--examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/demos/webbrowser/webbrowser.desktop11
-rw-r--r--examples/declarative/demos/webbrowser/webbrowser.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/demos/webbrowser/webbrowser.pro39
-rw-r--r--examples/declarative/demos/webbrowser/webbrowser.svg93
-rw-r--r--examples/declarative/i18n/i18n.desktop11
-rw-r--r--examples/declarative/i18n/i18n.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/i18n/i18n.pro39
-rw-r--r--examples/declarative/i18n/i18n.svg93
-rw-r--r--examples/declarative/i18n/i18n/qml_en_AU.qmbin81 -> 0 bytes
-rw-r--r--examples/declarative/i18n/i18n/qml_fr.qmbin85 -> 0 bytes
-rw-r--r--examples/declarative/i18n/main.cpp54
-rw-r--r--examples/declarative/i18n/qml/i18n.qml78
-rw-r--r--examples/declarative/i18n/qml/i18n.qmlproject (renamed from examples/declarative/text/text.qmlproject)0
-rw-r--r--examples/declarative/i18n/qml/i18n/base.ts (renamed from examples/declarative/i18n/i18n/base.ts)0
-rw-r--r--examples/declarative/i18n/qml/i18n/qml_en_AU.ts (renamed from examples/declarative/i18n/i18n/qml_en_AU.ts)0
-rw-r--r--examples/declarative/i18n/qml/i18n/qml_fr.ts (renamed from examples/declarative/i18n/i18n/qml_fr.ts)0
-rw-r--r--examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.desktop11
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.pro39
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.svg93
-rw-r--r--examples/declarative/imageelements/borderimage/main.cpp54
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage.qml97
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage.qmlproject (renamed from examples/declarative/text/textselection/textselection.qmlproject)0
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml90
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml54
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/bw.png (renamed from examples/declarative/imageelements/borderimage/content/bw.png)bin1357 -> 1357 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/colors-round.sci (renamed from examples/declarative/imageelements/borderimage/content/colors-round.sci)0
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/colors-stretch.sci (renamed from examples/declarative/imageelements/borderimage/content/colors-stretch.sci)0
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/colors.png (renamed from examples/declarative/imageelements/borderimage/content/colors.png)bin1655 -> 1655 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/qml/content/shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/qml/shadows.qml64
-rw-r--r--examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/imageelements/image/image.desktop11
-rw-r--r--examples/declarative/imageelements/image/image.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/imageelements/image/image.pro39
-rw-r--r--examples/declarative/imageelements/image/image.svg93
-rw-r--r--examples/declarative/imageelements/image/main.cpp54
-rw-r--r--examples/declarative/imageelements/image/qml/ImageCell.qml60
-rw-r--r--examples/declarative/imageelements/image/qml/image.qml66
-rw-r--r--examples/declarative/imageelements/image/qml/image.qmlproject (renamed from examples/declarative/threading/threading.qmlproject)0
-rw-r--r--examples/declarative/imageelements/image/qml/qt-logo.png (renamed from examples/declarative/imageelements/image/qt-logo.png)bin5149 -> 5149 bytes
-rw-r--r--examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/imageelements/shadows/main.cpp54
-rw-r--r--examples/declarative/imageelements/shadows/qml/borderimage.qml97
-rw-r--r--examples/declarative/imageelements/shadows/qml/borderimage.qmlproject (renamed from examples/declarative/touchinteraction/gestures/gestures.qmlproject)0
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml90
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml54
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/bw.pngbin0 -> 1357 bytes
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/colors-round.sci7
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/colors-stretch.sci5
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/colors.pngbin0 -> 1655 bytes
-rw-r--r--examples/declarative/imageelements/shadows/qml/content/shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows.qml64
-rw-r--r--examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/imageelements/shadows/shadows.desktop11
-rw-r--r--examples/declarative/imageelements/shadows/shadows.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/imageelements/shadows/shadows.pro39
-rw-r--r--examples/declarative/imageelements/shadows/shadows.svg93
-rw-r--r--examples/declarative/keyinteraction/focus/focus.desktop11
-rw-r--r--examples/declarative/keyinteraction/focus/focus.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/focus.pro39
-rw-r--r--examples/declarative/keyinteraction/focus/focus.svg93
-rw-r--r--examples/declarative/keyinteraction/focus/main.cpp54
-rw-r--r--examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml65
-rw-r--r--examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml105
-rw-r--r--examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml105
-rw-r--r--examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml85
-rw-r--r--examples/declarative/keyinteraction/focus/qml/Core/images/arrow.png (renamed from examples/declarative/keyinteraction/focus/Core/images/arrow.png)bin583 -> 583 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png (renamed from examples/declarative/keyinteraction/focus/Core/images/qt-logo.png)bin5149 -> 5149 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus.qml111
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus.qmlproject (renamed from examples/declarative/touchinteraction/touchinteraction.qmlproject)0
-rw-r--r--examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/Delegate/Delegate.desktop11
-rw-r--r--examples/declarative/modelviews/Delegate/Delegate.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/Delegate/Delegate.pro39
-rw-r--r--examples/declarative/modelviews/Delegate/Delegate.svg93
-rw-r--r--examples/declarative/modelviews/Delegate/main.cpp54
-rw-r--r--examples/declarative/modelviews/Delegate/qml/Delegate.qml88
-rw-r--r--examples/declarative/modelviews/Delegate/qml/package.qmlproject (renamed from examples/declarative/toys/clocks/clocks.qmlproject)0
-rw-r--r--examples/declarative/modelviews/Delegate/qml/view.qml76
-rw-r--r--examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/gridview-example/gridviewexample.desktop11
-rw-r--r--examples/declarative/modelviews/gridview-example/gridviewexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/gridviewexample.pro39
-rw-r--r--examples/declarative/modelviews/gridview-example/gridviewexample.svg93
-rw-r--r--examples/declarative/modelviews/gridview-example/main.cpp54
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/gridview-example.qml89
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/gridview.qmlproject (renamed from examples/declarative/toys/corkboards/corkboards.qmlproject)0
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png (renamed from examples/declarative/modelviews/gridview/pics/AddressBook_48.png)bin3350 -> 3350 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png (renamed from examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png)bin3806 -> 3806 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png (renamed from examples/declarative/modelviews/gridview/pics/Camera_48.png)bin3540 -> 3540 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png (renamed from examples/declarative/modelviews/gridview/pics/DateBook_48.png)bin2610 -> 2610 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png (renamed from examples/declarative/modelviews/gridview/pics/EMail_48.png)bin3655 -> 3655 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png (renamed from examples/declarative/modelviews/gridview/pics/TodoList_48.png)bin3429 -> 3429 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png (renamed from examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png)bin4151 -> 4151 bytes
-rw-r--r--examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop11
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro39
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg93
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg (renamed from examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg)bin17952 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg (renamed from examples/declarative/modelviews/listview/content/pics/hamburger.jpg)bin8572 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg (renamed from examples/declarative/modelviews/listview/content/pics/lemonade.jpg)bin6645 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png (renamed from examples/declarative/modelviews/listview/content/pics/moreDown.png)bin217 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png (renamed from examples/declarative/modelviews/listview/content/pics/moreUp.png)bin212 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg (renamed from examples/declarative/modelviews/listview/content/pics/pancakes.jpg)bin9163 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg (renamed from examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg)bin8639 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/listview.qmlproject (renamed from examples/declarative/toys/dynamicscene/dynamicscene.qmlproject)0
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop11
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro39
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg93
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/listview.qmlproject (renamed from examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject)0
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.desktop11
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.pro39
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.svg93
-rw-r--r--examples/declarative/modelviews/listview/highlight/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/listview.qmlproject (renamed from examples/declarative/toys/toys.qmlproject)0
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop11
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.pro39
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.svg93
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/listview.qmlproject (renamed from examples/declarative/toys/tvtennis/tvtennis.qmlproject)0
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/listview/sections/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/listview.qmlproject (renamed from examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject)0
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.desktop11
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.pro39
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.svg93
-rw-r--r--examples/declarative/modelviews/pathview-example/main.cpp54
-rw-r--r--examples/declarative/modelviews/pathview-example/pathviewexample.desktop11
-rw-r--r--examples/declarative/modelviews/pathview-example/pathviewexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/pathviewexample.pro39
-rw-r--r--examples/declarative/modelviews/pathview-example/pathviewexample.svg93
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pathview-example.qml109
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pathview.qmlproject (renamed from examples/declarative/ui-components/flipable/flipable.qmlproject)0
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png (renamed from examples/declarative/modelviews/pathview/pics/AddressBook_48.png)bin3350 -> 3350 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png (renamed from examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png)bin3806 -> 3806 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png (renamed from examples/declarative/modelviews/pathview/pics/Camera_48.png)bin3540 -> 3540 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png (renamed from examples/declarative/modelviews/pathview/pics/DateBook_48.png)bin2610 -> 2610 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png (renamed from examples/declarative/modelviews/pathview/pics/EMail_48.png)bin3655 -> 3655 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png (renamed from examples/declarative/modelviews/pathview/pics/TodoList_48.png)bin3429 -> 3429 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png (renamed from examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png)bin4151 -> 4151 bytes
-rw-r--r--examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/modelviews/visualitemmodel/main.cpp54
-rw-r--r--examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml107
-rw-r--r--examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qmlproject (renamed from examples/declarative/ui-components/progressbar/progressbar.qmlproject)0
-rw-r--r--examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop11
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro39
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg93
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.desktop11
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.pro39
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.svg93
-rw-r--r--examples/declarative/modelviews/webview/alerts/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/alerts.html (renamed from examples/declarative/modelviews/webview/alerts.html)0
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/alerts.qml101
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/autosize.qml106
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml73
-rw-r--r--[-rwxr-xr-x]examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html (renamed from examples/declarative/modelviews/webview/content/Mapping/map.html)0
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png (renamed from examples/declarative/modelviews/webview/content/pics/cancel.png)bin1038 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png (renamed from examples/declarative/modelviews/webview/content/pics/ok.png)bin655 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml83
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml55
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/newwindows.html (renamed from examples/declarative/modelviews/webview/newwindows.html)0
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/newwindows.qml71
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/webview.qmlproject (renamed from examples/declarative/ui-components/slideswitch/slideswitch.qmlproject)0
-rw-r--r--examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.desktop11
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.pro39
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.svg93
-rw-r--r--examples/declarative/modelviews/webview/autosize/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/alerts.html5
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/alerts.qml101
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/autosize.qml106
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml73
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html60
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.pngbin0 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.pngbin0 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml83
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml55
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/newwindows.html3
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/newwindows.qml71
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/webview.qmlproject (renamed from examples/declarative/ui-components/ui-components.qmlproject)0
-rw-r--r--examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop11
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.pro39
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.svg93
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/alerts.html5
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml101
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml106
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml73
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html60
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.pngbin0 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.pngbin0 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml83
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml55
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html3
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml71
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/webview.qmlproject (renamed from examples/declarative/xml/xml.qmlproject)0
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop11
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro39
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg93
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html5
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml101
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml106
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml73
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html60
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.pngbin0 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.pngbin0 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml83
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml55
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html3
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml71
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/modelviews/webview/newwindows/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.desktop11
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.pro39
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.svg93
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/alerts.html5
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/alerts.qml101
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/autosize.qml106
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml73
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html60
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.pngbin0 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.pngbin0 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml83
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml55
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/newwindows.html3
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml71
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/positioners/main.cpp54
-rw-r--r--examples/declarative/positioners/positioners.desktop11
-rw-r--r--examples/declarative/positioners/positioners.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/positioners/positioners.pro39
-rw-r--r--examples/declarative/positioners/positioners.svg93
-rw-r--r--examples/declarative/positioners/qml/Button.qml78
-rw-r--r--examples/declarative/positioners/qml/add.png (renamed from examples/declarative/positioners/add.png)bin810 -> 810 bytes
-rw-r--r--examples/declarative/positioners/qml/del.png (renamed from examples/declarative/positioners/del.png)bin488 -> 488 bytes
-rw-r--r--examples/declarative/positioners/qml/positioners.qml253
-rw-r--r--examples/declarative/positioners/qml/positioners.qmlproject (renamed from examples/declarative/positioners/positioners.qmlproject)0
-rw-r--r--examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.qml12
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.desktop11
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.pro39
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.svg93
-rw-r--r--examples/declarative/text/fonts/availableFonts/main.cpp54
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/banner.qml61
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/fonts.qmlproject16
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/fonts/tarzeau_ocr_a.ttf (renamed from examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf)bin24544 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/hello.qml79
-rw-r--r--examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/text/fonts/banner/banner.desktop11
-rw-r--r--examples/declarative/text/fonts/banner/banner.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/banner/banner.pro39
-rw-r--r--examples/declarative/text/fonts/banner/banner.svg93
-rw-r--r--examples/declarative/text/fonts/banner/main.cpp54
-rw-r--r--examples/declarative/text/fonts/banner/qml/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/banner/qml/banner.qml61
-rw-r--r--examples/declarative/text/fonts/banner/qml/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/banner/qml/fonts.qmlproject16
-rw-r--r--examples/declarative/text/fonts/banner/qml/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/banner/qml/hello.qml79
-rw-r--r--examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.desktop11
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.pro39
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.svg93
-rw-r--r--examples/declarative/text/fonts/fonts/main.cpp54
-rw-r--r--examples/declarative/text/fonts/fonts/qml/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/fonts/qml/banner.qml61
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts.qmlproject16
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/fonts/qml/hello.qml79
-rw-r--r--examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/text/fonts/hello/hello.desktop11
-rw-r--r--examples/declarative/text/fonts/hello/hello.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/hello/hello.pro39
-rw-r--r--examples/declarative/text/fonts/hello/hello.svg93
-rw-r--r--examples/declarative/text/fonts/hello/main.cpp54
-rw-r--r--examples/declarative/text/fonts/hello/qml/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/hello/qml/banner.qml61
-rw-r--r--examples/declarative/text/fonts/hello/qml/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/hello/qml/fonts.qmlproject16
-rw-r--r--examples/declarative/text/fonts/hello/qml/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/hello/qml/hello.qml79
-rw-r--r--examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/text/textselection/main.cpp54
-rw-r--r--examples/declarative/text/textselection/qml/pics/endHandle.png (renamed from examples/declarative/text/textselection/pics/endHandle.png)bin185 -> 185 bytes
-rw-r--r--examples/declarative/text/textselection/qml/pics/endHandle.sci (renamed from examples/declarative/text/textselection/pics/endHandle.sci)0
-rw-r--r--examples/declarative/text/textselection/qml/pics/startHandle.png (renamed from examples/declarative/text/textselection/pics/startHandle.png)bin178 -> 178 bytes
-rw-r--r--examples/declarative/text/textselection/qml/pics/startHandle.sci (renamed from examples/declarative/text/textselection/pics/startHandle.sci)0
-rw-r--r--examples/declarative/text/textselection/qml/textselection.qml290
-rw-r--r--examples/declarative/text/textselection/qml/textselection.qmlproject16
-rw-r--r--examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/text/textselection/textselection.desktop11
-rw-r--r--examples/declarative/text/textselection/textselection.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/textselection/textselection.pro39
-rw-r--r--examples/declarative/text/textselection/textselection.svg93
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.desktop11
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro39
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg93
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp54
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures.qml76
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/qml/gestures.qmlproject16
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp54
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.desktop11
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro39
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg93
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example.qml112
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea.qmlproject16
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/touchinteraction/touchinteraction.pro4
-rw-r--r--examples/declarative/toys/README37
-rw-r--r--examples/declarative/toys/clocks/clocks.desktop11
-rw-r--r--examples/declarative/toys/clocks/clocks.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/clocks/clocks.pro39
-rw-r--r--examples/declarative/toys/clocks/clocks.svg93
-rw-r--r--examples/declarative/toys/clocks/main.cpp54
-rw-r--r--examples/declarative/toys/clocks/qml/clocks.qml59
-rw-r--r--examples/declarative/toys/clocks/qml/clocks.qmlproject16
-rw-r--r--examples/declarative/toys/clocks/qml/content/Clock.qml124
-rw-r--r--examples/declarative/toys/clocks/qml/content/QuitButton.qml52
-rw-r--r--examples/declarative/toys/clocks/qml/content/background.pngbin0 -> 46895 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/center.pngbin0 -> 765 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/clock-night.pngbin0 -> 23359 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/clock.pngbin0 -> 20653 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/hour.pngbin0 -> 625 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/minute.pngbin0 -> 625 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/quit.png (renamed from examples/declarative/ui-components/dialcontrol/content/quit.png)bin583 -> 583 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/content/second.pngbin0 -> 303 bytes
-rw-r--r--examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/toys/corkboards/corkboards.desktop11
-rw-r--r--examples/declarative/toys/corkboards/corkboards.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/corkboards/corkboards.pro39
-rw-r--r--examples/declarative/toys/corkboards/corkboards.svg93
-rw-r--r--examples/declarative/toys/corkboards/main.cpp54
-rw-r--r--examples/declarative/toys/corkboards/qml/Day.qml153
-rw-r--r--examples/declarative/toys/corkboards/qml/cork.jpg (renamed from examples/declarative/toys/corkboards/cork.jpg)bin149337 -> 149337 bytes
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards.qml115
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards.qmlproject16
-rw-r--r--examples/declarative/toys/corkboards/qml/note-yellow.png (renamed from examples/declarative/toys/corkboards/note-yellow.png)bin54559 -> 54559 bytes
-rw-r--r--examples/declarative/toys/corkboards/qml/tack.png (renamed from examples/declarative/toys/corkboards/tack.png)bin7282 -> 7282 bytes
-rw-r--r--examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.desktop11
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.pro39
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.svg93
-rw-r--r--examples/declarative/toys/dynamicscene/main.cpp54
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene.qml223
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene.qmlproject16
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/NOTE (renamed from examples/declarative/toys/dynamicscene/images/NOTE)0
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/moon.png (renamed from examples/declarative/toys/dynamicscene/images/moon.png)bin1757 -> 1757 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/rabbit_brown.png (renamed from examples/declarative/toys/dynamicscene/images/rabbit_brown.png)bin1245 -> 1245 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/rabbit_bw.png (renamed from examples/declarative/toys/dynamicscene/images/rabbit_bw.png)bin1759 -> 1759 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/sun.pngbin0 -> 8153 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/images/tree_s.png (renamed from examples/declarative/toys/dynamicscene/images/tree_s.png)bin3406 -> 3406 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/qml/Button.qml80
-rw-r--r--examples/declarative/toys/dynamicscene/qml/qml/GenericSceneItem.qml49
-rw-r--r--examples/declarative/toys/dynamicscene/qml/qml/PaletteItem.qml59
-rw-r--r--examples/declarative/toys/dynamicscene/qml/qml/PerspectiveItem.qml65
-rw-r--r--examples/declarative/toys/dynamicscene/qml/qml/Sun.qml78
-rw-r--r--examples/declarative/toys/dynamicscene/qml/qml/itemCreation.js (renamed from examples/declarative/toys/dynamicscene/qml/itemCreation.js)0
-rw-r--r--examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/toys/tic-tac-toe/main.cpp54
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/content/Button.qml79
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/content/TicTac.qml60
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/content/pics/board.png (renamed from examples/declarative/toys/tic-tac-toe/content/pics/board.png)bin12258 -> 12258 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/content/pics/o.png (renamed from examples/declarative/toys/tic-tac-toe/content/pics/o.png)bin1470 -> 1470 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/content/pics/x.png (renamed from examples/declarative/toys/tic-tac-toe/content/pics/x.png)bin1331 -> 1331 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/content/tic-tac-toe.js (renamed from examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js)0
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qml123
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qmlproject16
-rw-r--r--examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/toys/tic-tac-toe/tic-tac-toe.pro39
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.desktop11
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.pro39
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.svg93
-rw-r--r--examples/declarative/toys/tvtennis/main.cpp54
-rw-r--r--examples/declarative/toys/tvtennis/qml/tvtennis.qml109
-rw-r--r--examples/declarative/toys/tvtennis/qml/tvtennis.qmlproject16
-rw-r--r--examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.desktop11
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.pro39
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.svg93
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro1
-rw-r--r--examples/declarative/ui-components/README39
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.desktop11
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.pro39
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.svg93
-rw-r--r--examples/declarative/ui-components/dialcontrol/main.cpp54
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/Dial.qml86
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/QuitButton.qml52
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/background.png (renamed from examples/declarative/ui-components/dialcontrol/content/background.png)bin35876 -> 35876 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/needle.png (renamed from examples/declarative/ui-components/dialcontrol/content/needle.png)bin342 -> 342 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/needle_shadow.png (renamed from examples/declarative/ui-components/dialcontrol/content/needle_shadow.png)bin632 -> 632 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/overlay.png (renamed from examples/declarative/ui-components/dialcontrol/content/overlay.png)bin3564 -> 3564 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qml98
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qmlproject16
-rw-r--r--examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/ui-components/flipable/flipable.desktop11
-rw-r--r--examples/declarative/ui-components/flipable/flipable.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/flipable/flipable.pro39
-rw-r--r--examples/declarative/ui-components/flipable/flipable.svg93
-rw-r--r--examples/declarative/ui-components/flipable/main.cpp54
-rw-r--r--examples/declarative/ui-components/flipable/qml/content/5_heart.png (renamed from examples/declarative/ui-components/flipable/content/5_heart.png)bin3872 -> 3872 bytes
-rw-r--r--examples/declarative/ui-components/flipable/qml/content/9_club.png (renamed from examples/declarative/ui-components/flipable/content/9_club.png)bin6135 -> 6135 bytes
-rw-r--r--examples/declarative/ui-components/flipable/qml/content/Card.qml80
-rw-r--r--examples/declarative/ui-components/flipable/qml/content/back.png (renamed from examples/declarative/ui-components/flipable/content/back.png)bin1418 -> 1418 bytes
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable.qml55
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable.qmlproject16
-rw-r--r--examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/ui-components/main/main.cpp54
-rw-r--r--examples/declarative/ui-components/main/main.desktop11
-rw-r--r--examples/declarative/ui-components/main/main.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/main/main.pro39
-rw-r--r--examples/declarative/ui-components/main/main.svg93
-rw-r--r--examples/declarative/ui-components/main/qml/ScrollBar.qml74
-rw-r--r--examples/declarative/ui-components/main/qml/SearchBox.qml109
-rw-r--r--examples/declarative/ui-components/main/qml/TabWidget.qml102
-rw-r--r--examples/declarative/ui-components/main/qml/content/ProgressBar.qml83
-rw-r--r--examples/declarative/ui-components/main/qml/content/Spinner.qml70
-rw-r--r--examples/declarative/ui-components/main/qml/content/background.png (renamed from examples/declarative/ui-components/progressbar/content/background.png)bin426 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/content/spinner-bg.png (renamed from examples/declarative/ui-components/spinner/content/spinner-bg.png)bin345 -> 345 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/content/spinner-select.png (renamed from examples/declarative/ui-components/spinner/content/spinner-select.png)bin320 -> 320 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/images/clear.png (renamed from examples/declarative/ui-components/searchbox/images/clear.png)bin429 -> 429 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png (renamed from examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png)bin526 -> 526 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/images/lineedit-bg.png (renamed from examples/declarative/ui-components/searchbox/images/lineedit-bg.png)bin426 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main.qml99
-rw-r--r--examples/declarative/ui-components/main/qml/pics/niagara_falls.jpgbin0 -> 100161 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/progressbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/main/qml/scrollbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/main/qml/searchbox.qmlproject16
-rw-r--r--examples/declarative/ui-components/main/qml/spinner.qmlproject16
-rw-r--r--examples/declarative/ui-components/main/qml/tab.png (renamed from examples/declarative/ui-components/tabwidget/tab.png)bin507 -> 507 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/tabwidget.qmlproject16
-rw-r--r--examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/ui-components/progressbar/main.cpp54
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.desktop11
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.pro39
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.svg93
-rw-r--r--examples/declarative/ui-components/progressbar/qml/content/ProgressBar.qml83
-rw-r--r--examples/declarative/ui-components/progressbar/qml/content/background.pngbin0 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/progressbar/qml/main.qml73
-rw-r--r--examples/declarative/ui-components/progressbar/qml/progressbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpgbin604121 -> 0 bytes
-rw-r--r--examples/declarative/ui-components/slideswitch/main.cpp54
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/content/Switch.qml117
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/content/background.svg (renamed from examples/declarative/ui-components/slideswitch/content/background.svg)0
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/content/knob.svg (renamed from examples/declarative/ui-components/slideswitch/content/knob.svg)0
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/slideswitch.qml51
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/slideswitch.qmlproject16
-rw-r--r--examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/README6
-rw-r--r--examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/changelog5
-rw-r--r--examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/compat1
-rw-r--r--examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/control13
-rw-r--r--examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/copyright40
-rwxr-xr-xexamples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/rules91
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.desktop11
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.pro39
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.svg93
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/main.cpp54
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qml/data.xml (renamed from examples/declarative/xml/xmlhttprequest/data.xml)0
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example.qml95
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest.qmlproject16
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.cpp197
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.h79
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.pri154
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.desktop11
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro39
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg93
-rw-r--r--examples/designer/calculatorbuilder/calculatorbuilder.desktop11
-rw-r--r--examples/designer/calculatorbuilder/calculatorbuilder.pro4
-rw-r--r--examples/designer/calculatorform/calculatorform.desktop11
-rw-r--r--examples/designer/calculatorform/calculatorform.pro5
-rw-r--r--examples/designer/containerextension/containerextension.desktop11
-rw-r--r--examples/designer/containerextension/containerextension.pro4
-rw-r--r--examples/designer/customwidgetplugin/customwidgetplugin.desktop11
-rw-r--r--examples/designer/customwidgetplugin/customwidgetplugin.pro4
-rw-r--r--examples/designer/designer.pro1
-rw-r--r--examples/designer/taskmenuextension/taskmenuextension.desktop11
-rw-r--r--examples/designer/taskmenuextension/taskmenuextension.pro4
-rw-r--r--examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.desktop11
-rw-r--r--examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro4
-rw-r--r--examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro1
-rw-r--r--examples/desktop/desktop.pro1
-rw-r--r--examples/desktop/screenshot/screenshot.desktop11
-rw-r--r--examples/desktop/screenshot/screenshot.pro4
-rw-r--r--examples/desktop/systray/systray.desktop11
-rw-r--r--examples/desktop/systray/systray.pro5
-rw-r--r--examples/dialogs/classwizard/classwizard.desktop11
-rw-r--r--examples/dialogs/classwizard/classwizard.pro4
-rw-r--r--examples/dialogs/configdialog/configdialog.desktop11
-rw-r--r--examples/dialogs/configdialog/configdialog.pro4
-rw-r--r--examples/dialogs/dialogs.pro1
-rw-r--r--examples/dialogs/extension/extension.desktop11
-rw-r--r--examples/dialogs/extension/extension.pro2
-rw-r--r--examples/dialogs/extension/finddialog.cpp45
-rw-r--r--examples/dialogs/extension/main.cpp9
-rw-r--r--examples/dialogs/findfiles/findfiles.desktop11
-rw-r--r--examples/dialogs/findfiles/findfiles.pro1
-rw-r--r--examples/dialogs/findfiles/main.cpp4
-rw-r--r--examples/dialogs/findfiles/window.cpp23
-rw-r--r--examples/dialogs/findfiles/window.h4
-rw-r--r--examples/dialogs/licensewizard/licensewizard.desktop11
-rw-r--r--examples/dialogs/licensewizard/licensewizard.pro4
-rw-r--r--examples/dialogs/sipdialog/sipdialog.desktop11
-rw-r--r--examples/dialogs/sipdialog/sipdialog.pro5
-rw-r--r--examples/dialogs/standarddialogs/dialog.cpp15
-rw-r--r--examples/dialogs/standarddialogs/dialog.h4
-rw-r--r--examples/dialogs/standarddialogs/main.cpp8
-rw-r--r--examples/dialogs/standarddialogs/standarddialogs.desktop11
-rw-r--r--examples/dialogs/standarddialogs/standarddialogs.pro1
-rw-r--r--examples/dialogs/tabdialog/main.cpp8
-rw-r--r--examples/dialogs/tabdialog/tabdialog.cpp1
-rw-r--r--examples/dialogs/tabdialog/tabdialog.desktop11
-rw-r--r--examples/dialogs/tabdialog/tabdialog.pro3
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.cpp4
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.desktop11
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.pro3
-rw-r--r--examples/draganddrop/delayedencoding/delayedencoding.desktop11
-rw-r--r--examples/draganddrop/delayedencoding/delayedencoding.pro9
-rw-r--r--examples/draganddrop/delayedencoding/main.cpp4
-rw-r--r--examples/draganddrop/delayedencoding/sourcewidget.cpp1
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.desktop11
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.pro1
-rw-r--r--examples/draganddrop/draggableicons/dragwidget.cpp9
-rw-r--r--examples/draganddrop/draggableicons/main.cpp4
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.desktop11
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.pro2
-rw-r--r--examples/draganddrop/draggabletext/dragwidget.cpp4
-rw-r--r--examples/draganddrop/draggabletext/main.cpp4
-rw-r--r--examples/draganddrop/dropsite/dropsite.desktop11
-rw-r--r--examples/draganddrop/dropsite/dropsite.pro4
-rw-r--r--examples/draganddrop/fridgemagnets/dragwidget.cpp4
-rw-r--r--examples/draganddrop/fridgemagnets/fridgemagnets.desktop11
-rw-r--r--examples/draganddrop/fridgemagnets/fridgemagnets.pro2
-rw-r--r--examples/draganddrop/fridgemagnets/main.cpp6
-rw-r--r--examples/draganddrop/puzzle/main.cpp4
-rw-r--r--examples/draganddrop/puzzle/mainwindow.cpp16
-rw-r--r--examples/draganddrop/puzzle/pieceslist.cpp6
-rw-r--r--examples/draganddrop/puzzle/pieceslist.h4
-rw-r--r--examples/draganddrop/puzzle/puzzle.desktop11
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro1
-rw-r--r--examples/draganddrop/puzzle/puzzlewidget.cpp26
-rw-r--r--examples/draganddrop/puzzle/puzzlewidget.h6
-rw-r--r--examples/effects/blurpicker/blurpicker.cpp32
-rw-r--r--examples/effects/blurpicker/blurpicker.desktop11
-rw-r--r--examples/effects/blurpicker/blurpicker.h2
-rw-r--r--examples/effects/blurpicker/blurpicker.pro3
-rw-r--r--examples/effects/blurpicker/main.cpp5
-rw-r--r--examples/effects/fademessage/fademessage.cpp11
-rw-r--r--examples/effects/fademessage/fademessage.desktop11
-rw-r--r--examples/effects/fademessage/fademessage.pro4
-rw-r--r--examples/effects/fademessage/main.cpp4
-rw-r--r--examples/effects/lighting/lighting.cpp6
-rw-r--r--examples/effects/lighting/lighting.desktop11
-rw-r--r--examples/effects/lighting/lighting.h3
-rw-r--r--examples/effects/lighting/lighting.pro4
-rw-r--r--examples/effects/lighting/main.cpp5
-rw-r--r--examples/examples.pro1
-rw-r--r--examples/gestures/imagegestures/imagegestures.desktop11
-rw-r--r--examples/gestures/imagegestures/imagegestures.pro4
-rw-r--r--examples/graphicsview/anchorlayout/anchorlayout.desktop11
-rw-r--r--examples/graphicsview/anchorlayout/anchorlayout.pro5
-rw-r--r--examples/graphicsview/anchorlayout/main.cpp5
-rw-r--r--examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.desktop11
-rw-r--r--examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro2
-rw-r--r--examples/graphicsview/basicgraphicslayouts/main.cpp4
-rw-r--r--examples/graphicsview/collidingmice/collidingmice.desktop11
-rw-r--r--examples/graphicsview/collidingmice/collidingmice.pro2
-rw-r--r--examples/graphicsview/collidingmice/main.cpp4
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.desktop11
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.pro4
-rw-r--r--examples/graphicsview/diagramscene/mainwindow.cpp4
-rw-r--r--examples/graphicsview/dragdroprobot/dragdroprobot.desktop11
-rw-r--r--examples/graphicsview/dragdroprobot/dragdroprobot.pro3
-rw-r--r--examples/graphicsview/dragdroprobot/main.cpp24
-rw-r--r--examples/graphicsview/elasticnodes/edge.cpp2
-rw-r--r--examples/graphicsview/elasticnodes/elasticnodes.desktop11
-rw-r--r--examples/graphicsview/elasticnodes/elasticnodes.pro3
-rw-r--r--examples/graphicsview/elasticnodes/graphwidget.cpp29
-rw-r--r--examples/graphicsview/elasticnodes/graphwidget.h5
-rw-r--r--examples/graphicsview/elasticnodes/main.cpp15
-rw-r--r--examples/graphicsview/elasticnodes/node.cpp15
-rw-r--r--examples/graphicsview/flowlayout/flowlayout.desktop11
-rw-r--r--examples/graphicsview/flowlayout/flowlayout.pro5
-rw-r--r--examples/graphicsview/flowlayout/main.cpp6
-rw-r--r--examples/graphicsview/graphicsview.pro1
-rw-r--r--examples/graphicsview/padnavigator/main.cpp5
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.desktop11
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.pro3
-rw-r--r--examples/graphicsview/portedasteroids/animateditem.cpp11
-rw-r--r--examples/graphicsview/portedasteroids/animateditem.h18
-rw-r--r--examples/graphicsview/portedasteroids/ledmeter.cpp40
-rw-r--r--examples/graphicsview/portedasteroids/ledmeter.h12
-rw-r--r--examples/graphicsview/portedasteroids/main.cpp4
-rw-r--r--examples/graphicsview/portedasteroids/portedasteroids.desktop11
-rw-r--r--examples/graphicsview/portedasteroids/portedasteroids.pro13
-rw-r--r--examples/graphicsview/portedasteroids/sprites.h2
-rw-r--r--examples/graphicsview/portedasteroids/toplevel.cpp85
-rw-r--r--examples/graphicsview/portedasteroids/toplevel.h15
-rw-r--r--examples/graphicsview/portedasteroids/view.cpp270
-rw-r--r--examples/graphicsview/portedasteroids/view.h21
-rw-r--r--examples/graphicsview/portedcanvas/canvas.cpp259
-rw-r--r--examples/graphicsview/portedcanvas/canvas.h14
-rw-r--r--examples/graphicsview/portedcanvas/main.cpp23
-rw-r--r--examples/graphicsview/portedcanvas/portedcanvas.desktop11
-rw-r--r--examples/graphicsview/portedcanvas/portedcanvas.pro4
-rw-r--r--examples/graphicsview/simpleanchorlayout/main.cpp7
-rw-r--r--examples/graphicsview/simpleanchorlayout/simpleanchorlayout.desktop11
-rw-r--r--examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro4
-rw-r--r--examples/graphicsview/weatheranchorlayout/main.cpp23
-rw-r--r--examples/graphicsview/weatheranchorlayout/weatheranchorlayout.desktop11
-rw-r--r--examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro3
-rw-r--r--examples/help/contextsensitivehelp/contextsensitivehelp.desktop11
-rw-r--r--examples/help/contextsensitivehelp/contextsensitivehelp.pro5
-rw-r--r--examples/help/help.pro1
-rw-r--r--examples/help/remotecontrol/remotecontrol.desktop11
-rw-r--r--examples/help/remotecontrol/remotecontrol.pro5
-rw-r--r--examples/help/simpletextviewer/simpletextviewer.desktop11
-rw-r--r--examples/help/simpletextviewer/simpletextviewer.pro4
-rw-r--r--examples/ipc/ipc.pro1
-rw-r--r--examples/ipc/localfortuneclient/client.cpp5
-rw-r--r--examples/ipc/localfortuneclient/client.h9
-rw-r--r--examples/ipc/localfortuneclient/localfortuneclient.desktop11
-rw-r--r--examples/ipc/localfortuneclient/localfortuneclient.pro4
-rw-r--r--examples/ipc/localfortuneclient/main.cpp6
-rw-r--r--examples/ipc/localfortuneserver/localfortuneserver.desktop11
-rw-r--r--examples/ipc/localfortuneserver/localfortuneserver.pro3
-rw-r--r--examples/ipc/localfortuneserver/main.cpp6
-rw-r--r--examples/ipc/localfortuneserver/server.cpp5
-rw-r--r--examples/ipc/localfortuneserver/server.h8
-rw-r--r--examples/ipc/sharedmemory/sharedmemory.desktop11
-rw-r--r--examples/ipc/sharedmemory/sharedmemory.pro5
-rw-r--r--examples/itemviews/addressbook/addressbook.desktop11
-rw-r--r--examples/itemviews/addressbook/addressbook.pro2
-rw-r--r--examples/itemviews/addressbook/main.cpp4
-rw-r--r--examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.desktop11
-rw-r--r--examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro2
-rw-r--r--examples/itemviews/basicsortfiltermodel/main.cpp4
-rw-r--r--examples/itemviews/basicsortfiltermodel/window.cpp41
-rw-r--r--examples/itemviews/basicsortfiltermodel/window.h6
-rw-r--r--examples/itemviews/chart/chart.desktop11
-rw-r--r--examples/itemviews/chart/chart.pro2
-rw-r--r--examples/itemviews/chart/main.cpp4
-rw-r--r--examples/itemviews/coloreditorfactory/coloreditorfactory.desktop11
-rw-r--r--examples/itemviews/coloreditorfactory/coloreditorfactory.pro4
-rw-r--r--examples/itemviews/coloreditorfactory/main.cpp4
-rw-r--r--examples/itemviews/combowidgetmapper/combowidgetmapper.desktop11
-rw-r--r--examples/itemviews/combowidgetmapper/combowidgetmapper.pro3
-rw-r--r--examples/itemviews/combowidgetmapper/main.cpp4
-rw-r--r--examples/itemviews/customsortfiltermodel/customsortfiltermodel.desktop11
-rw-r--r--examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro1
-rw-r--r--examples/itemviews/customsortfiltermodel/main.cpp4
-rw-r--r--examples/itemviews/customsortfiltermodel/window.cpp62
-rw-r--r--examples/itemviews/customsortfiltermodel/window.h6
-rw-r--r--examples/itemviews/dirview/dirview.desktop11
-rw-r--r--examples/itemviews/dirview/dirview.pro2
-rw-r--r--examples/itemviews/dirview/main.cpp4
-rw-r--r--examples/itemviews/editabletreemodel/editabletreemodel.desktop11
-rw-r--r--examples/itemviews/editabletreemodel/editabletreemodel.pro2
-rw-r--r--examples/itemviews/editabletreemodel/main.cpp4
-rw-r--r--examples/itemviews/editabletreemodel/mainwindow.cpp5
-rw-r--r--examples/itemviews/fetchmore/fetchmore.desktop11
-rw-r--r--examples/itemviews/fetchmore/fetchmore.pro2
-rw-r--r--examples/itemviews/fetchmore/main.cpp4
-rw-r--r--examples/itemviews/frozencolumn/frozencolumn.desktop11
-rw-r--r--examples/itemviews/frozencolumn/frozencolumn.pro3
-rw-r--r--examples/itemviews/frozencolumn/main.cpp6
-rw-r--r--examples/itemviews/itemviews.pro9
-rw-r--r--examples/itemviews/pixelator/main.cpp4
-rw-r--r--examples/itemviews/pixelator/pixelator.desktop11
-rw-r--r--examples/itemviews/pixelator/pixelator.pro2
-rw-r--r--examples/itemviews/pixelator/pixeldelegate.cpp2
-rw-r--r--examples/itemviews/puzzle/main.cpp4
-rw-r--r--examples/itemviews/puzzle/mainwindow.cpp20
-rw-r--r--examples/itemviews/puzzle/piecesmodel.cpp8
-rw-r--r--examples/itemviews/puzzle/piecesmodel.h4
-rw-r--r--examples/itemviews/puzzle/puzzle.desktop11
-rw-r--r--examples/itemviews/puzzle/puzzle.pro2
-rw-r--r--examples/itemviews/puzzle/puzzlewidget.cpp26
-rw-r--r--examples/itemviews/puzzle/puzzlewidget.h6
-rw-r--r--examples/itemviews/simpledommodel/main.cpp6
-rw-r--r--examples/itemviews/simpledommodel/simpledommodel.desktop11
-rw-r--r--examples/itemviews/simpledommodel/simpledommodel.pro2
-rw-r--r--examples/itemviews/simpletreemodel/main.cpp4
-rw-r--r--examples/itemviews/simpletreemodel/simpletreemodel.desktop11
-rw-r--r--examples/itemviews/simpletreemodel/simpletreemodel.pro2
-rw-r--r--examples/itemviews/simplewidgetmapper/main.cpp4
-rw-r--r--examples/itemviews/simplewidgetmapper/simplewidgetmapper.desktop11
-rw-r--r--examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro2
-rw-r--r--examples/itemviews/spinboxdelegate/main.cpp4
-rw-r--r--examples/itemviews/spinboxdelegate/spinboxdelegate.desktop11
-rw-r--r--examples/itemviews/spinboxdelegate/spinboxdelegate.pro5
-rw-r--r--examples/itemviews/stardelegate/main.cpp4
-rw-r--r--examples/itemviews/stardelegate/stardelegate.desktop11
-rw-r--r--examples/itemviews/stardelegate/stardelegate.pro4
-rw-r--r--examples/ja_JP/linguist/hellotr/hellotr.pro2
-rw-r--r--examples/layouts/basiclayouts/basiclayouts.desktop11
-rw-r--r--examples/layouts/basiclayouts/basiclayouts.pro5
-rw-r--r--examples/layouts/basiclayouts/main.cpp8
-rw-r--r--examples/layouts/borderlayout/borderlayout.desktop11
-rw-r--r--examples/layouts/borderlayout/borderlayout.pro2
-rw-r--r--examples/layouts/borderlayout/main.cpp4
-rw-r--r--examples/layouts/dynamiclayouts/dialog.cpp4
-rw-r--r--examples/layouts/dynamiclayouts/dialog.h5
-rw-r--r--examples/layouts/dynamiclayouts/dynamiclayouts.desktop11
-rw-r--r--examples/layouts/dynamiclayouts/dynamiclayouts.pro5
-rw-r--r--examples/layouts/dynamiclayouts/main.cpp7
-rw-r--r--examples/layouts/flowlayout/flowlayout.desktop11
-rw-r--r--examples/layouts/flowlayout/flowlayout.pro2
-rw-r--r--examples/layouts/flowlayout/main.cpp4
-rw-r--r--examples/layouts/flowlayout/window.cpp2
-rw-r--r--examples/layouts/layouts.pro1
-rw-r--r--examples/linguist/arrowpad/arrowpad.desktop11
-rw-r--r--examples/linguist/arrowpad/arrowpad.pro5
-rw-r--r--examples/linguist/hellotr/hellotr.desktop11
-rw-r--r--examples/linguist/hellotr/hellotr.pro5
-rw-r--r--examples/linguist/linguist.pro1
-rw-r--r--examples/linguist/trollprint/trollprint.desktop11
-rw-r--r--examples/linguist/trollprint/trollprint.pro5
-rw-r--r--examples/maemo5pkgrules.pri27
-rw-r--r--examples/mainwindows/application/application.desktop11
-rw-r--r--examples/mainwindows/application/application.pro4
-rw-r--r--examples/mainwindows/application/main.cpp4
-rw-r--r--examples/mainwindows/dockwidgets/dockwidgets.desktop11
-rw-r--r--examples/mainwindows/dockwidgets/dockwidgets.pro5
-rw-r--r--examples/mainwindows/mainwindows.pro6
-rw-r--r--examples/mainwindows/mdi/main.cpp4
-rw-r--r--examples/mainwindows/mdi/mdi.desktop11
-rw-r--r--examples/mainwindows/mdi/mdi.pro4
-rw-r--r--examples/mainwindows/menus/main.cpp4
-rw-r--r--examples/mainwindows/menus/mainwindow.cpp6
-rw-r--r--examples/mainwindows/menus/menus.desktop11
-rw-r--r--examples/mainwindows/menus/menus.pro3
-rw-r--r--examples/mainwindows/recentfiles/main.cpp4
-rw-r--r--examples/mainwindows/recentfiles/recentfiles.desktop11
-rw-r--r--examples/mainwindows/recentfiles/recentfiles.pro3
-rw-r--r--examples/mainwindows/sdi/main.cpp4
-rw-r--r--examples/mainwindows/sdi/sdi.desktop11
-rw-r--r--examples/mainwindows/sdi/sdi.pro4
-rw-r--r--examples/multimedia/audiodevices/audiodevices.cpp4
-rw-r--r--examples/multimedia/audiodevices/audiodevices.desktop11
-rw-r--r--examples/multimedia/audiodevices/audiodevices.pro2
-rw-r--r--examples/multimedia/audioinput/audioinput.desktop11
-rw-r--r--examples/multimedia/audioinput/audioinput.pro3
-rw-r--r--examples/multimedia/audioinput/main.cpp4
-rw-r--r--examples/multimedia/audiooutput/audiooutput.desktop11
-rw-r--r--examples/multimedia/audiooutput/audiooutput.pro2
-rw-r--r--examples/multimedia/audiooutput/main.cpp4
-rw-r--r--examples/multimedia/videographicsitem/videographicsitem.desktop11
-rw-r--r--examples/multimedia/videographicsitem/videographicsitem.pro3
-rw-r--r--examples/multimedia/videowidget/videowidget.desktop11
-rw-r--r--examples/multimedia/videowidget/videowidget.pro3
-rw-r--r--examples/network/bearercloud/bearercloud.desktop11
-rw-r--r--examples/network/bearercloud/bearercloud.pro8
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp8
-rw-r--r--examples/network/bearermonitor/bearermonitor.desktop11
-rw-r--r--examples/network/bearermonitor/bearermonitor.h4
-rw-r--r--examples/network/bearermonitor/bearermonitor.pro9
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.cpp54
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.h10
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.desktop11
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.pro9
-rw-r--r--examples/network/blockingfortuneclient/main.cpp6
-rw-r--r--examples/network/broadcastreceiver/broadcastreceiver.desktop11
-rw-r--r--examples/network/broadcastreceiver/broadcastreceiver.pro6
-rw-r--r--examples/network/broadcastreceiver/main.cpp6
-rw-r--r--examples/network/broadcastreceiver/receiver.cpp18
-rw-r--r--examples/network/broadcastreceiver/receiver.h9
-rw-r--r--examples/network/broadcastsender/broadcastsender.desktop11
-rw-r--r--examples/network/broadcastsender/broadcastsender.pro7
-rw-r--r--examples/network/broadcastsender/main.cpp6
-rw-r--r--examples/network/broadcastsender/sender.cpp3
-rw-r--r--examples/network/broadcastsender/sender.h4
-rw-r--r--examples/network/download/download.desktop11
-rw-r--r--examples/network/download/download.pro5
-rw-r--r--examples/network/downloadmanager/downloadmanager.desktop11
-rw-r--r--examples/network/downloadmanager/downloadmanager.pro12
-rw-r--r--examples/network/fortuneclient/fortuneclient.desktop11
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro5
-rw-r--r--examples/network/fortuneserver/fortuneserver.desktop11
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro5
-rw-r--r--examples/network/googlesuggest/googlesuggest.desktop11
-rw-r--r--examples/network/googlesuggest/googlesuggest.pro7
-rw-r--r--examples/network/http/http.desktop11
-rw-r--r--examples/network/http/http.pro7
-rw-r--r--examples/network/http/httpwindow.cpp25
-rw-r--r--examples/network/http/httpwindow.h10
-rw-r--r--examples/network/http/main.cpp17
-rw-r--r--examples/network/loopback/dialog.cpp31
-rw-r--r--examples/network/loopback/dialog.h7
-rw-r--r--examples/network/loopback/loopback.desktop11
-rw-r--r--examples/network/loopback/loopback.pro7
-rw-r--r--examples/network/loopback/main.cpp6
-rw-r--r--examples/network/network-chat/network-chat.desktop11
-rw-r--r--examples/network/network-chat/network-chat.pro4
-rw-r--r--examples/network/network.pro1
-rw-r--r--examples/network/qftp/ftpwindow.cpp2
-rw-r--r--examples/network/qftp/qftp.desktop11
-rw-r--r--examples/network/qftp/qftp.pro4
-rw-r--r--examples/network/securesocketclient/certificateinfo.cpp4
-rw-r--r--examples/network/securesocketclient/certificateinfo.ui68
-rw-r--r--examples/network/securesocketclient/main.cpp4
-rw-r--r--examples/network/securesocketclient/securesocketclient.desktop11
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro3
-rw-r--r--examples/network/securesocketclient/sslclient.cpp7
-rw-r--r--examples/network/securesocketclient/sslclient.ui223
-rw-r--r--examples/network/securesocketclient/sslerrors.ui57
-rw-r--r--examples/network/threadedfortuneserver/dialog.cpp18
-rw-r--r--examples/network/threadedfortuneserver/dialog.h4
-rw-r--r--examples/network/threadedfortuneserver/main.cpp6
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.desktop11
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.pro9
-rw-r--r--examples/network/torrent/torrent.desktop11
-rw-r--r--examples/network/torrent/torrent.pro5
-rw-r--r--examples/opengl/2dpainting/2dpainting.desktop11
-rw-r--r--examples/opengl/2dpainting/2dpainting.pro4
-rw-r--r--examples/opengl/cube/cube.desktop11
-rw-r--r--examples/opengl/cube/cube.pngbin0 -> 30341 bytes
-rw-r--r--examples/opengl/cube/cube.pro40
-rw-r--r--examples/opengl/cube/fshader.glsl18
-rw-r--r--examples/opengl/cube/geometryengine.cpp170
-rw-r--r--examples/opengl/cube/geometryengine.h64
-rw-r--r--examples/opengl/cube/main.cpp62
-rw-r--r--examples/opengl/cube/mainwidget.cpp232
-rw-r--r--examples/opengl/cube/mainwidget.h93
-rw-r--r--examples/opengl/cube/shaders.qrc6
-rw-r--r--examples/opengl/cube/textures.qrc5
-rw-r--r--examples/opengl/cube/vshader.glsl24
-rw-r--r--examples/opengl/framebufferobject/framebufferobject.desktop11
-rw-r--r--examples/opengl/framebufferobject/framebufferobject.pro5
-rw-r--r--examples/opengl/framebufferobject2/framebufferobject2.desktop11
-rw-r--r--examples/opengl/framebufferobject2/framebufferobject2.pro5
-rw-r--r--examples/opengl/grabber/grabber.desktop11
-rw-r--r--examples/opengl/grabber/grabber.pro5
-rw-r--r--examples/opengl/hellogl/hellogl.desktop11
-rw-r--r--examples/opengl/hellogl/hellogl.pro5
-rw-r--r--examples/opengl/hellogl_es/hellogl_es.desktop11
-rw-r--r--examples/opengl/hellogl_es/hellogl_es.pro8
-rw-r--r--examples/opengl/hellogl_es2/hellogl_es2.desktop11
-rw-r--r--examples/opengl/hellogl_es2/hellogl_es2.pro13
-rw-r--r--examples/opengl/opengl.pro4
-rw-r--r--examples/opengl/overpainting/overpainting.desktop11
-rw-r--r--examples/opengl/overpainting/overpainting.pro5
-rw-r--r--examples/opengl/pbuffers/pbuffers.desktop11
-rw-r--r--examples/opengl/pbuffers/pbuffers.pro5
-rw-r--r--examples/opengl/pbuffers2/pbuffers2.desktop11
-rw-r--r--examples/opengl/pbuffers2/pbuffers2.pro6
-rw-r--r--examples/opengl/samplebuffers/samplebuffers.desktop11
-rw-r--r--examples/opengl/samplebuffers/samplebuffers.pro5
-rw-r--r--examples/opengl/textures/textures.desktop11
-rw-r--r--examples/opengl/textures/textures.pro4
-rw-r--r--examples/openvg/openvg.desktop11
-rw-r--r--examples/openvg/openvg.pro1
-rw-r--r--examples/painting/basicdrawing/basicdrawing.desktop11
-rw-r--r--examples/painting/basicdrawing/basicdrawing.pro3
-rw-r--r--examples/painting/basicdrawing/main.cpp4
-rw-r--r--examples/painting/basicdrawing/window.cpp43
-rw-r--r--examples/painting/concentriccircles/concentriccircles.desktop11
-rw-r--r--examples/painting/concentriccircles/concentriccircles.pro2
-rw-r--r--examples/painting/concentriccircles/main.cpp4
-rw-r--r--examples/painting/fontsampler/fontsampler.desktop11
-rw-r--r--examples/painting/fontsampler/fontsampler.pro2
-rw-r--r--examples/painting/fontsampler/main.cpp4
-rw-r--r--examples/painting/fontsampler/mainwindow.cpp56
-rw-r--r--examples/painting/fontsampler/mainwindow.h4
-rw-r--r--examples/painting/fontsampler/mainwindowbase.ui126
-rw-r--r--examples/painting/imagecomposition/imagecomposer.cpp10
-rw-r--r--examples/painting/imagecomposition/imagecomposition.desktop11
-rw-r--r--examples/painting/imagecomposition/imagecomposition.pro2
-rw-r--r--examples/painting/imagecomposition/main.cpp4
-rw-r--r--examples/painting/painterpaths/main.cpp4
-rw-r--r--examples/painting/painterpaths/painterpaths.desktop11
-rw-r--r--examples/painting/painterpaths/painterpaths.pro2
-rw-r--r--examples/painting/painterpaths/window.cpp53
-rw-r--r--examples/painting/painterpaths/window.h4
-rw-r--r--examples/painting/painting.pro6
-rw-r--r--examples/painting/svggenerator/main.cpp4
-rw-r--r--examples/painting/svggenerator/svggenerator.desktop11
-rw-r--r--examples/painting/svggenerator/svggenerator.pro2
-rw-r--r--examples/painting/svggenerator/window.cpp4
-rw-r--r--examples/painting/svgviewer/main.cpp4
-rw-r--r--examples/painting/svgviewer/svgviewer.desktop11
-rw-r--r--examples/painting/svgviewer/svgviewer.pro2
-rw-r--r--examples/painting/transformations/main.cpp4
-rw-r--r--examples/painting/transformations/transformations.desktop11
-rw-r--r--examples/painting/transformations/transformations.pro5
-rw-r--r--examples/phonon/capabilities/capabilities.desktop11
-rw-r--r--examples/phonon/capabilities/capabilities.pro11
-rw-r--r--examples/phonon/capabilities/main.cpp4
-rw-r--r--examples/phonon/capabilities/window.cpp52
-rw-r--r--examples/phonon/capabilities/window.h1
-rw-r--r--examples/phonon/phonon.pro1
-rw-r--r--examples/phonon/qmusicplayer/main.cpp4
-rw-r--r--examples/phonon/qmusicplayer/qmusicplayer.desktop11
-rw-r--r--examples/phonon/qmusicplayer/qmusicplayer.pro11
-rw-r--r--examples/qt.pngbin0 -> 3142 bytes
-rw-r--r--examples/qt.svg93
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.desktop11
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.pro3
-rw-r--r--examples/qtconcurrent/imagescaling/main.cpp21
-rw-r--r--examples/qtconcurrent/map/main.cpp19
-rw-r--r--examples/qtconcurrent/map/map.desktop11
-rw-r--r--examples/qtconcurrent/map/map.pro3
-rw-r--r--examples/qtconcurrent/progressdialog/main.cpp17
-rw-r--r--examples/qtconcurrent/progressdialog/progressdialog.desktop11
-rw-r--r--examples/qtconcurrent/progressdialog/progressdialog.pro4
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro1
-rw-r--r--examples/qtconcurrent/runfunction/main.cpp19
-rw-r--r--examples/qtconcurrent/runfunction/runfunction.desktop11
-rw-r--r--examples/qtconcurrent/runfunction/runfunction.pro4
-rw-r--r--examples/qtconcurrent/wordcount/main.cpp23
-rw-r--r--examples/qtconcurrent/wordcount/wordcount.desktop11
-rw-r--r--examples/qtconcurrent/wordcount/wordcount.pro4
-rw-r--r--examples/qtestlib/qtestlib.pro1
-rw-r--r--examples/qtestlib/tutorial1/tutorial1.desktop11
-rw-r--r--examples/qtestlib/tutorial1/tutorial1.pro5
-rw-r--r--examples/qtestlib/tutorial2/tutorial2.desktop11
-rw-r--r--examples/qtestlib/tutorial2/tutorial2.pro5
-rw-r--r--examples/qtestlib/tutorial3/tutorial3.desktop11
-rw-r--r--examples/qtestlib/tutorial3/tutorial3.pro5
-rw-r--r--examples/qtestlib/tutorial4/tutorial4.desktop11
-rw-r--r--examples/qtestlib/tutorial4/tutorial4.pro5
-rw-r--r--examples/qtestlib/tutorial5/tutorial5.desktop11
-rw-r--r--examples/qtestlib/tutorial5/tutorial5.pro5
-rw-r--r--examples/qws/dbscreen/dbscreen.desktop11
-rw-r--r--examples/qws/dbscreen/dbscreen.pro4
-rw-r--r--examples/qws/framebuffer/framebuffer.desktop11
-rw-r--r--examples/qws/framebuffer/framebuffer.pro6
-rw-r--r--examples/qws/mousecalibration/mousecalibration.desktop11
-rw-r--r--examples/qws/mousecalibration/mousecalibration.pro7
-rw-r--r--examples/qws/simpledecoration/simpledecoration.desktop11
-rw-r--r--examples/qws/simpledecoration/simpledecoration.pro7
-rw-r--r--examples/qws/svgalib/svgalib.desktop11
-rw-r--r--examples/qws/svgalib/svgalib.pro6
-rw-r--r--examples/richtext/calendar/calendar.desktop11
-rw-r--r--examples/richtext/calendar/calendar.pro5
-rw-r--r--examples/richtext/calendar/main.cpp6
-rw-r--r--examples/richtext/calendar/mainwindow.cpp7
-rw-r--r--examples/richtext/orderform/detailsdialog.cpp30
-rw-r--r--examples/richtext/orderform/main.cpp6
-rw-r--r--examples/richtext/orderform/orderform.desktop11
-rw-r--r--examples/richtext/orderform/orderform.pro2
-rw-r--r--examples/richtext/richtext.pro1
-rw-r--r--examples/richtext/syntaxhighlighter/main.cpp6
-rw-r--r--examples/richtext/syntaxhighlighter/syntaxhighlighter.desktop11
-rw-r--r--examples/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/richtext/textobject/main.cpp6
-rw-r--r--examples/richtext/textobject/resources.qrc5
-rw-r--r--examples/richtext/textobject/textobject.desktop11
-rw-r--r--examples/richtext/textobject/textobject.pro5
-rw-r--r--examples/richtext/textobject/window.cpp2
-rw-r--r--examples/script/calculator/calculator.desktop11
-rw-r--r--examples/script/calculator/calculator.pro3
-rw-r--r--examples/script/calculator/calculator.ui770
-rw-r--r--examples/script/context2d/context2d.desktop11
-rw-r--r--examples/script/context2d/context2d.pro2
-rw-r--r--examples/script/context2d/main.cpp5
-rw-r--r--examples/script/context2d/qcontext2dcanvas.cpp4
-rw-r--r--examples/script/customclass/customclass.desktop11
-rw-r--r--examples/script/customclass/customclass.pro3
-rw-r--r--examples/script/defaultprototypes/code.js2
-rw-r--r--examples/script/defaultprototypes/defaultprototypes.desktop11
-rw-r--r--examples/script/defaultprototypes/defaultprototypes.pro2
-rw-r--r--examples/script/defaultprototypes/main.cpp5
-rw-r--r--examples/script/defaultprototypes/prototypes.cpp7
-rw-r--r--examples/script/helloscript/helloscript.desktop11
-rw-r--r--examples/script/helloscript/helloscript.pro2
-rw-r--r--examples/script/helloscript/main.cpp4
-rw-r--r--examples/script/marshal/marshal.desktop11
-rw-r--r--examples/script/marshal/marshal.pro3
-rw-r--r--examples/script/qscript/qscript.desktop11
-rw-r--r--examples/script/qscript/qscript.pro3
-rw-r--r--examples/script/qsdbg/qsdbg.desktop11
-rw-r--r--examples/script/qsdbg/qsdbg.pro4
-rw-r--r--examples/script/qstetrix/qstetrix.desktop11
-rw-r--r--examples/script/qstetrix/qstetrix.pro5
-rw-r--r--examples/script/script.pro1
-rw-r--r--examples/sql/cachedtable/cachedtable.desktop11
-rw-r--r--examples/sql/cachedtable/cachedtable.pro2
-rw-r--r--examples/sql/cachedtable/main.cpp6
-rw-r--r--examples/sql/cachedtable/tableeditor.cpp3
-rw-r--r--examples/sql/cachedtable/tableeditor.h2
-rw-r--r--examples/sql/drilldown/drilldown.desktop11
-rw-r--r--examples/sql/drilldown/drilldown.pro3
-rw-r--r--examples/sql/drilldown/informationwindow.cpp6
-rw-r--r--examples/sql/drilldown/main.cpp2
-rw-r--r--examples/sql/drilldown/view.cpp2
-rw-r--r--examples/sql/masterdetail/main.cpp4
-rw-r--r--examples/sql/masterdetail/mainwindow.cpp4
-rw-r--r--examples/sql/masterdetail/masterdetail.desktop11
-rw-r--r--examples/sql/masterdetail/masterdetail.pro5
-rw-r--r--examples/sql/querymodel/main.cpp27
-rw-r--r--examples/sql/querymodel/querymodel.desktop11
-rw-r--r--examples/sql/querymodel/querymodel.pro2
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.cpp4
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.desktop11
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.pro2
-rw-r--r--examples/sql/sql.pro1
-rw-r--r--examples/sql/sqlwidgetmapper/main.cpp4
-rw-r--r--examples/sql/sqlwidgetmapper/sqlwidgetmapper.desktop11
-rw-r--r--examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro3
-rw-r--r--examples/sql/tablemodel/tablemodel.cpp18
-rw-r--r--examples/sql/tablemodel/tablemodel.desktop11
-rw-r--r--examples/sql/tablemodel/tablemodel.pro2
-rw-r--r--examples/statemachine/eventtransitions/eventtransitions.desktop11
-rw-r--r--examples/statemachine/eventtransitions/eventtransitions.pro5
-rw-r--r--examples/statemachine/eventtransitions/main.cpp11
-rw-r--r--examples/statemachine/factorial/factorial.desktop11
-rw-r--r--examples/statemachine/factorial/factorial.pro5
-rw-r--r--examples/statemachine/pingpong/pingpong.desktop11
-rw-r--r--examples/statemachine/pingpong/pingpong.pro5
-rw-r--r--examples/statemachine/rogue/main.cpp4
-rw-r--r--examples/statemachine/rogue/movementtransition.h7
-rw-r--r--examples/statemachine/rogue/rogue.desktop11
-rw-r--r--examples/statemachine/rogue/rogue.pro3
-rw-r--r--examples/statemachine/rogue/window.cpp12
-rw-r--r--examples/statemachine/rogue/window.h5
-rw-r--r--examples/statemachine/trafficlight/main.cpp9
-rw-r--r--examples/statemachine/trafficlight/trafficlight.desktop11
-rw-r--r--examples/statemachine/trafficlight/trafficlight.pro4
-rw-r--r--examples/statemachine/twowaybutton/main.cpp6
-rw-r--r--examples/statemachine/twowaybutton/twowaybutton.desktop11
-rw-r--r--examples/statemachine/twowaybutton/twowaybutton.pro4
-rw-r--r--examples/symbianpkgrules.pri1
-rw-r--r--examples/threads/mandelbrot/main.cpp4
-rw-r--r--examples/threads/mandelbrot/mandelbrot.desktop11
-rw-r--r--examples/threads/mandelbrot/mandelbrot.pro2
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.cpp18
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.h30
-rw-r--r--examples/threads/queuedcustomtype/main.cpp4
-rw-r--r--examples/threads/queuedcustomtype/queuedcustomtype.desktop11
-rw-r--r--examples/threads/queuedcustomtype/queuedcustomtype.pro10
-rw-r--r--examples/threads/semaphores/semaphores.cpp81
-rw-r--r--examples/threads/semaphores/semaphores.desktop11
-rw-r--r--examples/threads/semaphores/semaphores.pro6
-rw-r--r--examples/threads/threads.pro1
-rw-r--r--examples/threads/waitconditions/waitconditions.cpp132
-rw-r--r--examples/threads/waitconditions/waitconditions.desktop11
-rw-r--r--examples/threads/waitconditions/waitconditions.pro5
-rw-r--r--examples/tools/codecs/codecs.desktop11
-rw-r--r--examples/tools/codecs/codecs.pro5
-rw-r--r--examples/tools/completer/completer.desktop11
-rw-r--r--examples/tools/completer/completer.pro5
-rw-r--r--examples/tools/contiguouscache/contiguouscache.desktop11
-rw-r--r--examples/tools/contiguouscache/contiguouscache.pro7
-rw-r--r--examples/tools/customcompleter/customcompleter.desktop11
-rw-r--r--examples/tools/customcompleter/customcompleter.pro5
-rw-r--r--examples/tools/customtype/customtype.desktop11
-rw-r--r--examples/tools/customtype/customtype.pro13
-rw-r--r--examples/tools/customtypesending/customtypesending.desktop11
-rw-r--r--examples/tools/customtypesending/customtypesending.pro13
-rw-r--r--examples/tools/echoplugin/echoplugin.pro1
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.desktop11
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.pro5
-rw-r--r--examples/tools/echoplugin/plugin/plugin.desktop11
-rw-r--r--examples/tools/echoplugin/plugin/plugin.pro10
-rw-r--r--examples/tools/i18n/i18n.desktop11
-rw-r--r--examples/tools/i18n/i18n.pro5
-rw-r--r--examples/tools/inputpanel/inputpanel.desktop11
-rw-r--r--examples/tools/inputpanel/inputpanel.pro5
-rw-r--r--examples/tools/plugandpaint/plugandpaint.desktop11
-rw-r--r--examples/tools/plugandpaint/plugandpaint.pro5
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictools.pro1
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro1
-rw-r--r--examples/tools/plugandpaintplugins/plugandpaintplugins.pro2
-rw-r--r--examples/tools/regexp/regexp.desktop11
-rw-r--r--examples/tools/regexp/regexp.pro5
-rw-r--r--examples/tools/settingseditor/settingseditor.desktop11
-rw-r--r--examples/tools/settingseditor/settingseditor.pro5
-rw-r--r--examples/tools/styleplugin/plugin/plugin.pro1
-rw-r--r--examples/tools/styleplugin/styleplugin.pro2
-rw-r--r--examples/tools/styleplugin/stylewindow/stylewindow.pro1
-rw-r--r--examples/tools/tools.pro1
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.desktop11
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.pro5
-rw-r--r--examples/tools/undoframework/undoframework.desktop11
-rw-r--r--examples/tools/undoframework/undoframework.pro5
-rw-r--r--examples/touch/dials/dials.desktop11
-rw-r--r--examples/touch/dials/dials.pro7
-rw-r--r--examples/touch/fingerpaint/fingerpaint.desktop11
-rw-r--r--examples/touch/fingerpaint/fingerpaint.pro7
-rw-r--r--examples/touch/knobs/knobs.desktop11
-rw-r--r--examples/touch/knobs/knobs.pro7
-rw-r--r--examples/touch/pinchzoom/pinchzoom.desktop11
-rw-r--r--examples/touch/pinchzoom/pinchzoom.pro7
-rw-r--r--examples/tutorials/addressbook-fr/addressbook-fr.pro1
-rw-r--r--examples/tutorials/addressbook-fr/part1/part1.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part1/part1.pro7
-rw-r--r--examples/tutorials/addressbook-fr/part2/part2.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part2/part2.pro7
-rw-r--r--examples/tutorials/addressbook-fr/part3/part3.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part3/part3.pro7
-rw-r--r--examples/tutorials/addressbook-fr/part4/part4.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part4/part4.pro7
-rw-r--r--examples/tutorials/addressbook-fr/part5/part5.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part5/part5.pro7
-rw-r--r--examples/tutorials/addressbook-fr/part6/part6.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part6/part6.pro7
-rw-r--r--examples/tutorials/addressbook-fr/part7/part7.desktop11
-rw-r--r--examples/tutorials/addressbook-fr/part7/part7.pro7
-rw-r--r--examples/tutorials/addressbook/addressbook.pro1
-rw-r--r--examples/tutorials/addressbook/part1/part1.desktop11
-rw-r--r--examples/tutorials/addressbook/part1/part1.pro5
-rw-r--r--examples/tutorials/addressbook/part2/part2.desktop11
-rw-r--r--examples/tutorials/addressbook/part2/part2.pro5
-rw-r--r--examples/tutorials/addressbook/part3/part3.desktop11
-rw-r--r--examples/tutorials/addressbook/part3/part3.pro5
-rw-r--r--examples/tutorials/addressbook/part4/part4.desktop11
-rw-r--r--examples/tutorials/addressbook/part4/part4.pro5
-rw-r--r--examples/tutorials/addressbook/part5/part5.desktop11
-rw-r--r--examples/tutorials/addressbook/part5/part5.pro5
-rw-r--r--examples/tutorials/addressbook/part6/part6.desktop11
-rw-r--r--examples/tutorials/addressbook/part6/part6.pro5
-rw-r--r--examples/tutorials/addressbook/part7/part7.desktop11
-rw-r--r--examples/tutorials/addressbook/part7/part7.pro5
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h2
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part1/part1.pro8
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part2/part2.pro9
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part3/part3.pro9
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part4/part4.pro9
-rwxr-xr-xexamples/tutorials/gettingStarted/gsQt/part5/part5.pro9
-rw-r--r--examples/tutorials/modelview/1_readonly/1_readonly.desktop11
-rwxr-xr-xexamples/tutorials/modelview/1_readonly/1_readonly.pro5
-rw-r--r--examples/tutorials/modelview/2_formatting/2_formatting.desktop11
-rwxr-xr-xexamples/tutorials/modelview/2_formatting/2_formatting.pro5
-rw-r--r--examples/tutorials/modelview/3_changingmodel/3_changingmodel.desktop11
-rwxr-xr-xexamples/tutorials/modelview/3_changingmodel/3_changingmodel.pro5
-rw-r--r--examples/tutorials/modelview/4_headers/4_headers.desktop11
-rwxr-xr-xexamples/tutorials/modelview/4_headers/4_headers.pro5
-rw-r--r--examples/tutorials/modelview/5_edit/5_edit.desktop11
-rwxr-xr-xexamples/tutorials/modelview/5_edit/5_edit.pro5
-rw-r--r--examples/tutorials/modelview/6_treeview/6_treeview.desktop11
-rwxr-xr-xexamples/tutorials/modelview/6_treeview/6_treeview.pro5
-rw-r--r--examples/tutorials/modelview/7_selections/7_selections.desktop11
-rwxr-xr-xexamples/tutorials/modelview/7_selections/7_selections.pro5
-rwxr-xr-xexamples/tutorials/modelview/modelview.pro1
-rw-r--r--examples/tutorials/tutorials.pro1
-rw-r--r--examples/tutorials/widgets/childwidget/childwidget.desktop11
-rw-r--r--examples/tutorials/widgets/childwidget/childwidget.pro7
-rw-r--r--examples/tutorials/widgets/nestedlayouts/nestedlayouts.desktop11
-rw-r--r--examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro7
-rw-r--r--examples/tutorials/widgets/toplevel/toplevel.desktop11
-rw-r--r--examples/tutorials/widgets/toplevel/toplevel.pro7
-rw-r--r--examples/tutorials/widgets/windowlayout/windowlayout.desktop11
-rw-r--r--examples/tutorials/widgets/windowlayout/windowlayout.pro7
-rw-r--r--examples/uitools/multipleinheritance/main.cpp4
-rw-r--r--examples/uitools/multipleinheritance/multipleinheritance.desktop11
-rw-r--r--examples/uitools/multipleinheritance/multipleinheritance.pro2
-rw-r--r--examples/uitools/textfinder/textfinder.desktop11
-rw-r--r--examples/uitools/textfinder/textfinder.pro4
-rw-r--r--examples/uitools/uitools.pro1
-rw-r--r--examples/webkit/domtraversal/domtraversal.desktop11
-rw-r--r--examples/webkit/domtraversal/domtraversal.pro8
-rw-r--r--examples/webkit/domtraversal/main.cpp6
-rw-r--r--examples/webkit/domtraversal/window.h6
-rw-r--r--examples/webkit/domtraversal/window_mobiles.ui90
-rw-r--r--examples/webkit/fancybrowser/fancybrowser.desktop11
-rw-r--r--examples/webkit/fancybrowser/fancybrowser.pro4
-rw-r--r--examples/webkit/fancybrowser/main.cpp6
-rw-r--r--examples/webkit/formextractor/formextractor.cpp5
-rw-r--r--examples/webkit/formextractor/formextractor.desktop11
-rw-r--r--examples/webkit/formextractor/formextractor.h6
-rw-r--r--examples/webkit/formextractor/formextractor.pro5
-rw-r--r--examples/webkit/formextractor/formextractor_mobiles.ui139
-rw-r--r--examples/webkit/framecapture/framecapture.desktop11
-rw-r--r--examples/webkit/framecapture/framecapture.pro10
-rw-r--r--examples/webkit/googlechat/googlechat.desktop11
-rw-r--r--examples/webkit/googlechat/googlechat.pro6
-rw-r--r--examples/webkit/previewer/main.cpp6
-rw-r--r--examples/webkit/previewer/previewer.cpp5
-rw-r--r--examples/webkit/previewer/previewer.desktop11
-rw-r--r--examples/webkit/previewer/previewer.h6
-rw-r--r--examples/webkit/previewer/previewer.pro5
-rw-r--r--examples/webkit/previewer/previewer_mobiles.ui96
-rw-r--r--examples/webkit/simpleselector/main.cpp6
-rw-r--r--examples/webkit/simpleselector/simpleselector.desktop11
-rw-r--r--examples/webkit/simpleselector/simpleselector.pro3
-rw-r--r--examples/webkit/simplewebplugin/csvfactory.cpp91
-rw-r--r--examples/webkit/simplewebplugin/csvfactory.h67
-rw-r--r--examples/webkit/simplewebplugin/csvview.cpp176
-rw-r--r--examples/webkit/simplewebplugin/csvview.h71
-rw-r--r--examples/webkit/simplewebplugin/data/accounts.csv11
-rw-r--r--examples/webkit/simplewebplugin/main.cpp52
-rw-r--r--examples/webkit/simplewebplugin/mainwindow.cpp63
-rw-r--r--examples/webkit/simplewebplugin/mainwindow.h54
-rw-r--r--examples/webkit/simplewebplugin/pages/index.html27
-rw-r--r--examples/webkit/simplewebplugin/simplewebplugin.pro23
-rw-r--r--examples/webkit/simplewebplugin/simplewebplugin.qrc6
-rw-r--r--examples/webkit/webftpclient/downloader.cpp96
-rw-r--r--examples/webkit/webftpclient/downloader.h75
-rw-r--r--examples/webkit/webftpclient/ftpreply.cpp237
-rw-r--r--examples/webkit/webftpclient/ftpreply.h81
-rw-r--r--examples/webkit/webftpclient/ftpview.cpp68
-rw-r--r--examples/webkit/webftpclient/ftpview.h58
-rw-r--r--examples/webkit/webftpclient/main.cpp57
-rw-r--r--examples/webkit/webftpclient/networkaccessmanager.cpp71
-rw-r--r--examples/webkit/webftpclient/networkaccessmanager.h57
-rw-r--r--examples/webkit/webftpclient/webftpclient.pro22
-rw-r--r--examples/webkit/webkit.pro4
-rw-r--r--examples/webkit/webplugin/csvfactory.cpp98
-rw-r--r--examples/webkit/webplugin/csvfactory.h67
-rw-r--r--examples/webkit/webplugin/csvview.cpp190
-rw-r--r--examples/webkit/webplugin/csvview.h79
-rw-r--r--examples/webkit/webplugin/data/accounts.csv11
-rw-r--r--examples/webkit/webplugin/main.cpp50
-rw-r--r--examples/webkit/webplugin/mainwindow.cpp59
-rw-r--r--examples/webkit/webplugin/mainwindow.h54
-rw-r--r--examples/webkit/webplugin/pages/index.html64
-rw-r--r--examples/webkit/webplugin/webplugin.pro23
-rw-r--r--examples/webkit/webplugin/webplugin.qrc6
-rw-r--r--examples/widgets/analogclock/analogclock.desktop11
-rw-r--r--examples/widgets/analogclock/analogclock.pro2
-rw-r--r--examples/widgets/analogclock/main.cpp4
-rw-r--r--examples/widgets/applicationicon/applicationicon.desktop11
-rw-r--r--examples/widgets/applicationicon/applicationicon.pngbin0 -> 4023 bytes
-rw-r--r--examples/widgets/applicationicon/applicationicon.pro30
-rw-r--r--examples/widgets/applicationicon/applicationicon.svg22
-rw-r--r--examples/widgets/applicationicon/main.cpp54
-rw-r--r--examples/widgets/calculator/calculator.cpp7
-rw-r--r--examples/widgets/calculator/calculator.desktop11
-rw-r--r--examples/widgets/calculator/calculator.h4
-rw-r--r--examples/widgets/calculator/calculator.pro2
-rw-r--r--examples/widgets/calculator/main.cpp4
-rw-r--r--examples/widgets/calculator/releasenotes.txt4
-rw-r--r--examples/widgets/calendarwidget/calendarwidget.desktop11
-rw-r--r--examples/widgets/calendarwidget/calendarwidget.pro5
-rw-r--r--examples/widgets/charactermap/charactermap.desktop11
-rw-r--r--examples/widgets/charactermap/charactermap.pro5
-rw-r--r--examples/widgets/codeeditor/codeeditor.desktop11
-rw-r--r--examples/widgets/codeeditor/codeeditor.pro5
-rw-r--r--examples/widgets/codeeditor/main.cpp4
-rw-r--r--examples/widgets/digitalclock/digitalclock.desktop11
-rw-r--r--examples/widgets/digitalclock/digitalclock.pro2
-rw-r--r--examples/widgets/digitalclock/main.cpp4
-rw-r--r--examples/widgets/elidedlabel/elidedlabel.cpp111
-rw-r--r--examples/widgets/elidedlabel/elidedlabel.desktop11
-rw-r--r--examples/widgets/elidedlabel/elidedlabel.h76
-rw-r--r--examples/widgets/elidedlabel/elidedlabel.pro31
-rw-r--r--examples/widgets/elidedlabel/main.cpp53
-rw-r--r--examples/widgets/elidedlabel/testwidget.cpp164
-rw-r--r--examples/widgets/elidedlabel/testwidget.h76
-rw-r--r--examples/widgets/groupbox/groupbox.desktop11
-rw-r--r--examples/widgets/groupbox/groupbox.pro5
-rw-r--r--examples/widgets/groupbox/main.cpp4
-rw-r--r--examples/widgets/icons/icons.desktop11
-rw-r--r--examples/widgets/icons/icons.pro5
-rw-r--r--examples/widgets/icons/main.cpp4
-rw-r--r--examples/widgets/imageviewer/imageviewer.desktop11
-rw-r--r--examples/widgets/imageviewer/imageviewer.pro8
-rw-r--r--examples/widgets/imageviewer/main.cpp4
-rw-r--r--examples/widgets/lineedits/lineedits.desktop11
-rw-r--r--examples/widgets/lineedits/lineedits.pro5
-rw-r--r--examples/widgets/lineedits/main.cpp4
-rw-r--r--examples/widgets/maemovibration/buttonwidget.cpp66
-rw-r--r--examples/widgets/maemovibration/buttonwidget.h64
-rw-r--r--examples/widgets/maemovibration/data/48x48/maemovibration.pngbin0 -> 2406 bytes
-rw-r--r--examples/widgets/maemovibration/data/64x64/maemovibration.pngbin0 -> 2989 bytes
-rw-r--r--examples/widgets/maemovibration/data/maemovibration.desktop12
-rw-r--r--examples/widgets/maemovibration/data/maemovibration.service3
-rw-r--r--examples/widgets/maemovibration/maemovibration.pro52
-rw-r--r--examples/widgets/maemovibration/main.cpp84
-rw-r--r--examples/widgets/maemovibration/mcevibrator.cpp119
-rw-r--r--examples/widgets/maemovibration/mcevibrator.h71
-rw-r--r--examples/widgets/movie/main.cpp5
-rw-r--r--examples/widgets/movie/movie.desktop11
-rw-r--r--examples/widgets/movie/movie.pro5
-rw-r--r--examples/widgets/orientation/image_a.pngbin0 -> 1075 bytes
-rw-r--r--examples/widgets/orientation/image_b.pngbin0 -> 1020 bytes
-rw-r--r--examples/widgets/orientation/image_c.pngbin0 -> 1163 bytes
-rw-r--r--examples/widgets/orientation/images.qrc7
-rw-r--r--examples/widgets/orientation/landscape.ui114
-rw-r--r--examples/widgets/orientation/main.cpp55
-rw-r--r--examples/widgets/orientation/mainwindow.cpp115
-rw-r--r--examples/widgets/orientation/mainwindow.h73
-rw-r--r--examples/widgets/orientation/orientation.desktop11
-rw-r--r--examples/widgets/orientation/orientation.pro30
-rw-r--r--examples/widgets/orientation/portrait.ui61
-rw-r--r--examples/widgets/scribble/main.cpp4
-rw-r--r--examples/widgets/scribble/scribble.desktop11
-rw-r--r--examples/widgets/scribble/scribble.pro2
-rw-r--r--examples/widgets/shapedclock/main.cpp4
-rw-r--r--examples/widgets/shapedclock/shapedclock.desktop11
-rw-r--r--examples/widgets/shapedclock/shapedclock.pro4
-rw-r--r--examples/widgets/sliders/main.cpp4
-rw-r--r--examples/widgets/sliders/sliders.desktop11
-rw-r--r--examples/widgets/sliders/sliders.pro5
-rw-r--r--examples/widgets/softkeys/softkeys.desktop11
-rw-r--r--examples/widgets/softkeys/softkeys.pro2
-rw-r--r--examples/widgets/spinboxes/main.cpp4
-rw-r--r--examples/widgets/spinboxes/spinboxes.desktop11
-rw-r--r--examples/widgets/spinboxes/spinboxes.pro5
-rw-r--r--examples/widgets/styles/styles.desktop11
-rw-r--r--examples/widgets/styles/styles.pro5
-rw-r--r--examples/widgets/stylesheet/main.cpp4
-rw-r--r--examples/widgets/stylesheet/stylesheet.desktop11
-rw-r--r--examples/widgets/stylesheet/stylesheet.pro5
-rw-r--r--examples/widgets/symbianvibration/main.cpp54
-rw-r--r--examples/widgets/symbianvibration/mainwindow.cpp63
-rw-r--r--examples/widgets/symbianvibration/mainwindow.h63
-rw-r--r--examples/widgets/symbianvibration/symbianvibration.pro39
-rw-r--r--examples/widgets/symbianvibration/vibrationsurface.cpp157
-rw-r--r--examples/widgets/symbianvibration/vibrationsurface.h71
-rw-r--r--examples/widgets/symbianvibration/xqvibra.cpp210
-rw-r--r--examples/widgets/symbianvibration/xqvibra.h101
-rw-r--r--examples/widgets/symbianvibration/xqvibra_p.cpp171
-rw-r--r--examples/widgets/symbianvibration/xqvibra_p.h79
-rw-r--r--examples/widgets/tablet/main.cpp7
-rw-r--r--examples/widgets/tablet/tablet.desktop11
-rw-r--r--examples/widgets/tablet/tablet.pro5
-rw-r--r--examples/widgets/tetrix/main.cpp4
-rw-r--r--examples/widgets/tetrix/tetrix.desktop11
-rw-r--r--examples/widgets/tetrix/tetrix.pro2
-rw-r--r--examples/widgets/tooltips/main.cpp4
-rw-r--r--examples/widgets/tooltips/tooltips.desktop11
-rw-r--r--examples/widgets/tooltips/tooltips.pro2
-rw-r--r--examples/widgets/validators/main.cpp4
-rw-r--r--examples/widgets/validators/validators.desktop11
-rw-r--r--examples/widgets/validators/validators.pro5
-rw-r--r--examples/widgets/widgets.pro9
-rw-r--r--examples/widgets/wiggly/main.cpp8
-rw-r--r--examples/widgets/wiggly/wiggly.desktop11
-rw-r--r--examples/widgets/wiggly/wiggly.pro2
-rw-r--r--examples/widgets/windowflags/main.cpp4
-rw-r--r--examples/widgets/windowflags/windowflags.desktop11
-rw-r--r--examples/widgets/windowflags/windowflags.pro5
-rw-r--r--examples/xml/dombookmarks/dombookmarks.desktop11
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro15
-rw-r--r--examples/xml/dombookmarks/main.cpp5
-rw-r--r--examples/xml/dombookmarks/mainwindow.cpp18
-rw-r--r--examples/xml/htmlinfo/htmlinfo.desktop11
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro11
-rw-r--r--examples/xml/htmlinfo/main.cpp5
-rw-r--r--examples/xml/htmlinfo/resources.qrc11
-rw-r--r--examples/xml/rsslisting/main.cpp4
-rw-r--r--examples/xml/rsslisting/rsslisting.cpp20
-rw-r--r--examples/xml/rsslisting/rsslisting.desktop11
-rw-r--r--examples/xml/rsslisting/rsslisting.h15
-rw-r--r--examples/xml/rsslisting/rsslisting.pro13
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.desktop11
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro2
-rw-r--r--examples/xml/streambookmarks/main.cpp3
-rw-r--r--examples/xml/streambookmarks/mainwindow.cpp18
-rw-r--r--examples/xml/streambookmarks/streambookmarks.desktop11
-rw-r--r--examples/xml/streambookmarks/streambookmarks.pro9
-rw-r--r--examples/xml/xml.pro1
-rw-r--r--examples/xml/xmlstreamlint/xmlstreamlint.desktop11
-rw-r--r--examples/xml/xmlstreamlint/xmlstreamlint.pro4
-rw-r--r--examples/xmlpatterns/filetree/filetree.desktop11
-rw-r--r--examples/xmlpatterns/filetree/filetree.pro5
-rw-r--r--examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.desktop11
-rw-r--r--examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.pro5
-rw-r--r--examples/xmlpatterns/recipes/forms/querywidget_mobiles.ui87
-rw-r--r--examples/xmlpatterns/recipes/main.cpp4
-rw-r--r--examples/xmlpatterns/recipes/querymainwindow.h6
-rw-r--r--examples/xmlpatterns/recipes/recipes.desktop11
-rw-r--r--examples/xmlpatterns/recipes/recipes.pro5
-rw-r--r--examples/xmlpatterns/schema/main.cpp4
-rw-r--r--examples/xmlpatterns/schema/mainwindow.h6
-rw-r--r--examples/xmlpatterns/schema/schema.desktop11
-rw-r--r--examples/xmlpatterns/schema/schema.pro4
-rw-r--r--examples/xmlpatterns/schema/schema_mobiles.ui130
-rw-r--r--examples/xmlpatterns/trafficinfo/trafficinfo.desktop11
-rw-r--r--examples/xmlpatterns/trafficinfo/trafficinfo.pro5
-rw-r--r--examples/xmlpatterns/xmlpatterns.pro1
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/globalVariables.desktop11
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/globalVariables.pro1
-rw-r--r--examples/xmlpatterns/xquery/xquery.pro2
-rw-r--r--mkspecs/features/symbian/application_icon.prf4
-rw-r--r--mkspecs/features/symbian/qt_config.prf2
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/symbian/symbiancommon.h1
-rw-r--r--qmake/generators/unix/unixmake2.cpp4
-rw-r--r--src/3rdparty/phonon/ds9/mediagraph.cpp30
-rw-r--r--src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h110
-rw-r--r--src/3rdparty/wayland/wayland-windowmanager-protocol.c37
-rw-r--r--src/corelib/corelib.pro1
-rw-r--r--src/corelib/global/qglobal.cpp8
-rw-r--r--src/corelib/global/qglobal.h1
-rw-r--r--src/corelib/io/qdatastream.cpp3
-rw-r--r--src/corelib/io/qfile.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp11
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp24
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian.cpp4
-rw-r--r--src/corelib/io/qfsfileengine.cpp2
-rw-r--r--src/corelib/io/qtldurl.cpp34
-rw-r--r--src/corelib/io/qtldurl_p.h34
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp74
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h13
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp7
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp391
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h40
-rw-r--r--src/corelib/kernel/qobject.cpp56
-rw-r--r--src/corelib/kernel/qobject.h5
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp26
-rw-r--r--src/corelib/kernel/qsharedmemory_p.h12
-rw-r--r--src/corelib/kernel/qsharedmemory_symbian.cpp50
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp44
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp63
-rw-r--r--src/corelib/kernel/qsystemsemaphore_p.h8
-rw-r--r--src/corelib/kernel/qsystemsemaphore_symbian.cpp49
-rw-r--r--src/corelib/kernel/qsystemsemaphore_unix.cpp52
-rw-r--r--src/corelib/kernel/qsystemsemaphore_win.cpp17
-rw-r--r--src/corelib/kernel/qtimer.cpp9
-rw-r--r--src/corelib/kernel/qtranslator.cpp8
-rw-r--r--src/corelib/thread/qmutexpool.cpp3
-rw-r--r--src/corelib/thread/qthread_symbian.cpp10
-rw-r--r--src/corelib/tools/qdatetime.cpp60
-rw-r--r--src/corelib/tools/qlist.cpp4
-rw-r--r--src/corelib/tools/qlocale.cpp6
-rw-r--r--src/corelib/tools/qlocale.qdoc2
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp86
-rw-r--r--src/corelib/tools/qscopedpointer.cpp5
-rw-r--r--src/corelib/tools/qscopedvaluerollback.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp85
-rw-r--r--src/corelib/tools/qstringbuilder.cpp3
-rw-r--r--src/corelib/tools/qstringlist.cpp2
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc18
-rw-r--r--src/corelib/tools/qvector.cpp2
-rw-r--r--src/corelib/tools/tools.pri5
-rw-r--r--src/corelib/xml/qxmlstream.cpp5
-rw-r--r--src/dbus/qdbusconnection.cpp7
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp18
-rw-r--r--src/declarative/debugger/debugger.pri6
-rw-r--r--src/declarative/debugger/qdeclarativedebug.cpp5
-rw-r--r--src/declarative/debugger/qdeclarativedebug_p.h3
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorinterface_p.h69
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice.cpp137
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice_p.h91
-rw-r--r--src/declarative/debugger/qdeclarativeobserverinterface_p.h69
-rw-r--r--src/declarative/debugger/qdeclarativeobserverservice.cpp137
-rw-r--r--src/declarative/debugger/qdeclarativeobserverservice_p.h91
-rw-r--r--src/declarative/debugger/qjsdebuggeragent.cpp13
-rw-r--r--src/declarative/debugger/qjsdebuggeragent_p.h13
-rw-r--r--src/declarative/debugger/qjsdebugservice.cpp10
-rw-r--r--src/declarative/debugger/qpacketprotocol.cpp87
-rw-r--r--src/declarative/declarative.pro2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp26
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp22
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp28
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp43
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp24
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h17
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp59
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp9
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp61
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h7
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp6
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp6
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp14
-rw-r--r--src/declarative/qml/qdeclarativetypeloader.cpp24
-rw-r--r--src/declarative/qml/qperformancetimer.cpp55
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp10
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp14
-rw-r--r--src/declarative/util/qdeclarativepixmapcache_p.h2
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp30
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager.cpp6
-rw-r--r--src/declarative/util/qdeclarativeview.cpp6
-rw-r--r--src/gui/accessible/qaccessible.cpp131
-rw-r--r--src/gui/accessible/qaccessiblewidget.cpp11
-rw-r--r--src/gui/dialogs/dialogs.pri6
-rw-r--r--src/gui/dialogs/qfiledialog_symbian.cpp6
-rw-r--r--src/gui/egl/qegl_p.h10
-rw-r--r--src/gui/embedded/qkbd_qws.cpp2
-rw-r--r--src/gui/embedded/qkbdum_qws.cpp2
-rw-r--r--src/gui/embedded/qlock.cpp142
-rw-r--r--src/gui/embedded/qmousepc_qws.cpp2
-rw-r--r--src/gui/embedded/qscreenlinuxfb_qws.cpp5
-rw-r--r--src/gui/embedded/qwindowsystem_qws.cpp26
-rw-r--r--src/gui/embedded/qwslock.cpp185
-rw-r--r--src/gui/embedded/qwslock_p.h14
-rw-r--r--src/gui/embedded/qwssharedmemory.cpp120
-rw-r--r--src/gui/embedded/qwssharedmemory_p.h34
-rw-r--r--src/gui/embedded/qwssignalhandler.cpp52
-rw-r--r--src/gui/embedded/qwssignalhandler_p.h22
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp6
-rw-r--r--src/gui/image/qimage.cpp7
-rw-r--r--src/gui/image/qpixmap_mac.cpp2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h1
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp46
-rw-r--r--src/gui/itemviews/qtableview.cpp2
-rw-r--r--src/gui/kernel/qactiongroup.cpp4
-rw-r--r--src/gui/kernel/qapplication_mac.mm3
-rw-r--r--src/gui/kernel/qapplication_qpa.cpp19
-rw-r--r--src/gui/kernel/qapplication_qws.cpp29
-rw-r--r--src/gui/kernel/qapplication_s60.cpp34
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
-rw-r--r--src/gui/kernel/qdesktopwidget.qdoc10
-rw-r--r--src/gui/kernel/qevent.cpp6
-rw-r--r--src/gui/kernel/qeventdispatcher_s60.cpp66
-rw-r--r--src/gui/kernel/qeventdispatcher_s60_p.h27
-rw-r--r--src/gui/kernel/qgenericplugin_qpa.cpp2
-rw-r--r--src/gui/kernel/qgenericpluginfactory_qpa.cpp3
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.h2
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.cpp89
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.cpp6
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp16
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp23
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.cpp24
-rw-r--r--src/gui/kernel/qsessionmanager_qws.cpp3
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp12
-rw-r--r--src/gui/kernel/qsoftkeymanager_common_p.h2
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp4
-rw-r--r--src/gui/kernel/qwidget_qpa.cpp33
-rw-r--r--src/gui/painting/painting.pri4
-rw-r--r--src/gui/painting/qbrush.cpp18
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp1010
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h152
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian.cpp36
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian_p.h3
-rw-r--r--src/gui/painting/qoutlinemapper.cpp9
-rw-r--r--src/gui/painting/qoutlinemapper_p.h8
-rw-r--r--src/gui/painting/qpaintengine.cpp1
-rw-r--r--src/gui/painting/qpaintengine_mac_p.h2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp1484
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h6
-rw-r--r--src/gui/painting/qpaintengineex.cpp47
-rw-r--r--src/gui/painting/qpaintengineex_p.h3
-rw-r--r--src/gui/painting/qpainter.cpp63
-rw-r--r--src/gui/painting/qpainter_p.h2
-rw-r--r--src/gui/painting/qrasterizer.cpp4
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp16
-rw-r--r--src/gui/painting/qunifiedtoolbarsurface_mac.cpp6
-rw-r--r--src/gui/painting/qwindowsurface_qws.cpp72
-rw-r--r--src/gui/styles/qs60style.cpp280
-rw-r--r--src/gui/styles/qs60style_feedbackinterface_p.h50
-rw-r--r--src/gui/styles/qs60style_p.h3
-rw-r--r--src/gui/styles/qs60style_s60.cpp54
-rw-r--r--src/gui/styles/qs60style_simulated.cpp19
-rw-r--r--src/gui/text/qfont.cpp50
-rw-r--r--src/gui/text/qfont.h6
-rw-r--r--src/gui/text/qfont_p.h1
-rw-r--r--src/gui/text/qfontdatabase.cpp4
-rw-r--r--src/gui/text/qfontdatabase_mac.cpp142
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp3
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp63
-rw-r--r--src/gui/text/qfontengine_coretext.mm42
-rw-r--r--src/gui/text/qfontengine_coretext_p.h4
-rw-r--r--src/gui/text/qfontengine_ft.cpp8
-rw-r--r--src/gui/text/qfontengine_x11.cpp2
-rw-r--r--src/gui/text/qfontinfo.h1
-rw-r--r--src/gui/text/qfontmetrics.cpp6
-rw-r--r--src/gui/text/qglyphrun.cpp108
-rw-r--r--src/gui/text/qglyphrun.h4
-rw-r--r--src/gui/text/qglyphrun_p.h19
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp64
-rw-r--r--src/gui/text/qrawfont.cpp69
-rw-r--r--src/gui/text/qrawfont.h1
-rw-r--r--src/gui/text/qrawfont_ft.cpp6
-rw-r--r--src/gui/text/qtextdocument.cpp4
-rw-r--r--src/gui/text/qtextengine.cpp71
-rw-r--r--src/gui/text/qtextengine_p.h2
-rw-r--r--src/gui/text/qtextformat.cpp61
-rw-r--r--src/gui/text/qtextlayout.cpp40
-rw-r--r--src/gui/text/qtextodfwriter.cpp1
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp37
-rw-r--r--src/gui/util/util.pri6
-rw-r--r--src/gui/widgets/qlineedit.cpp7
-rw-r--r--src/gui/widgets/qmdiarea.cpp2
-rw-r--r--src/gui/widgets/qtabwidget.cpp2
-rw-r--r--src/imports/imports.pro1
-rwxr-xr-xsrc/imports/shaders/glfunctions.h75
-rw-r--r--src/imports/shaders/qmldir2
-rw-r--r--src/imports/shaders/qmlshadersplugin_plugin.cpp55
-rw-r--r--src/imports/shaders/qmlshadersplugin_plugin.h56
-rw-r--r--src/imports/shaders/scenegraph/qsggeometry.cpp310
-rw-r--r--src/imports/shaders/scenegraph/qsggeometry.h234
-rw-r--r--src/imports/shaders/shadereffect.cpp192
-rw-r--r--src/imports/shaders/shadereffect.h81
-rw-r--r--src/imports/shaders/shadereffectbuffer.cpp52
-rw-r--r--src/imports/shaders/shadereffectbuffer.h62
-rw-r--r--src/imports/shaders/shadereffectitem.cpp915
-rw-r--r--src/imports/shaders/shadereffectitem.h152
-rw-r--r--src/imports/shaders/shadereffectsource.cpp472
-rw-r--r--src/imports/shaders/shadereffectsource.h158
-rw-r--r--src/imports/shaders/shaders.pro38
-rw-r--r--src/network/access/qhttpmultipart.cpp2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp4
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp2
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp15
-rw-r--r--src/network/kernel/kernel.pri2
-rw-r--r--src/network/socket/qhttpsocketengine.cpp2
-rw-r--r--src/network/socket/qsocks5socketengine.cpp2
-rw-r--r--src/network/ssl/qsslsocket.cpp4
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp10
-rw-r--r--src/network/ssl/qsslsocket_p.h4
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp66
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
-rw-r--r--src/opengl/qgl.cpp20
-rw-r--r--src/opengl/qgl_qpa.cpp12
-rw-r--r--src/opengl/qgl_symbian.cpp4
-rw-r--r--src/opengl/qgl_x11.cpp4
-rw-r--r--src/opengl/qglframebufferobject.cpp9
-rw-r--r--src/opengl/qglpixelbuffer.cpp2
-rw-r--r--src/opengl/qpaintengine_opengl_p.h1
-rw-r--r--src/opengl/qwindowsurface_gl.cpp18
-rw-r--r--src/openvg/qpaintengine_vg_p.h1
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp113
-rw-r--r--src/plugins/accessible/widgets/rangecontrols.cpp18
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp4
-rw-r--r--src/plugins/bearer/icd/qicdengine.cpp1
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp439
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h1
-rw-r--r--src/plugins/phonon/mmf/mmf.pro6
-rw-r--r--src/plugins/platforms/glxconvenience/glxconvenience.pri8
-rw-r--r--src/plugins/platforms/glxconvenience/qglxconvenience.cpp30
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp4
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.h2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp9
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp4
-rw-r--r--src/plugins/platforms/wayland/qwaylandclipboard.cpp115
-rw-r--r--src/plugins/platforms/wayland/qwaylandclipboard.h17
-rw-r--r--src/plugins/platforms/wayland/qwaylanddisplay.cpp50
-rw-r--r--src/plugins/platforms/wayland/qwaylanddisplay.h17
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp11
-rw-r--r--src/plugins/platforms/wayland/wayland.pro2
-rw-r--r--src/plugins/platforms/wayland/wayland_sha1.txt3
-rw-r--r--src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp92
-rw-r--r--src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h70
-rw-r--r--src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri16
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h6
-rw-r--r--src/plugins/platforms/xcb/qxcbwindowsurface.cpp22
-rw-r--r--src/plugins/platforms/xlib/qxlibclipboard.cpp8
-rw-r--r--src/plugins/platforms/xlib/qxlibclipboard.h2
-rw-r--r--src/plugins/platforms/xlib/qxlibintegration.cpp2
-rw-r--r--src/plugins/platforms/xlib/qxlibscreen.cpp2
-rw-r--r--src/plugins/platforms/xlib/qxlibstatic.h1
-rw-r--r--src/plugins/platforms/xlib/qxlibwindow.cpp38
-rw-r--r--src/plugins/platforms/xlib/qxlibwindow.h8
-rw-r--r--src/plugins/platforms/xlib/qxlibwindowsurface.cpp27
-rw-r--r--src/plugins/plugins.pro1
-rw-r--r--src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro51
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp195
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h119
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp282
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h126
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp131
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h99
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/editor.qrc24
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp92
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp165
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h102
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp117
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h86
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp113
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp438
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h126
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp151
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h95
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp328
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h138
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp130
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h77
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp134
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp336
-rw-r--r--src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h113
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp81
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h71
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h143
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp1021
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h147
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h152
-rw-r--r--src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h90
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp195
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h119
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp239
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h121
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp131
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h99
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc24
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png)bin3440 -> 3440 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png)bin3192 -> 3192 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png)bin3173 -> 3173 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png)bin3395 -> 3395 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png)bin3205 -> 3205 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png)bin1283 -> 1283 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png)bin3539 -> 3539 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png)bin3307 -> 3307 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/pause.png)bin3097 -> 3097 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png)bin3655 -> 3655 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/play.png)bin3363 -> 3363 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/reload.png)bin3418 -> 3418 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png)bin160 -> 160 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png)bin3510 -> 3510 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png)bin2891 -> 2891 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png)bin2871 -> 2871 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/select.png)bin3308 -> 3308 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png)bin3407 -> 3407 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png)bin3227 -> 3227 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png)bin3566 -> 3566 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png (renamed from src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png)bin3347 -> 3347 bytes
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp92
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h (renamed from src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h)0
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp165
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h102
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp117
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h86
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp113
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h (renamed from src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h)0
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp438
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h126
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp151
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h95
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp328
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h138
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp130
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h77
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp134
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h (renamed from src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h)0
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp336
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h113
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp81
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h71
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h143
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp1021
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h147
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h152
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro51
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h90
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp21
-rw-r--r--src/plugins/qmltooling/qmltooling.pro2
-rw-r--r--src/plugins/s60/3_1/3_1.pro9
-rw-r--r--src/plugins/s60/3_2/3_2.pro23
-rw-r--r--src/plugins/s60/5_0/5_0.pro23
-rw-r--r--src/plugins/s60/bwins/qts60pluginu.def8
-rw-r--r--src/plugins/s60/eabi/qts60pluginu.def8
-rw-r--r--src/plugins/s60/feedback/feedback.pro18
-rw-r--r--src/plugins/s60/feedback/qtactileFeedback.h54
-rw-r--r--src/plugins/s60/feedback/qtactileFeedback_s60.cpp83
-rw-r--r--src/plugins/s60/s60.pro11
-rw-r--r--src/plugins/s60/s60pluginbase.pri23
-rw-r--r--src/plugins/s60/src/qcoreapplication_3_1.cpp48
-rw-r--r--src/plugins/s60/src/qcoreapplication_3_2.cpp48
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_1.cpp49
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp80
-rw-r--r--src/plugins/s60/src/qlocale_3_1.cpp148
-rw-r--r--src/plugins/s60/src/qlocale_3_2.cpp66
-rw-r--r--src/s60installs/bwins/QtCoreu.def221
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def57
-rw-r--r--src/s60installs/bwins/QtGuiu.def1441
-rw-r--r--src/s60installs/bwins/QtNetworku.def4
-rw-r--r--src/s60installs/bwins/QtOpenGLu.def3
-rw-r--r--src/s60installs/bwins/QtOpenVGu.def1
-rw-r--r--src/s60installs/eabi/QtCoreu.def20
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def58
-rw-r--r--src/s60installs/eabi/QtGuiu.def6
-rw-r--r--src/s60installs/eabi/QtOpenGLu.def6
-rw-r--r--src/s60installs/qt.iby46
-rw-r--r--src/s60installs/s60installs.pro25
-rw-r--r--src/script/api/qscriptengine.cpp2
-rw-r--r--src/sql/models/qsqltablemodel.cpp3
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp11
-rw-r--r--tests/arthur/common/paintcommands.cpp20
-rw-r--r--tests/arthur/common/paintcommands.h1
-rw-r--r--tests/auto/declarative/declarative.pro2
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/app/app.pro12
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/app/main.cpp72
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js28
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml41
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro4
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp1341
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro26
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp7
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js11
-rw-r--r--tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml27
-rw-r--r--tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro20
-rw-r--r--tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp154
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp10
-rw-r--r--tests/auto/declarative/qmlshadersplugin/main.qml80
-rw-r--r--tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro18
-rw-r--r--tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp205
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.pngbin1450 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.pngbin1188 -> 1189 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.pngbin1747 -> 1199 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.pngbin950 -> 941 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.pngbin983 -> 975 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.pngbin1243 -> 1235 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.pngbin1235 -> 1225 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.pngbin1253 -> 1247 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.pngbin1249 -> 1243 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.pngbin1241 -> 1234 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.pngbin1251 -> 1242 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.pngbin801 -> 2388 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.pngbin791 -> 762 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.pngbin1313 -> 1313 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.pngbin322 -> 1640 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.pngbin322 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.pngbin465 -> 303 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.pngbin465 -> 303 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.pngbin581 -> 483 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.pngbin1187 -> 1189 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.pngbin1066 -> 1068 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.pngbin967 -> 814 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.pngbin962 -> 809 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.pngbin678 -> 527 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.pngbin676 -> 526 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.pngbin542 -> 399 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.pngbin1563 -> 3481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.pngbin6348 -> 53503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.pngbin13194 -> 13140 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.pngbin1510 -> 1503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.pngbin9415 -> 9297 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.pngbin10671 -> 10626 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.pngbin1362 -> 5123 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.pngbin1377 -> 5500 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.pngbin2037 -> 8641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.pngbin2037 -> 8641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.pngbin1461 -> 6163 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.pngbin1577 -> 6785 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.pngbin1704 -> 6943 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.pngbin1778 -> 7043 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.pngbin1797 -> 7428 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.pngbin1859 -> 6860 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.pngbin1835 -> 8659 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.pngbin2028 -> 8641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.pngbin3756 -> 11626 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.pngbin3891 -> 11869 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.pngbin3964 -> 12264 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.pngbin4054 -> 12607 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.pngbin4132 -> 13243 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.pngbin4234 -> 13260 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.pngbin4238 -> 13260 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.pngbin855 -> 688 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.pngbin863 -> 693 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.pngbin865 -> 695 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.pngbin862 -> 694 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.pngbin855 -> 688 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.pngbin2032 -> 2020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.pngbin2032 -> 2020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.pngbin2032 -> 2020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.pngbin1843 -> 1836 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.pngbin2024 -> 2008 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.pngbin3930 -> 3943 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.pngbin256 -> 703 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.pngbin343 -> 1360 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.pngbin461 -> 2031 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.pngbin1468 -> 1455 bytes
-rw-r--r--tests/auto/lancelot/scripts/statictext.qps122
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp63
-rw-r--r--tests/auto/qcssparser/qcssparser.pro2
-rw-r--r--tests/auto/qdatetime/qdatetime.pro4
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp7
-rw-r--r--tests/auto/qeventloop/tst_qeventloop.cpp11
-rw-r--r--tests/auto/qfont/tst_qfont.cpp13
-rw-r--r--tests/auto/qglyphrun/tst_qglyphrun.cpp79
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp11
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp12
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp10
-rw-r--r--tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp44
-rw-r--r--tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp29
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp6
-rw-r--r--tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro1
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp4
-rw-r--r--tests/auto/qstring/tst_qstring.cpp2
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp5
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp26
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp42
-rw-r--r--tests/auto/qtoolbutton/tst_qtoolbutton.cpp2
-rw-r--r--tests/auto/qtreewidget/tst_qtreewidget.cpp20
-rw-r--r--tests/auto/qurl/tst_qurl.cpp4
-rw-r--r--tests/benchmarks/declarative/declarative.pro2
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml84
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml209
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml82
-rwxr-xr-xtests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml107
-rwxr-xr-xtests/benchmarks/declarative/qmlshadersplugin/TestWater.qml60
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/Water.qml126
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/bg.jpgbin0 -> 10189 bytes
-rwxr-xr-xtests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.pngbin0 -> 46081 bytes
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro23
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/sky.jpgbin0 -> 36734 bytes
-rw-r--r--tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp110
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp6
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp6
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro2
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp41
-rw-r--r--tests/manual/declarative/declarative.pro3
-rw-r--r--tests/manual/declarative/qmlshadersplugin/main.cpp67
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml83
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml57
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml82
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml267
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml133
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml119
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml89
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml91
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml89
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml97
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml93
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml84
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml98
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml96
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml102
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml101
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml104
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml108
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml74
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml98
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml85
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml109
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml92
-rwxr-xr-xtests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg11
-rwxr-xr-xtests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.pngbin0 -> 1153 bytes
-rwxr-xr-xtests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.pngbin0 -> 219220 bytes
-rwxr-xr-xtests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.pngbin0 -> 293803 bytes
-rwxr-xr-xtests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.pngbin0 -> 40220 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml236
-rwxr-xr-xtests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpgbin0 -> 337569 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp168
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h69
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri152
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro29
-rw-r--r--tools/linguist/linguist/mainwindow.cpp4
-rw-r--r--tools/linguist/linguist/mainwindow.h2
-rw-r--r--tools/linguist/linguist/messagemodel.cpp2
-rw-r--r--tools/linguist/lrelease/lrelease.pro10
-rw-r--r--tools/linguist/lrelease/main.cpp95
-rw-r--r--tools/linguist/lupdate/main.cpp82
-rw-r--r--tools/linguist/lupdate/merge.cpp54
-rw-r--r--tools/linguist/phrasebooks/japanese.qph15
-rw-r--r--tools/linguist/shared/abstractproitemvisitor.h74
-rw-r--r--tools/linguist/shared/ioutils.cpp161
-rw-r--r--tools/linguist/shared/ioutils.h74
-rw-r--r--tools/linguist/shared/profileevaluator.cpp4170
-rw-r--r--tools/linguist/shared/profileevaluator.h172
-rw-r--r--tools/linguist/shared/profileparser.cpp1037
-rw-r--r--tools/linguist/shared/profileparser.h195
-rw-r--r--tools/linguist/shared/proitems.cpp448
-rw-r--r--tools/linguist/shared/proitems.h317
-rw-r--r--tools/linguist/shared/proparser.pri13
-rw-r--r--tools/linguist/shared/proparser_global.h57
-rw-r--r--tools/linguist/shared/proparserutils.h324
-rw-r--r--tools/linguist/shared/qm.cpp22
-rw-r--r--tools/linguist/shared/simtexth.cpp4
-rw-r--r--tools/linguist/shared/translator.cpp196
-rw-r--r--tools/linguist/shared/translator.h31
-rw-r--r--tools/qdoc3/cppcodemarker.cpp2
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp1
-rw-r--r--tools/qdoc3/qmlvisitor.cpp11
-rw-r--r--tools/qdoc3/qmlvisitor.h2
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf8
-rw-r--r--tools/qdoc3/test/qt-defines.qdocconf3
-rw-r--r--tools/qdoc3/test/qt-html-default-styles.qdocconf6
-rw-r--r--tools/qdoc3/test/qt-html-templates-online.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf505
-rw-r--r--tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-project.qdocconf12
-rw-r--r--tools/qmlplugindump/main.cpp22
-rw-r--r--tools/qtconfig/mainwindow.cpp11
-rw-r--r--translations/assistant_ja.ts2
-rw-r--r--translations/designer_ja.ts52
-rw-r--r--translations/linguist_ja.ts124
-rw-r--r--translations/qt_de.ts34
-rw-r--r--translations/qt_help_ja.ts18
-rw-r--r--translations/qt_ja.ts209
-rw-r--r--translations/qtconfig_ja.ts22
2627 files changed, 99022 insertions, 16677 deletions
diff --git a/.commit-template b/.commit-template
index 589ca89586..6e0e3a4e7c 100644
--- a/.commit-template
+++ b/.commit-template
@@ -5,6 +5,6 @@
# ---[ Fields ]-----------------[ uncomment and edit as applicable ]---|
#Task-number:
-#Reviewed-by:
+Reviewed-by: pending
# ==================================[ please wrap at 72 characters ]===|
diff --git a/config.profiles/symbian/bld.inf b/config.profiles/symbian/bld.inf
index 6ccb11c483..91b90c2408 100644
--- a/config.profiles/symbian/bld.inf
+++ b/config.profiles/symbian/bld.inf
@@ -80,5 +80,5 @@ translations/qt_zh_tw_symbian.ts /epoc32/include/platform/qt/translations/qt_zh_
PRJ_EXTENSIONS
START EXTENSION qt/qtconfig
OPTION QT_ROOT ..
-OPTION OPTIONS -opensource -confirm-license -openvg -opengl-es-2 -script -no-scripttools -no-webkit -make make -graphicssystem openvg -phonon -phonon-backend -usedeffiles -dont-process -nomake examples -nomake demos -nomake tools -audio-backend -fpu softvfp+vfpv2
+OPTION OPTIONS -opensource -confirm-license -openvg -opengl-es-2 -script -no-scripttools -no-webkit -make make -graphicssystem openvg -phonon -phonon-backend -no-usedeffiles -dont-process -nomake examples -nomake demos -nomake tools -audio-backend -fpu softvfp+vfpv2
END \ No newline at end of file
diff --git a/config.profiles/symbian/qt.iby b/config.profiles/symbian/qt.iby
index 18b3940bde..1f295f07cf 100644
--- a/config.profiles/symbian/qt.iby
+++ b/config.profiles/symbian/qt.iby
@@ -52,10 +52,6 @@ file=ABI_DIR\BUILD_DIR\qglgraphicssystem.dll SHARED_LIB_DIR\qglgraphicssystem.dl
// bearer
file=ABI_DIR\BUILD_DIR\qsymbianbearer.dll SHARED_LIB_DIR\qsymbianbearer.dll
-// S60 version compatibility plugins for 5.0 (3.1 and 3.2 devices are never likely to have this in ROM,
-// so don't bother including those plugins
-file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll
-
file=ABI_DIR\BUILD_DIR\qtactilefeedback.dll SHARED_LIB_DIR\qtactilefeedback.dll
// imageformats stubs
diff --git a/config.profiles/symbian/qt.pkg b/config.profiles/symbian/qt.pkg
index 6ef51ce4e8..b2db49f477 100644
--- a/config.profiles/symbian/qt.pkg
+++ b/config.profiles/symbian/qt.pkg
@@ -68,9 +68,6 @@
"/epoc32/release/armv5/urel/phonon_mmf.dll" - "!:\sys\bin\phonon_mmf.dll"
"/epoc32/data/z/resource/qt/plugins/phonon_backend/phonon_mmf.qtplugin" - "!:\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin"
-
-"/epoc32/release/armv5/urel/qts60plugin_5_0.dll" - "!:\sys\bin\qts60plugin_5_0.dll"
-
; localization
"/epoc32/data/z/resource/qt/translations/qt_ur.qm" - "!:\resource\qt\translations\qt_ur.qm"
"/epoc32/data/z/resource/qt/translations/qt_fa.qm" - "!:\resource\qt\translations\qt_fa.qm"
diff --git a/configure b/configure
index 71afa61cac..f99ab32944 100755
--- a/configure
+++ b/configure
@@ -3272,14 +3272,14 @@ fi
# process CFG_MAC_ARCHS
if [ "$PLATFORM_MAC" = "yes" ]; then
# check -arch arguments for validity.
- ALLOWED="x86 ppc x86_64 ppc64 i386"
+ ALLOWED="x86 ppc x86_64 ppc64 i386 arm armv6 armv7"
# Save the list so we can re-write it using only valid values
CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
CFG_MAC_ARCHS=
for i in $CFG_MAC_ARCHS_IN
do
if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
- echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
+ echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64 arm armv6 armv7";
exit 2;
fi
if [ "$i" = "i386" -o "$i" = "x86" ]; then
@@ -4885,7 +4885,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
done
fi
if [ "$BUILD_ON_MAC" = "yes" ]; then
- echo "export MACOSX_DEPLOYMENT_TARGET = 10.4" >> "$mkfile"
+ echo "export MACOSX_DEPLOYMENT_TARGET = 10.5" >> "$mkfile"
echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
diff --git a/demos/deform/main.cpp b/demos/deform/main.cpp
index c49117a2f2..d92ddba186 100644
--- a/demos/deform/main.cpp
+++ b/demos/deform/main.cpp
@@ -50,7 +50,11 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
+#ifdef Q_OS_SYMBIAN
+ bool smallScreen = true;
+#else
bool smallScreen = QApplication::arguments().contains("-small-screen");
+#endif
PathDeformWidget deformWidget(0, smallScreen);
diff --git a/demos/demos.pro b/demos/demos.pro
index f1d5b009a8..ed1844698c 100644
--- a/demos/demos.pro
+++ b/demos/demos.pro
@@ -44,6 +44,9 @@ wince*: SUBDIRS = \
contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{
SUBDIRS += demos_boxes
}
+contains(QT_CONFIG, opengl):contains(QT_CONFIG, svg){
+SUBDIRS += demos_glhypnotizer
+}
mac* && !qpa: SUBDIRS += demos_macmainwindow
wince*|symbian|embedded|x11: SUBDIRS += demos_embedded
@@ -103,6 +106,7 @@ demos_browser.subdir = browser
demos_boxes.subdir = boxes
demos_sub-attaq.subdir = sub-attaq
demos_spectrum.subdir = spectrum
+demos_glhypnotizer.subdir = glhypnotizer
#CONFIG += ordered
!ordered {
diff --git a/demos/glhypnotizer/glhypnotizer.pro b/demos/glhypnotizer/glhypnotizer.pro
new file mode 100644
index 0000000000..a7fdf5e154
--- /dev/null
+++ b/demos/glhypnotizer/glhypnotizer.pro
@@ -0,0 +1,21 @@
+TEMPLATE = app
+CONFIG -= moc
+INCLUDEPATH += .
+
+# Input
+SOURCES += main.cpp
+QT += opengl svg
+RESOURCES = hypnotizer.qrc
+
+build_all:!build_pass {
+ CONFIG -= build_all
+ CONFIG += release
+}
+
+# install
+target.path = $$[QT_INSTALL_DEMOS]/glhypnotizer
+sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.pro *.svg
+sources.path = $$[QT_INSTALL_DEMOS]/glhypnotizer
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
diff --git a/demos/glhypnotizer/hypnotizer.qrc b/demos/glhypnotizer/hypnotizer.qrc
new file mode 100644
index 0000000000..97ba159382
--- /dev/null
+++ b/demos/glhypnotizer/hypnotizer.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>qt-logo.png</file>
+ <file>spiral.svg</file>
+</qresource>
+</RCC> \ No newline at end of file
diff --git a/demos/glhypnotizer/main.cpp b/demos/glhypnotizer/main.cpp
new file mode 100644
index 0000000000..cc1482deba
--- /dev/null
+++ b/demos/glhypnotizer/main.cpp
@@ -0,0 +1,356 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the 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 <QtGui>
+#include <QtOpenGL>
+#include <QtSvg>
+
+#define NUM_SWIRLY_ITEMS 10
+
+class GLPainter : public QObject
+{
+ Q_OBJECT
+public:
+ GLPainter(QGLWidget *widget);
+ void stop();
+ void resizeViewport(const QSize &size);
+
+public slots:
+ void start();
+
+protected:
+ void timerEvent(QTimerEvent *event);
+ void paint();
+ void initSwirlyItems();
+ void updateSwirlyItems();
+ void drawSuggestiveMessages(QPainter *p);
+
+private:
+ QMutex mutex;
+ QGLWidget *glWidget;
+ int viewportWidth;
+ int viewportHeight;
+ bool doRendering;
+ qreal rotationAngle;
+ bool swirlClockwise;
+ QSvgRenderer svgRenderer;
+ QPixmap logo;
+ QPainter::PixmapFragment swirlyItems[NUM_SWIRLY_ITEMS];
+ int swirlyCounter;
+ int textCounter;
+ int messageYPos;
+ qreal scaleFactor;
+};
+
+
+GLPainter::GLPainter(QGLWidget *widget)
+ : glWidget(widget)
+ , doRendering(true)
+ , rotationAngle(rand() % 360)
+ , swirlClockwise((rand() % 2) == 1)
+ , svgRenderer(QLatin1String(":/spiral.svg"), this)
+ , logo(QLatin1String(":/qt-logo.png"))
+{
+}
+
+void GLPainter::start()
+{
+ glWidget->makeCurrent();
+ startTimer(20);
+}
+
+void GLPainter::stop()
+{
+ QMutexLocker locker(&mutex);
+ doRendering = false;
+}
+
+void GLPainter::resizeViewport(const QSize &size)
+{
+ QMutexLocker locker(&mutex);
+ viewportWidth = size.width();
+ viewportHeight = size.height();
+ initSwirlyItems();
+ textCounter = 0;
+ messageYPos = -1;
+}
+
+void GLPainter::timerEvent(QTimerEvent *event)
+{
+ QMutexLocker locker(&mutex);
+ if (!doRendering) {
+ killTimer(event->timerId());
+ QThread::currentThread()->quit();
+ return;
+ }
+ updateSwirlyItems();
+ paint();
+}
+
+void GLPainter::paint()
+{
+ QPainter p(glWidget);
+ p.fillRect(QRect(0, 0, viewportWidth, viewportHeight), Qt::white);
+ p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
+ p.translate(viewportWidth / 2, viewportHeight / 2);
+ p.rotate(rotationAngle * (swirlClockwise ? 1 : -1));
+ p.scale(svgRenderer.viewBox().width() / 200.0 * 0.65,
+ svgRenderer.viewBox().height() / 200.0 * 0.65);
+ p.translate(-viewportWidth / 2, -viewportHeight / 2);
+ svgRenderer.render(&p);
+ p.resetTransform();
+ p.drawPixmapFragments(swirlyItems, NUM_SWIRLY_ITEMS, logo);
+ drawSuggestiveMessages(&p);
+ p.end();
+ rotationAngle += 1.2;
+}
+
+void GLPainter::drawSuggestiveMessages(QPainter *p)
+{
+ const int numSuggestiveMessages = 7;
+ const char *texts[numSuggestiveMessages] = {" You feel relaxed.. ",
+ " Let your mind wander.. ",
+ " Look deep into the swirls.. ",
+ " Even deeper.. ",
+ " Qt is good! ",
+ " Qt is good for you! ",
+ " You MUST use Qt! "};
+ QFont font(p->font());
+ font.setPointSizeF(font.pointSizeF() * viewportWidth/200.0);
+ p->setFont(font);
+ QFontMetrics fm(font);
+ int messageNo = textCounter/314;
+ if (messageNo > 6 || messageNo < 0) {
+ qFatal("This should not happen: %d - %d", messageNo, textCounter);
+ }
+ QLatin1String text(texts[textCounter / 314]);
+ qreal textWidth = fm.width(text);
+ int alpha = 255 * qAbs(qSin(textCounter * 0.01));
+ if (messageYPos < 0 || (textCounter % 314 == 0)) {
+ messageYPos = qBound(fm.height(), rand() % viewportHeight,
+ viewportHeight - fm.height());
+ }
+ p->setPen(QColor(255, 255, 255, alpha));
+ p->setBackground(QColor(50, 50, 50, qBound(0, alpha, 50)));
+ p->setBackgroundMode(Qt::OpaqueMode);
+ p->drawText((viewportWidth / 2) - (textWidth/ 2), messageYPos, text);
+ ++textCounter;
+ if (textCounter >= (314 * numSuggestiveMessages))
+ textCounter = 0;
+}
+
+void GLPainter::initSwirlyItems()
+{
+ swirlyCounter = swirlClockwise ? 0 : 360;
+ scaleFactor = viewportWidth / 200.0;
+ QRectF logoRect(0, 0, logo.width(), logo.height());
+
+ for (int i=0; i<NUM_SWIRLY_ITEMS; ++i) {
+ if (swirlClockwise) {
+ swirlyItems[i] = QPainter::PixmapFragment::create(QPointF(0, 0), logoRect,
+ scaleFactor,
+ scaleFactor);
+ } else {
+ swirlyItems[i] = QPainter::PixmapFragment::create(QPointF(0, 0), logoRect,
+ scaleFactor * 1 / 360.0,
+ scaleFactor * 1 / 360.0);
+ }
+ }
+}
+
+void GLPainter::updateSwirlyItems()
+{
+ swirlyCounter += swirlClockwise ? 1 : -1;
+
+ for (int i=0; i<NUM_SWIRLY_ITEMS; ++i) {
+ int factor;
+ factor = swirlClockwise ? (swirlyCounter - i * 20) : (swirlyCounter + i * 20);
+ if (factor > 0 && factor <= 360) {
+ swirlyItems[i].x = viewportWidth / 2.0 + qSin(factor * 0.05) * (viewportWidth / 2.0) * (100.0 / factor);
+ swirlyItems[i].y = viewportHeight / 2.0 + qCos(factor * 0.05) * (viewportHeight / 2.0) * (100.0 / factor);
+ swirlyItems[i].rotation += -swirlyCounter * 0.01;
+ swirlyItems[i].scaleX += swirlClockwise ? -scaleFactor * 1 / 360.0 : scaleFactor * 1 / 360.0;
+ if (swirlClockwise) {
+ if (swirlyItems[i].scaleX < 0)
+ swirlyItems[i].scaleX = scaleFactor;
+ } else {
+ if (swirlyItems[i].scaleX > scaleFactor)
+ swirlyItems[i].scaleX = scaleFactor * 1 / 360.0;
+ }
+ swirlyItems[i].scaleY = swirlyItems[i].scaleX;
+ } else {
+ swirlyItems[i].scaleX = swirlyItems[i].scaleY = 0;
+ }
+ }
+ if (swirlClockwise) {
+ if (swirlyCounter > (360 + NUM_SWIRLY_ITEMS * 20))
+ swirlyCounter = 0;
+ } else {
+ if (swirlyCounter < -NUM_SWIRLY_ITEMS * 20)
+ swirlyCounter = 360;
+ }
+}
+
+class GLWidget : public QGLWidget
+{
+public:
+ GLWidget(QWidget *parent, QGLWidget *shareWidget = 0);
+ ~GLWidget();
+ void startRendering();
+ void stopRendering();
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+ void paintEvent(QPaintEvent *event);
+ QSize sizeHint() const { return QSize(200, 200); }
+
+private:
+ GLPainter glPainter;
+ QThread glThread;
+};
+
+GLWidget::GLWidget(QWidget *parent, QGLWidget *share)
+ : QGLWidget(QGLFormat(QGL::SampleBuffers), parent, share)
+ , glPainter(this)
+ , glThread(this)
+{
+ setAttribute(Qt::WA_PaintOutsidePaintEvent);
+ setAttribute(Qt::WA_DeleteOnClose);
+}
+
+GLWidget::~GLWidget()
+{
+ stopRendering();
+}
+
+void GLWidget::startRendering()
+{
+ glPainter.moveToThread(&glThread);
+ connect(&glThread, SIGNAL(started()), &glPainter, SLOT(start()));
+ glThread.start();
+}
+
+void GLWidget::stopRendering()
+{
+ glPainter.stop();
+ glThread.wait();
+}
+
+void GLWidget::resizeEvent(QResizeEvent *event)
+{
+ glPainter.resizeViewport(event->size());
+}
+
+void GLWidget::paintEvent(QPaintEvent *)
+{
+ // Handled by GLPainter.
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow();
+
+private slots:
+ void newThread();
+ void killThread();
+
+private:
+ QMdiArea mdiArea;
+ QGLWidget shareWidget;
+};
+
+MainWindow::MainWindow()
+ : QMainWindow(0)
+ , mdiArea(this)
+ , shareWidget(this)
+{
+ setWindowTitle("Qt GL Hypnotizer");
+ QMenu *menu = menuBar()->addMenu("&Hypnotizers");
+ menu->addAction("&New hypnotizer thread", this, SLOT(newThread()), QKeySequence("Ctrl+N"));
+ menu->addAction("&End current hypnotizer thread", this, SLOT(killThread()), QKeySequence("Ctrl+K"));
+ menu->addSeparator();
+ menu->addAction("E&xit", qApp, SLOT(quit()), QKeySequence("Ctrl+Q"));
+
+ setCentralWidget(&mdiArea);
+ shareWidget.resize(1, 1);
+ newThread();
+}
+
+void MainWindow::newThread()
+{
+ static int windowCount = 1;
+ if (mdiArea.subWindowList().count() > 9)
+ return;
+ GLWidget *widget = new GLWidget(&mdiArea, &shareWidget);
+ mdiArea.addSubWindow(widget);
+ widget->setWindowTitle("Thread #" + QString::number(windowCount++));
+ widget->show();
+ widget->startRendering();
+}
+
+void MainWindow::killThread()
+{
+ delete mdiArea.activeSubWindow();
+}
+
+int main(int argc, char *argv[])
+{
+ // Make Xlib and GLX thread safe under X11
+ QApplication::setAttribute(Qt::AA_X11InitThreads);
+ QApplication application(argc, argv);
+
+ // Using QPainter to draw into QGLWidgets is only supported with GL 2.0
+ if (!((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) ||
+ (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))) {
+ QMessageBox::information(0, "Qt GL Hypnotizer",
+ "This system does not support OpenGL 2.0 or OpenGL ES 2.0, "
+ "which is required for this example to work.");
+ return 0;
+ }
+
+ MainWindow mainWindow;
+ mainWindow.show();
+ return application.exec();
+}
+
+#include "main.moc"
diff --git a/demos/glhypnotizer/qt-logo.png b/demos/glhypnotizer/qt-logo.png
new file mode 100644
index 0000000000..eaea3445b8
--- /dev/null
+++ b/demos/glhypnotizer/qt-logo.png
Binary files differ
diff --git a/demos/glhypnotizer/spiral.svg b/demos/glhypnotizer/spiral.svg
new file mode 100644
index 0000000000..ff1f047493
--- /dev/null
+++ b/demos/glhypnotizer/spiral.svg
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="512"
+ height="512"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47pre4 r22446"
+ sodipodi:docname="spiral.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient5046">
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="0"
+ id="stop5048" />
+ <stop
+ style="stop-color:#6c90da;stop-opacity:1;"
+ offset="1"
+ id="stop5050" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5046"
+ id="radialGradient5052"
+ cx="359.38702"
+ cy="438.07581"
+ fx="359.38702"
+ fy="438.07581"
+ r="304.44159"
+ gradientTransform="matrix(1,0,0,0.91551877,0,37.009184)"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.99232897"
+ inkscape:cx="267.31099"
+ inkscape:cy="295.6491"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="963"
+ inkscape:window-height="1024"
+ inkscape:window-x="286"
+ inkscape:window-y="74"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-540.36218)">
+ <path
+ sodipodi:type="spiral"
+ style="fill:url(#radialGradient5052);fill-opacity:1;stroke:#000000;stroke-width:20.29999924;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path2816"
+ sodipodi:cx="331.42856"
+ sodipodi:cy="463.79074"
+ sodipodi:expansion="1"
+ sodipodi:revolution="3"
+ sodipodi:radius="337.44537"
+ sodipodi:argument="-18.046196"
+ sodipodi:t0="0"
+ d="m 331.42856,463.79074 c 11.74672,12.17647 -10.61822,21.84178 -20.23809,19.52382 -26.06925,-6.28154 -29.6746,-39.8823 -18.80954,-59.99999 19.43502,-35.98584 68.28562,-39.36493 99.76189,-18.09528 46.19269,31.21408 49.35062,97.07722 17.381,139.5238 -42.61047,56.57461 -126.00702,59.46265 -179.2857,16.66673 -67.04578,-53.85429 -69.64012,-155.00279 -15.95246,-219.0476 65.02296,-77.56686 184.03573,-79.85552 258.80951,-15.23819 88.11831,76.14929 90.09472,213.09185 14.52392,298.57141 C 400.3696,724.38498 245.45564,726.04525 149.28577,639.50509 40.011453,541.17265 38.669765,368.25918 136.1904,261.40987 245.59381,141.54108 436.52669,140.5196 554.04752,249.02876 684.51792,369.4945 685.21808,578.4614 565.71435,706.64779"
+ transform="matrix(0.9291373,0,0,0.91940263,-79.040559,394.33975)" />
+ </g>
+</svg>
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
index fcbfc56a53..b9367219b7 100644
--- a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
@@ -57,11 +57,11 @@ BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/backgroun
myQml.sources = level.qml
-myQml.path = c:/System/quickhitdata/levelone
+myQml.path = c:/system/quickhitdata/levelone
myGraphic.sources = gfx/*
-myGraphic.path = c:/System/quickhitdata/levelone/gfx
+myGraphic.path = c:/system/quickhitdata/levelone/gfx
mySound.sources = sound/*
-mySound.path = c:/System/quickhitdata/levelone/sound
+mySound.path = c:/system/quickhitdata/levelone/sound
# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
DEPLOYMENT += myQml myGraphic mySound
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
index a4f590058b..1370956aa0 100644
--- a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
@@ -60,11 +60,11 @@ BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
myQml.sources = qml/*
-myQml.path = c:/System/quickhitdata/leveltemplate
+myQml.path = c:/system/quickhitdata/leveltemplate
myGraphic.sources = gfx/*
-myGraphic.path = c:/System/quickhitdata/leveltemplate/gfx
+myGraphic.path = c:/system/quickhitdata/leveltemplate/gfx
mySound.sources = sound/*
-mySound.path = c:/System/quickhitdata/leveltemplate/sound
+mySound.path = c:/system/quickhitdata/leveltemplate/sound
# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
DEPLOYMENT += myQml myGraphic mySound
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
index 171ee6c2da..e5c144f381 100644
--- a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
@@ -64,11 +64,11 @@ BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/backgroun
myQml.sources = qml/*
-myQml.path = c:/System/quickhitdata/leveltwo
+myQml.path = c:/system/quickhitdata/leveltwo
myGraphic.sources = gfx/*
-myGraphic.path = c:/System/quickhitdata/leveltwo/gfx
+myGraphic.path = c:/system/quickhitdata/leveltwo/gfx
mySound.sources = sound/*
-mySound.path = c:/System/quickhitdata/leveltwo/sound
+mySound.path = c:/system/quickhitdata/leveltwo/sound
# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
DEPLOYMENT += myQml myGraphic mySound
diff --git a/demos/pathstroke/main.cpp b/demos/pathstroke/main.cpp
index b357f99336..ca201d356c 100644
--- a/demos/pathstroke/main.cpp
+++ b/demos/pathstroke/main.cpp
@@ -48,7 +48,11 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
+#ifdef Q_OS_SYMBIAN
+ bool smallScreen = true;
+#else
bool smallScreen = QApplication::arguments().contains("-small-screen");
+#endif
PathStrokeWidget pathStrokeWidget(smallScreen);
QStyle *arthurStyle = new ArthurStyle();
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index b94d2b8c7d..2fde945a45 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -25,7 +25,6 @@
<example filename="spreadsheet" name="Spreadsheet" />
<example filename="sqlbrowser" name="SQL Browser" />
<example filename="arthurplugin" name="Arthur Plugin" executable="false" />
-
</demos>
<category dirname="animation" name="Animation Framework">
<example filename="animatedtiles" name="Animated Tiles" />
@@ -265,6 +264,9 @@
<example filename="previewer" name="HTML Previewer" />
<example filename="fancybrowser" name="Fancy Browser" />
<example filename="googlechat" name="Google Chat" />
+ <example filename="simplewebplugin" name="Simple Web Plugin" />
+ <example filename="webplugin" name="Web Plugin" />
+ <example filename="webftpclient" name="Web FTP Client" />
</category>
<category dirname="xml" name="XML">
<example filename="saxbookmarks" name="SAX Bookmarks" />
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index 56ab29f618..d89ca53dbb 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -147,4 +147,12 @@ examples for porting}
\list
\o \l{Qt Quick Licensing Information}
\endlist
+
+\section1 Online Examples
+
+\list
+\o Forum Nokia:
+\l{http://wiki.forum.nokia.com/index.php/Qt_Quick_examples_for_porting}{Qt Quick
+examples for porting}
+\endlist
*/
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index 52ece6f5b4..36db62862e 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -422,3 +422,84 @@ a function in the model, e.g.:
updated, and that \e{value} holds the new value.
*/
+
+/*!
+\page qml-presenting-data.html
+\title Presenting Data with QML
+
+\section1 Introduction
+
+Qt Quick contains a set of standard items that can be used to present data in a
+number of different ways. For simple user interfaces,
+\l{Using QML Positioner and Repeater Items#Repeaters}{Repeaters} can be used
+in combination with
+\l{Using QML Positioner and Repeater Items#Positioners}{Positioners}
+to obtain pieces of data and arrange them in a user interface. However, when
+large quantities of data are involved, it is often better to use models with
+the standard views since these contain many built-in display and navigation
+features.
+
+\section1 Views
+
+Views are scrolling containers for collections of items. They are feature-rich,
+supporting many of the use cases found in typical applications, and can be
+customized to meet requirements on style and behavior.
+
+A set of standard views are provided in the basic set of Qt Quick
+graphical elements:
+
+\list
+\o \l{#ListView}{ListView} arranges items in a horizontal or vertical list
+\o \l{#GridView}{GridView} arranges items in a grid within the available space
+\o \l{#PathView}{PathView} arranges items on a path
+\endlist
+
+Unlike these items, \l WebView is not a fully-featured view item, and needs
+to be combined with a \l Flickable item to create a view that performs like
+a Web browser.
+
+\section2 ListView
+
+\l ListView shows a classic list of items with horizontal or vertical placing
+of items.
+
+\beginfloatright
+\inlineimage qml-listview-snippet.png
+\endfloat
+
+The following example shows a minimal ListView displaying a sequence of
+numbers (using an \l{QML Data Models#An Integer}{integer as a model}).
+A simple delegate is used to define an items for each piece of data in the
+model.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/listview/listview-snippet.qml document
+
+
+
+\section2 GridView
+
+\l GridView displays items in a grid like an file manager's icon view.
+
+\section2 PathView
+
+\l PathView displays items on a path, where the selection remains in
+the same place and the items move around it.
+
+\section1 Decorating Views
+
+\section2 Headers and Footers
+
+\section2 Sections
+
+\section2 Navigation
+
+In traditional user interfaces, views can be scrolled using standard
+controls, such as scroll bars and arrow buttons. In some situations, it
+is also possible to drag the view directly by pressing and holding a
+mouse button while moving the cursor. In touch-based user interfaces,
+this dragging action is often complemented with a flicking action, where
+scrolling continues after the user has stopped touching the view.
+
+\section1 Further Reading
+*/
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
index b35ddc59e1..0d9928753e 100644
--- a/doc/src/declarative/qtbinding.qdoc
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -108,7 +108,7 @@ These methods are shown below. Naturally these approaches are not exclusive; you
these methods throughout your application as appropriate.
-\section2 Loading QML components from C++
+\section2 Loading QML Components from C++
A QML document can be loaded with QDeclarativeComponent or QDeclarativeView. QDeclarativeComponent
loads a QML component as a C++ object; QDeclarativeView also does this,
@@ -180,7 +180,7 @@ required \c objectName. It is better for the C++ implementation to know as littl
the QML user interface implementation and the composition of the QML object tree.
-\section2 Embedding C++ objects into QML components
+\section2 Embedding C++ Objects into QML Components
When loading a QML scene into a C++ application, it can be useful to directly embed C++ data into
the QML object. QDeclarativeContext enables this by exposing data to the context of a QML
@@ -231,7 +231,7 @@ in QML views.
Also see the QDeclarativeContext documentation for more information.
-\section2 Defining new QML elements
+\section2 Defining New QML Elements
While new QML elements can be \l {Defining New Components}{defined in QML}, they can also be
defined by C++ classes; in fact, many of the core \l {QML Elements} are implemented through
@@ -270,7 +270,7 @@ For more information on defining new QML elements, see the \l {Tutorial: Writing
-\section1 Exchanging data between QML and C++
+\section1 Exchanging Data between QML and C++
QML and C++ objects can communicate with one another through signals, slots and property
modifications. For a C++ object, any data that is exposed to Qt's \l{The Meta-Object System}{Meta-Object System}
@@ -279,7 +279,7 @@ the QML side, all QML object data is automatically made available to the meta-ob
be accessed from C++.
-\section2 Calling functions
+\section2 Calling Functions
QML functions can be called from C++ and vice-versa.
@@ -314,7 +314,7 @@ same name but different arguments, the correct function will be called according
the types of arguments that are provided.
-\section2 Receiving signals
+\section2 Receiving Signals
All QML signals are automatically available to C++, and can be connected to using QObject::connect()
like any ordinary Qt C++ signal. In return, any C++ signal can be received by a QML object using
@@ -373,7 +373,7 @@ class that is emitting the signal, and that the enum is registered using Q_ENUMS
See \l {Using enumerations of a custom type} below for details.
-\section2 Modifying properties
+\section2 Modifying Properties
Any properties declared in a QML object are automatically accessible from C++. Given a QML item
like this:
@@ -454,7 +454,7 @@ To allow a custom C++ type to be created or used in QML, the C++ class must be r
type using qmlRegisterType(), as shown in the \l {Defining new QML elements} section above.
-\section2 JavaScript arrays and objects
+\section2 JavaScript Arrays and Objects
There is built-in support for automatic type conversion between QVariantList and JavaScript
arrays, and QVariantMap and JavaScript objects.
@@ -465,6 +465,10 @@ below right calls this function, passing a QVariantList and a QVariantMap, which
converted to JavaScript array and object values, repectively:
\table
+\header
+\o Type
+\o String format
+\o Example
\row
\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml 0
\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp 0
@@ -485,7 +489,7 @@ parameter, the value can be created as a JavaScript array or object in the QML
side, and is automatically converted to a QVariantList or QVariantMap when it is passed to C++.
-\section2 Using enumerations of a custom type
+\section2 Using Enumerations of a Custom Type
To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to
register it with Qt's meta object system. For example, the following C++ type has a \c Status enum:
@@ -507,22 +511,22 @@ the \l {Extending QML Functionalities using C++} reference documentation for
more information.
-\section2 Using enumeration values as signal parameters
+\section2 Using Enumeration Values as Signal Parameters
C++ signals may pass enumeration values as signal parameters to QML, providing that the enumeration
and the signal are declared within the same class, or that the enumeration value is one of those declared
in the \l {Qt}{Qt Namespace}.
Additionally, if a C++ signal with an enum parameter should be connectable to a QML function using the
-\l {Connecting signals to methods and other signals}{connect()} function, the enum type must be
-registered using qRegisterMetaType().
+\l{QML Signal and Handler Event System#Connecting Signals to Methods and Signals}{connect()}
+function, the enum type must be registered using qRegisterMetaType().
For QML signals, enum values may be used as signal parameters using the \c int type:
\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 1
-\section2 Automatic type conversion from strings
+\section2 Automatic Type Conversion from Strings
As a convenience, some basic types can be specified in QML using format strings to make it easier to
pass simple values from QML to C++.
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 027bb2eb10..75420d5172 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -210,4 +210,4 @@
#include <QtDeclarative> to use this function.
Returns the QML type id.
- */
+*/
diff --git a/doc/src/declarative/righttoleft.qdoc b/doc/src/declarative/righttoleft.qdoc
index 44277983b4..1f2cd08352 100644
--- a/doc/src/declarative/righttoleft.qdoc
+++ b/doc/src/declarative/righttoleft.qdoc
@@ -64,8 +64,7 @@ This default locale-based alignment can be overriden by setting the \c horizonta
property for the text element, or by enabling layout mirroring using the \l LayoutMirroring attached
property, which causes any explicit left and right horizontal alignments to be mirrored.
Note that when \l LayoutMirroring is set, the \c horizontalAlignment property value remains unchanged;
-the effective alignment of the text element that takes the mirroring into account can be read from the
-\c effectiveHorizontalAlignment property.
+use the property \c LayoutMirroring.enabled instead to query whether the mirroring is in effect.
\snippet doc/src/snippets/declarative/righttoleft.qml 0
@@ -79,9 +78,9 @@ property for controlling the horizontal direction of the layouts. Setting \c lay
the left-to-right layout direction.
The horizontal layout direction can also be reversed through the \l LayoutMirroring attached property.
-This causes the effective \c layoutDirection of positioners and views to be mirrored. Note the actual value
-of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and
-views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property.
+This causes the effective \c layoutDirection of positioners and views to be mirrored. Note though that the actual
+value of the \c layoutDirection property will remain unchanged; use the property \c LayoutMirroring.enabled instead
+to query whether the mirroring is in effect.
\snippet doc/src/snippets/declarative/righttoleft.qml 1
@@ -106,7 +105,7 @@ Applying mirroring in this manner does not change the actual value of the releva
direction of positioners and model views that takes the mirroring into account. Similarly the \l Text,
\l TextInput and \l TextEdit elements have gained the read-only property \c effectiveHorizontalAlignment
for querying the effective visual alignment of text. For anchors, the read only
-\l {Item::anchors}{anchors.mirrored} property reflects whether anchors have been mirrored.
+\l {Item::anchors.top}{anchors.mirrored} property reflects whether anchors have been mirrored.
Note that application layouts and animations that are defined using \l {Item::}{x} property values (as
opposed to anchors or positioner elements) are not affected by the \l LayoutMirroring attached property.
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
index 9e13e98459..3a78f1b3bf 100644
--- a/doc/src/declarative/whatsnew.qdoc
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -26,12 +26,13 @@
****************************************************************************/
/*!
-\title What's new in Qt Quick
+\title What's New in Qt Quick
\page qtquick-whatsnew.html
\section1 Qt 4.7.4 includes QtQuick 1.1
-QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new features.
+QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new
+features.
\section2 PinchArea
@@ -39,14 +40,9 @@ PinchArea provides support for the common two finger pinch gesture.
\section2 LayoutMirroring attached property
-\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas.
-
-\section2 Anchors
-
-Added the following property:
-\list
-\o \l {Item::}{anchors.mirrored}
-\endlist
+\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both
+left-to-right and right-to-left layout versions of your application that target
+different language areas.
\section2 Text
@@ -57,7 +53,6 @@ Added the following properties:
\o \l {Text::}{lineCount}
\o \l {Text::}{maximumLineCount}
\o \l {Text::}{truncated}
-\o \l {Text::}{effectiveHorizontalAlignment}
\endlist
horizontalAlignment now accepts Text.AlignJustify alignment mode.
@@ -70,7 +65,6 @@ Added the following properties, methods and signal handlers:
\o \l {TextEdit::}{lineCount}
\o \l {TextEdit::}{inputMethodComposing}
\o \l {TextEdit::}{mouseSelectionMode}
-\o \l {TextEdit::}{effectiveHorizontalAlignment}
\o \l {TextEdit::}{deselect()}
\o \l {TextEdit::}{isRightToLeft()}
\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
@@ -84,7 +78,6 @@ Added the following properties and methods:
\o \l {TextInput::}{canPaste}
\o \l {TextInput::}{inputMethodComposing}
\o \l {TextInput::}{mouseSelectionMode}
-\o \l {TextInput::}{effectiveHorizontalAlignment}
\o \l {TextInput::}{deselect()}
\o \l {TextInput::}{isRightToLeft()}
\o \l {TextInput::}{moveCursorSelection()} to enable selection by word
@@ -125,17 +118,15 @@ Added the following property:
Added the following properties and methods:
\list
\o \l{ListView::}{layoutDirection}
-\o \l{ListView::}{effectiveLayoutDirection}
\o \l{ListView::}{positionViewAtBeginning()}
\o \l{ListView::}{positionViewAtEnd()}
\endlist
\section2 Flow, Grid and Row
-Added the following properties:
+Added the following property:
\list
\o \l{Flow::}{layoutDirection}
-\o \l{Flow::}{effectiveLayoutDirection}
\endlist
\section2 Repeater
@@ -150,21 +141,21 @@ Added the following methods and signal handlers:
\section2 Component
\list
-\o The \l{Component::}{createObject()} method now accepts a map of initial property values for
-the created object.
+\o The \l{Component::}{createObject()} method now accepts a map of initial
+property values for the created object.
\endlist
\section2 Qt
\list
-\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic global application
-properties.
+\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic
+global application properties.
\endlist
\section2 Other changes
\list
-\o Functions can be \l{Binding Properties from JavaScript}{assigned to properties from JavaScript}
+\o Functions can be \l{Property Binding#Property Binding}{assigned to properties from JavaScript}
to create property bindings.
\o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
\endlist
@@ -174,13 +165,14 @@ to create property bindings.
\section2 QtQuick namespace
-In prior Qt releases, all the Qt Quick elements were available in the \e Qt namespace.
-Starting with Qt 4.7.1, the elements are also available in the \e QtQuick namespace,
-which improves naming consistency, and allows the development of Qt Quick to occur at
-a faster rate than Qt's usual minor release schedule.
+In prior Qt releases, all the Qt Quick elements were available in the \e Qt
+namespace. Starting with Qt 4.7.1, the elements are also available in the
+\e QtQuick namespace, which improves naming consistency, and allows the
+development of Qt Quick to occur at a faster rate than Qt's usual minor release
+schedule.
-The change for developers is very simple - where you previously wrote \e {import Qt 4.7},
-just replace it with \e {import QtQuick 1.0}, like this:
+The change for developers is very simple - where you previously wrote
+\e {import Qt 4.7}, just replace it with \e {import QtQuick 1.0}, like this:
\code
import QtQuick 1.0
@@ -190,7 +182,7 @@ Text {
}
\endcode
-\e {import Qt 4.7} continues to work so existing applications wont break even if they
-aren't updated, but it is recommended that all import statements be modified to the new
-form.
+\e {import Qt 4.7} continues to work so existing applications won't break even
+if they aren't updated, but it is recommended that all import statements be
+modified to the new form.
*/
diff --git a/doc/src/demos/glhypnotizer.qdoc b/doc/src/demos/glhypnotizer.qdoc
new file mode 100644
index 0000000000..97b3c3b89b
--- /dev/null
+++ b/doc/src/demos/glhypnotizer.qdoc
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example demos/glhypnotizer
+ \title GL Hypnotizer
+
+ This demo shows how to use OpenGL from a seperate thread.
+
+ \image glhypnotizer-demo.png
+
+ New MDI windows can be added by pressing Ctrl-N and each new child
+ window renders in it's own thread.
+*/
diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc
index 74a34eedfa..47219bf974 100644
--- a/doc/src/deployment/deployment.qdoc
+++ b/doc/src/deployment/deployment.qdoc
@@ -177,7 +177,7 @@
\o \l{Deploying an Application on Windows}{Qt for Windows}
\o \l{Deploying an Application on Mac OS X}{Qt for Mac OS X}
\o \l{Deploying Qt for Embedded Linux Applications}{Qt for Embedded Linux}
- \o \l{Deploying an Application on the Symbian platform}{Qt for the Symbian platform}
+ \o \l{Deploying an Application on the Symbian Platform}{Qt for the Symbian platform}
\endlist
\sa Installation {Platform-Specific Documentation}
diff --git a/doc/src/development/designer-manual.qdoc b/doc/src/development/designer-manual.qdoc
index 410ca8c3c6..348931f477 100644
--- a/doc/src/development/designer-manual.qdoc
+++ b/doc/src/development/designer-manual.qdoc
@@ -1560,7 +1560,7 @@
\section1 Dock Widgets
Since dock widgets are \l{Using Containers in Qt Designer}
- {container widgets}, they can be added to a form in the usuasl way. Once
+ {container widgets}, they can be added to a form in the usual way. Once
added to a form, dock widgets are not placed in any particular dock area by
default; you need to set the \gui{docked} property to true for each widget
and choose an appropriate value for its \gui{dockWidgetArea} property.
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index 54ed3a11fa..184a881527 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1291,11 +1291,12 @@
automatically be added to the project.
\row \o console \o The target is a Win32 console application (app only). The
proper include paths, compiler flags and libraries will
- automatically be added to the
- project.
+ automatically be added to the project.
\row \o shared \o{1,3} The target is a shared object/DLL. The proper
include paths, compiler flags and libraries will automatically be
- added to the project.
+ added to the project. Note that \c dll can also be used on all platforms;
+ a shared library file with the appropriate suffix for the target platform
+ (dll, so, dylib) will be created.
\row \o dll \o
\row \o dylib \o
\row \o static \o{1,2} The target is a static library (lib only). The proper
@@ -1767,6 +1768,9 @@
executable. If you need to install executable files, you can unset the
files' executable flags.
+ Note that \c qmake will skip files that are executable. If you need to install
+ executable files, you can unset the files' executable flags.
+
\target LEXIMPLS
\section1 LEXIMPLS
@@ -1859,6 +1863,8 @@
\bold{Note:} On the Symbian platform, this variable is ignored.
+ \bold{Note:} On the Symbian platform, this variable is ignored.
+
\target MAKEFILE_GENERATOR
\section1 MAKEFILE_GENERATOR
@@ -3555,11 +3561,11 @@
This can be useful to optionally enable or disable features. For example:
- \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 157
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 157
And then, in the code:
- \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 158
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 158
\section1 basename(variablename)
diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc
index 80bf8382e0..10ae2850b1 100644
--- a/doc/src/development/qtestlib.qdoc
+++ b/doc/src/development/qtestlib.qdoc
@@ -751,8 +751,8 @@
Tools for handling and visualizing test data are available as part of
the \l {qtestlib-tools} project in the \l{Qt Labs} web site.
- These include a tool for comparing performance data obtained from test
- runs and a utility to generate Web-based graphs of performance data.
+ These include a tool for comparing performance data obtained from test
+ runs and a utility to generate Web-based graphs of performance data.
See the \l{qtestlib-tools Announcement}{qtestlib-tools announcement}
for more information on these tools and a simple graphing example.
diff --git a/doc/src/diagrams/webkit-webplugin.png b/doc/src/diagrams/webkit-webplugin.png
new file mode 100644
index 0000000000..be17fae477
--- /dev/null
+++ b/doc/src/diagrams/webkit-webplugin.png
Binary files differ
diff --git a/doc/src/examples/activeqt/dotnet.qdoc b/doc/src/examples/activeqt/dotnet.qdoc
index af62b8d883..24b9cd1660 100644
--- a/doc/src/examples/activeqt/dotnet.qdoc
+++ b/doc/src/examples/activeqt/dotnet.qdoc
@@ -314,7 +314,7 @@
\l{http://qt.nokia.com/products/qsa/}{QSA}, the cross platform
scripting solution for Qt applications, and to COM clients in general.
- When using the "IJW" method, in priciple the only limitation is the
+ When using the "IJW" method, in principle the only limitation is the
time required to write the wrapper classes and data type conversion
functions.
diff --git a/doc/src/examples/applicationicon.qdoc b/doc/src/examples/applicationicon.qdoc
new file mode 100644
index 0000000000..87942e5a86
--- /dev/null
+++ b/doc/src/examples/applicationicon.qdoc
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*! \example widgets/applicationicon
+ \group all-examples
+ \title Application Icon Example
+
+ The example shows how to add an application icon to a mobile application.
+
+ \image appicon_screenshot.png The icon on a Nokia XPressMusic 5800
+
+ \section1 Creating an icon for Maemo
+
+ Maemo expects the icon of an application to be a 64x64 PNG image file. The
+ file name of the icon should be the same as the executable with a \c .png
+ extension. You also need a \c .desktop file that gives the window manager
+ hints about the application, such as name, type and icon.
+
+ \quotefile examples/widgets/applicationicon/applicationicon.desktop
+
+ The \c Icon field should also contain the name of the executable. On the
+ device, application icons are stored in the
+ \c /usr/share/icons/hicolor/64x64/apps directory
+ and desktop files in the \c /usr/share/applications/hildon directory.
+
+ \section1 Creating an icon for Symbian
+
+ Symbian uses Scalable Vector Graphics (SVG Tiny 1.1+) to render
+ application icons in the application menu. Therefore icons could be
+ created manually with a text editor, since SVG files are plain text with
+ XML syntax, but usually you would use a vector graphics program that is
+ able to output SVG files. Popular graphics programs such as Adobe
+ Illustrator or Inkscape are able to do so.
+
+ For best results, the icon should be created on a 44x44 pixel canvas.
+ Otherwise the image might be scaled in unexpected ways.
+
+ Once you have created your icon, make sure that it is stored according to
+ the SVG-Tiny 1.1+ standard. Inkscape, for instance, is not able to save
+ images that way, but there are tools that can convert general SVG files
+ into the Tiny format. For instance, the svg2svgt tool that is bundled with
+ Symbian 3rd and 5th editon SDKs under the folder s60tools can do this
+ conversion to some extent. Another tool to convert SVG to SVG Tiny is SVG
+ Pony.
+
+ \section1 Adding the icons to the project
+
+ Edit the .pro file and specify the ICON variable for the symbian target.
+ For Maemo, we need to add that the \c .desktop and icon file should be
+ installed.
+
+ \quotefile examples/widgets/applicationicon/applicationicon.pro
+
+ Currently, Qt Creator doesn't include the icon and desktop files in the
+ application package for Maemo, merely the executable file is included. As a
+ workaround for this, the files can be added manually in the Projects tab.
+ In the "Create Package" build step for the Maemo target, the \c .desktop
+ file and icon can be added to be a part of the package contents.
+ Unfortunately, these additions are only stored as a part of the
+ \c .pro.user file. This issue will be resolved in a future release of
+ Qt Creator.
+
+ \image appicon_packagecontents.png Manual addition of files to the "Create Package" build step
+*/
diff --git a/doc/src/examples/broadcastreceiver.qdoc b/doc/src/examples/broadcastreceiver.qdoc
index e5d4ae0e4d..409b491dd8 100644
--- a/doc/src/examples/broadcastreceiver.qdoc
+++ b/doc/src/examples/broadcastreceiver.qdoc
@@ -29,7 +29,7 @@
\example network/broadcastreceiver
\title Broadcast Receiver Example
- The Broadcast Receiever example shows how to receive information that is broadcasted
+ The Broadcast Receiver example shows how to receive information that is broadcasted
over a local network.
\image broadcastreceiver-example.png
diff --git a/doc/src/examples/codeeditor.qdoc b/doc/src/examples/codeeditor.qdoc
index 2b0b6fac5d..435f650e9a 100644
--- a/doc/src/examples/codeeditor.qdoc
+++ b/doc/src/examples/codeeditor.qdoc
@@ -190,6 +190,8 @@
used to implement parenthesis matching. In the \c
highlightCurrentLine(), the data of the currentBlock() can be
fetched with QTextBlock::userData(). Matching parentheses can be
- highlighted with an extra selection.
+ highlighted with an extra selection. The "Matching Parentheses
+ with QSyntaxHighlighter" article in Qt Quarterly 31 implements
+ this. You find it here: \l{http://doc.qt.nokia.com/qq/}.
*/
diff --git a/doc/src/examples/combowidgetmapper.qdoc b/doc/src/examples/combowidgetmapper.qdoc
index efd06f6a6f..e852f5e8f3 100644
--- a/doc/src/examples/combowidgetmapper.qdoc
+++ b/doc/src/examples/combowidgetmapper.qdoc
@@ -29,7 +29,7 @@
\example itemviews/combowidgetmapper
\title Combo Widget Mapper Example
- The Delegate Widget Mapper example shows how to use a custom delegate to
+ The Combo Widget Mapper example shows how to use a custom delegate to
map information from a model to specific widgets on a form.
\image combowidgetmapper-example.png
diff --git a/doc/src/examples/cube.qdoc b/doc/src/examples/cube.qdoc
new file mode 100644
index 0000000000..0603941c7b
--- /dev/null
+++ b/doc/src/examples/cube.qdoc
@@ -0,0 +1,178 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example opengl/cube
+ \group all-examples
+ \title Cube OpenGL ES 2.0 example
+
+ The Cube OpenGL ES 2.0 example shows how to write mouse rotateable
+ textured 3D cube using OpenGL ES 2.0 with Qt. It shows how to handle
+ polygon geometries efficiently and how to write simple vertex and
+ fragment shader for programmable graphics pipeline. In addition it
+ shows how to use quaternions for representing 3D object orientation.
+
+ This example has been written for OpenGL ES 2.0 but it works also on
+ desktop OpenGL because this example is simple enough and for the
+ most parts desktop OpenGL API is same. It compiles also without OpenGL
+ support but then it just shows a label stating that OpenGL support is
+ required.
+
+ \image cube.png Screenshot of the Cube example running on N900
+
+ The example consist of two classes:
+
+ \list
+ \o \c MainWidget extends QGLWidget and contains OpenGL ES 2.0
+ initialization and drawing and mouse and timer event handling
+ \o \c GeometryEngine handles polygon geometries. Transfers polygon geometry
+ to vertex buffer objects and draws geometries from vertex buffer objects.
+ \endlist
+
+ We'll start by initializing OpenGL ES 2.0 in \c MainWidget.
+
+ \tableofcontents
+
+ \section1 Initializing OpenGL ES 2.0
+
+ Since OpenGL ES 2.0 doesn't support fixed graphics pipeline anymore it has to
+ be implemented by ourselves. This makes graphics pipeline very flexible but
+ in the same time it becomes more difficult because user has to implement graphics
+ pipeline to get even the simplest example running. It also makes graphics pipeline
+ more efficient because user can decide what kind of pipeline is needed for the
+ application.
+
+ First we have to implement vertex shader. It gets vertex data and
+ model-view-projection matrix (MVP) as parameters. It transforms vertex position
+ using MVP matrix to screen space and passes texture coordinate to
+ fragment shader. Texture coordinate will be automatically interpolated on polygon
+ faces.
+
+ \snippet examples/opengl/cube/vshader.glsl 0
+
+ After that we need to implement second part of the graphics pipeline - fragment
+ shader. For this exercise we need to implement fragment shader that handles
+ texturing. It gets interpolated texture coordinate as a parameter and looks up
+ fragment color from the given texture.
+
+ \snippet examples/opengl/cube/fshader.glsl 0
+
+ Using \c QGLShaderProgram we can compile, link and bind shader code to
+ graphics pipeline. This code uses Qt Resource files to access shader source code.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 3
+
+ The following code enables depth buffering and back face culling.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 2
+
+ \section1 Loading textures from Qt Resource files
+
+ \c QGLWidget interface implements methods for loading textures from QImage to GL
+ texture memory. We still need to use OpenGL provided functions for specifying
+ the GL texture unit and configuring texture filtering options.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 4
+
+ \section1 Cube Geometry
+
+ There are many ways to render polygons in OpenGL but the most efficient way is
+ to use only triangle strip primitives and render vertices from graphics hardware
+ memory. OpenGL has a mechanism to create buffer objects to this memory area and
+ transfer vertex data to these buffers. In OpenGL terminology these are referred
+ as Vertex Buffer Objects (VBO).
+
+ \image cube_faces.png Cube faces and vertices
+
+ This is how cube faces break down to triangles. Vertices are ordered this way
+ to get vertex ordering correct using triangle strips. OpenGL determines triangle
+ front and back face based on vertex ordering. By default OpenGL uses
+ counter-clockwise order for front faces. This information is used by back face
+ culling which improves rendering performance by not rendering back faces of the
+ triangles. This way graphics pipeline can omit rendering sides of the triangle that
+ aren't facing towards screen.
+
+ Creating vertex buffer objects and transferring data to them is quite simple using
+ OpenGL provided functions.
+
+ \snippet examples/opengl/cube/geometryengine.cpp 0
+
+ \snippet examples/opengl/cube/geometryengine.cpp 1
+
+ Drawing primitives from VBOs and telling programmable graphics pipeline how to
+ locate vertex data requires few steps. First we need to bind VBOs to be used.
+ After that we bind shader program attribute names and configure what
+ kind of data it has in the bound VBO. Finally we'll draw triangle
+ strip primitives using indices from the other VBO.
+
+ \snippet examples/opengl/cube/geometryengine.cpp 2
+
+ \section1 Perspective projection
+
+ Using \c QMatrix4x4 helper methods it's really easy to calculate perpective
+ projection matrix. This matrix is used to project vertices to screen space.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 5
+
+ \section1 Orientation of the 3D object
+
+ Quaternions are handy way to represent orientation of the 3D object. Quaternions
+ involve quite complex mathematics but fortunately all the necessary mathematics
+ behind quaternions is implemented in \c QQuaternion. That allows us to store
+ cube orientation in quaternion and rotating cube around given axis is quite
+ simple.
+
+ The following code calculates rotation axis and angular speed based on mouse events.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 0
+
+ \c QBasicTimer is used to animate scene and update cube orientation. Rotations
+ can be concatenated simply by multiplying quaternions.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 1
+
+ Model-view matrix is calculated using the quaternion and by moving world by Z axis.
+ This matrix is multiplied with the projection matrix to get MVP matrix for shader
+ program.
+
+ \snippet examples/opengl/cube/mainwidget.cpp 6
+
+*/
diff --git a/doc/src/examples/dragdroprobot.qdoc b/doc/src/examples/dragdroprobot.qdoc
index 1e3b4342bd..84d8af42b6 100644
--- a/doc/src/examples/dragdroprobot.qdoc
+++ b/doc/src/examples/dragdroprobot.qdoc
@@ -29,7 +29,7 @@
\example graphicsview/dragdroprobot
\title Drag and Drop Robot Example
- This GraphicsView example shows how to implement Drag and Drop in a
+ The Drag and Drop Robot example shows how to implement Drag and Drop in a
QGraphicsItem subclass, as well as how to animate items using Qt's
\l{Animation Framework}.
diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc
index 6a16ceeaf3..e5399b143b 100644
--- a/doc/src/examples/elasticnodes.qdoc
+++ b/doc/src/examples/elasticnodes.qdoc
@@ -29,7 +29,7 @@
\example graphicsview/elasticnodes
\title Elastic Nodes Example
- This GraphicsView example shows how to implement edges between nodes in a
+ The Elastic Nodes example shows how to implement edges between nodes in a
graph, with basic interaction. You can click to drag a node around, and
zoom in and out using the mouse wheel or the keyboard. Hitting the space
bar will randomize the nodes. The example is also resolution independent;
diff --git a/doc/src/examples/elidedlabel.qdoc b/doc/src/examples/elidedlabel.qdoc
new file mode 100644
index 0000000000..5bfe0f8551
--- /dev/null
+++ b/doc/src/examples/elidedlabel.qdoc
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/elidedlabel
+ \group all-examples
+ \title Elided Label Example
+
+ This example creates a widget similar to QLabel, that elides the last
+ visible line, if the text is too long to fit the widget's geometry.
+
+ \image elidedlabel-example.png Elided Label example on XPressMusic 5800
+
+ When text of varying length has to be displayed in a uniformly sized
+ area, for instance within a list or grid view where all list items have the
+ same size, it can be useful to give the user a visual clue when not all
+ text is visible. QLabel can elide text that doesn't fit within it, but only
+ in one line. The \c ElidedLabel widget shown in this example word wraps its
+ text by its width, and elides the last visible line if some text is left
+ out. \c TestWidget gives control to the features of \c ElidedWidget and
+ forms the example application.
+
+
+ \section1 ElidedLabel Class Definition
+
+ Like QLabel, \c ElidedLabel inherits from QFrame. Here's the definition of
+ the \c ElidedLabel class:
+
+
+ \snippet examples/widgets/elidedlabel/elidedlabel.h 0
+
+ The \c isElided property depends the font, text content and geometry of the
+ widget. Whenever any of these change, the \c elisionChanged() signal might
+ trigger. We cache the current elision value in \c elided, so that it
+ doesn't have to be recomputed every time it's asked for.
+
+
+ \section1 ElidedLabel Class Implementation
+
+ Except for initializing the member variables, the constructor sets the size
+ policy to be horizontally expanding, since it's meant to fill the width of
+ its container and grow vertically.
+
+ \snippet examples/widgets/elidedlabel/elidedlabel.cpp 0
+
+ Changing the \c content require a repaint of the widget.
+
+ \snippet examples/widgets/elidedlabel/elidedlabel.cpp 1
+
+ QTextLayout is used in the \c paintEvent() to divide the \c content into
+ lines, that wrap on word boundaries. Each line, except the last visible
+ one, is drawn \c lineSpacing pixels below the previous one. The \c draw()
+ method of QTextLine will draw the line using the coordinate point as the
+ top left corner.
+
+ \snippet examples/widgets/elidedlabel/elidedlabel.cpp 2
+
+ Unfortunately, QTextLayout does not elide text, so the last visible line
+ has to be treated differently. This last line is elided if it is too wide.
+ The \c drawText() method of QPainter draws the text starting from the base
+ line, which is \c ascecnt() pixels below the last drawn line.
+
+ Finally, one more line is created to see if everything fit on this line.
+
+ \snippet examples/widgets/elidedlabel/elidedlabel.cpp 3
+
+ If the text was elided and wasn't before or vice versa, cache it in
+ \c elided and emit the change.
+
+ \snippet examples/widgets/elidedlabel/elidedlabel.cpp 4
+
+
+ \section1 TestWidget Class Definition
+
+ \c TestWidget is a QWidget and is the main window of the example. It
+ contains an \c ElidedLabel which can be resized with two QSlider widgets.
+
+ \snippet examples/widgets/elidedlabel/testwidget.h 0
+
+ \section1 TestWidget Class Implementation
+
+ The constructor initializes the whole widget. Strings of different length
+ are stored in \c textSamples. The user is able to switch between these.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 0
+
+ An \c ElidedLabel is created to contain the first of the sample strings.
+ The frame is made visible to make it easier to see the actual size of the
+ widget.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 1
+
+ The buttons and the elision label are created. By connecting the
+ \c elisionChanged() signal to the \c setVisible() slot of the \c label,
+ it will act as an indicator to when the text is elided or not. This signal
+ could, for instance, be used to make a "More" button visible, or similar.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 2
+
+ The \c widthSlider and \c heightSlider specify the size of the
+ \c elidedText. Since the y-axis is inverted, the \c heightSlider has to be
+ inverted to act appropriately.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 3
+
+ The components are all stored in a QGridLayout, which is made the layout of
+ the \c TestWidget.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 4
+
+ On the Maemo platform, windows are stuck in landscape mode by default. With
+ this attribute set, the window manager is aware that this window can be
+ rotated.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 5
+
+ The \c widthSlider and \c heightSlider have the exact same length as the
+ dimensions of the \c elidedText. The maximum value for both of them is
+ thus their lengths, and each tick indicates one pixel.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 6
+
+ The \c switchText() slot simply cycles through all the available sample
+ texts.
+
+ \snippet examples/widgets/elidedlabel/testwidget.cpp 7
+
+ These slots set the width and height of the \c elided text, in response to
+ changes in the sliders.
+
+ \section1 The \c main() Function
+
+ The \c main() function creates an instance of \c TestWidget fullscreen and
+ enters the message loop.
+
+ \snippet examples/widgets/elidedlabel/main.cpp 0
+*/
+
diff --git a/doc/src/examples/fingerpaint.qdoc b/doc/src/examples/fingerpaint.qdoc
index 5aef64ccaf..49078b66ad 100644
--- a/doc/src/examples/fingerpaint.qdoc
+++ b/doc/src/examples/fingerpaint.qdoc
@@ -29,8 +29,12 @@
\example touch/fingerpaint
\title Finger Paint Example
- The Finger Paint example shows the use of touch with a custom widget
+ The Finger Paint example shows the use of a touchscreen with a custom widget
to create a simple painting application.
\image touch-fingerpaint-example.png
+
+ This example was specifically designed to work with a touchscreen, using
+ QTouchEvent instead of QMouseEvent to handle user input over the custom
+ widget. As a result, it is not possible to draw with the mouse cursor.
*/
diff --git a/doc/src/examples/maemovibration.qdoc b/doc/src/examples/maemovibration.qdoc
new file mode 100644
index 0000000000..de53ba4a8c
--- /dev/null
+++ b/doc/src/examples/maemovibration.qdoc
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/maemovibration
+ \group all-examples
+ \title Maemo Vibration Example
+
+ The Maemo Vibration example shows how to tell the Maemo Mode Control Entity
+ (MCE) to vibrate a maemo device.
+
+ The MCE is a system service on Maemo that, among other things, provides an
+ D-Bus interface to trigger vibrations. The vibrations are specified as
+ patterns and are defined in a system configuration file.
+
+ The example program reads the configuration file to look for possible
+ vibration patterns and display a button for each. Pressing a button will
+ make the device vibrate accordingly, until the application closes, or
+ another pattern is started.
+
+ \image maemovibration-example.png Screenshot of the Maemo Vibration Example
+
+ The code makes use of two classes:
+
+ \list
+ \o \c MceVibrator connects to the MCE service and can start a certain
+ vibrator pattern. It also is responsible to parse the configuration
+ file.
+
+ \o \c ButtonWidget provides a button for each pattern. Pressing the button
+ activates the pattern in question.
+ \endlist
+
+
+ \section1 MceVibrator Class Definition
+
+ \snippet examples/widgets/maemovibration/mcevibrator.h 0
+
+ The \c MceVibrator class inherits from QObject and provides a specialized
+ and Qt friendly interface to the MCE vibration facilty. The slot \c vibrate()
+ can be called to make the device vibrate according to a specific pattern
+ name. We will connect it to a signal of a \c ButtonWidget object later. The
+ static method \c ParsePatternNames() can be called to find out which patterns
+ are available to us.
+
+ \list
+ \o \c mceInterface is our D-Bus handle to the MCE service. We use it to
+ invoke methods on the MCE request object.
+
+ \o \c lastPatternName contains the pattern that was activated last time. We
+ have to keep track of this, because the last pattern has to be
+ deactivated before activating a new pattern.
+ \endlist
+
+
+ \section1 MceVibrator Class Implementation
+
+ To connect to the service, we initialize the D-Bus interface handle. The
+ system header \c "mce/dbus-names.h" contains definitions of the D-Bus
+ service name and request object path and interface. These are passed to the
+ constructor of the handle, and Qt will automatically establish a connection
+ to it, if it is possible.
+
+ The MCE expects us to first enable the vibrator before we can use it. This
+ is done with the call to the \c MCE_ENABLE_VIBRATOR D-Bus method.
+
+ \snippet examples/widgets/maemovibration/mcevibrator.cpp 0
+
+ From now on we can activate vibration patterns. Each time a vibration
+ pattern is activated, the last pattern has to be deactivated first. In the
+ vibrate slot we use the MCE interface to call the activation method.
+
+ \snippet examples/widgets/maemovibration/mcevibrator.cpp 1
+
+ The calls to the private method deactivate simply makes sure to deactivate
+ the last pattern used, if there was one.
+
+ \snippet examples/widgets/maemovibration/mcevibrator.cpp 2
+
+ Calling either the activate or deactivate MCE D-Bus method with invalid
+ pattern names are ignored.
+
+ Finally, the destructor disables the vibrator. When the destructor of the
+ MCE interface handle is called, the connection is also closed.
+
+ \snippet examples/widgets/maemovibration/mcevibrator.cpp 3
+
+ The MCE configuration file contains options for many different things. We
+ are only interested in one line that contains the vibration patterns. It
+ has the following format:
+
+
+ \code
+ VibratorPatterns=semicolon;separated;list;of;values
+ \endcode
+
+ The static method \c ParsePatternNames looks for this line and returns a
+ QStringList containing the values, which are the pattern names we can use.
+
+ \snippet examples/widgets/maemovibration/mcevibrator.cpp 4
+
+ The helper function \c checkError() saves us some code duplication. None of the
+ called methods return anything of use to us, so we're only interested in
+ getting error messages for debugging.
+
+ \snippet examples/widgets/maemovibration/mcevibrator.cpp 5
+
+
+ \section1 ButtonWidget Class Definition
+
+ \snippet examples/widgets/maemovibration/buttonwidget.h 0
+
+ The \c ButtonWidget class inherits from QWidget and provides the main user
+ interface for the application. It creates a grid of buttons, one for each
+ string in the stringlist passed to the constructor. Pressing a button emits
+ the \c clicked() signal, where the string is the text of the button that
+ was pressed.
+
+ This class is taken from the QSignalMapper documentation. The only change
+ is the number of columns in the grid from three to two, to make the button
+ labels fit.
+
+
+ \section1 ButtonWidget Class Implementation
+
+ \snippet examples/widgets/maemovibration/buttonwidget.cpp 0
+
+
+ \section1 \c main() Function
+
+ The main function begins with looking up the patterns available to us.
+
+ \snippet examples/widgets/maemovibration/main.cpp 0
+
+ Then we create one instance of both classes, and connects the
+ \c ButtonWidget's clicked signal to the \c MceVibrator's \c vibrate() slot.
+ This works, since the button texts are the same as the pattern names.
+
+ \snippet examples/widgets/maemovibration/main.cpp 1
+*/
diff --git a/doc/src/examples/orientation.qdoc b/doc/src/examples/orientation.qdoc
new file mode 100644
index 0000000000..f55a6507bc
--- /dev/null
+++ b/doc/src/examples/orientation.qdoc
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*! \example widgets/orientation
+ \group all-examples
+ \title Orientation Example
+
+ The example shows a simple way to use different UIs depending on the screen
+ orientation of a mobile device.
+
+ \image orientation-landscape.png The UI in landscape mode
+ \image orientation-portrait.png The UI in portrait mode
+
+ The screen on many mobile devices can be viewed in both portrait and
+ landscape orientation. The orientation can be swiched with the help of a
+ hardware or software trigger. Due to the often small physical screen size,
+ user interfaces has to be very simple and compact to stay usable, and
+ applications usually occupy the whole screen. Designing a user interface
+ that works equally well in both landscape and portrait mode is not always
+ possible, however, so making a different layout for each case usually pays
+ off.
+
+ The example application makes use of two different UI widgets created with
+ the Qt Designer, one for portrait and one for landscape orientation. The
+ application has a widget that contains an image and the user is able to
+ select one of three images for it to show. In addition to the two UIs, the
+ application consists of a \c MainWindow class.
+
+ \section1 Landscape UI
+
+ If the screen is in landscape mode, the user probably holds the device with
+ both hands and is ready to give full attention to the application. The
+ landscape UI looks like this:
+
+ \image orientation-landscape-ui.png The landscape UI
+
+ To the left is a QWidget called \c choiceWidget, which will show the
+ current image, and to the right are three QRadioButton instances. The
+ active radio button specifies the image to show.
+
+ \section1 Portrait UI
+
+ When the device is in portrait mode, it usually means that the user holds
+ it with one hand, and can comfortably use the thumb for small amounts of
+ input. The layout is simpler, and is focused on consuming content. The
+ portrait UI looks like this:
+
+ \image orientation-portrait-ui.png The portrait UI
+
+ Similarly, it contains a QWidget, also called \c choiceWidget, that will
+ show the current image. In contrast to the landscape UI, this one doesn't
+ provide any controls to change the image.
+
+ \section1 MainWindow Class Definition
+
+ \c MainWindow inherits from QWidget and acts as the top level widget of the
+ application.
+
+ \snippet examples/widgets/orientation/mainwindow.h 0
+
+ The \c resizeEvent() method is re-implemented, and used to check which
+ UI to show. The \c onRadioButtonClicked() slot is connected to the
+ landscape UI's radio button group and selects the current image.
+
+ \c landscapeWidget and \c portraitWidget will contain the UI layouts. Only
+ one of them is visible at a time.
+
+ \section1 MainWindow Class Implementation
+
+ In the constructor, the widgets that will hold the UIs are created and set
+ up.
+
+ \snippet examples/widgets/orientation/mainwindow.cpp 0
+
+ Since the exit buttons on the layouts are different from each other, both
+ of them have to have their \c clicked() signal connected to the \c close()
+ slot of the main widget. The first image is also made current with the call
+ to \c onRadioButtonClicked().
+
+ \snippet examples/widgets/orientation/mainwindow.cpp 1
+
+ On the Maemo platform, windows are stuck in landscape mode by default. The
+ application has to explicitly say that rotation is supported.
+
+ \snippet examples/widgets/orientation/mainwindow.cpp 2
+
+ The \c resizeEvent() is called when the main window is first created, and
+ also whenever the window has been resized. If the window is shown in
+ full screen, this is an indication that the orientation of the screen has
+ changed.
+
+ The dimensions of \c landscapeWidget is the transpose of the dimensions of
+ \c portraitWidget. When the orientation is known, both are set to the
+ (possibly transposed) size of the window. Depending on the orientation, one
+ widget is made visible and the other invisible.
+
+ \snippet examples/widgets/orientation/mainwindow.cpp 3
+
+ When the user selects one of the radio buttons in the landscape UI, the
+ current image is changed. The image is displayed by specifying the
+ background style of the choice widget. Since both \c portrait and
+ \c landscape have a \c choiceWidget of their own, the change has to be
+ reflected in both instances.
+
+ \snippet examples/widgets/orientation/mainwindow.cpp 4
+
+ Synchronizing both UIs like this might become unfeasible when there are
+ many things that can change. In that case it is better to make use of the
+ \l{Introduction to Model/View Programming}{Model-View-Controller pattern}
+ more extensively and share the content between both portrait and landscape
+ widgets. Then an interface for displaying and manipulating it can be tailor
+ made for both orientations.
+
+ \section1 The \c main() Function
+
+ The main function creates a \c MainWindow instance and shows it full
+ screen.
+ \snippet examples/widgets/orientation/main.cpp 0
+*/
diff --git a/doc/src/examples/portedasteroids.qdoc b/doc/src/examples/portedasteroids.qdoc
index 045812528b..06428bf39e 100644
--- a/doc/src/examples/portedasteroids.qdoc
+++ b/doc/src/examples/portedasteroids.qdoc
@@ -29,8 +29,9 @@
\example graphicsview/portedasteroids
\title Ported Asteroids Example
- This GraphicsView example is a port of the
- Asteroids game, which was based on QCanvas.
+ The Ported Asteroids example is a port of the
+ Asteroids game, which was based on QCanvas, to the Graphics View
+ framework.
\image portedasteroids-example.png
*/
diff --git a/doc/src/examples/portedcanvas.qdoc b/doc/src/examples/portedcanvas.qdoc
index 43b3a38910..49824de437 100644
--- a/doc/src/examples/portedcanvas.qdoc
+++ b/doc/src/examples/portedcanvas.qdoc
@@ -29,8 +29,8 @@
\example graphicsview/portedcanvas
\title Ported Canvas Example
- This GraphicsView example is a port of the old
- QCanvas example from Qt 3.
+ The Ported Canvas example is a port of the old
+ QCanvas example from Qt 3 to the Graphics View framework.
\sa {Porting to Graphics View}
diff --git a/doc/src/examples/recipes.qdoc b/doc/src/examples/recipes.qdoc
index f2665eb005..d4128aacf9 100644
--- a/doc/src/examples/recipes.qdoc
+++ b/doc/src/examples/recipes.qdoc
@@ -29,7 +29,7 @@
\example xmlpatterns/recipes
\title Recipes Example
- The recipes example shows how to use QtXmlPatterns to query XML data
+ The Recipes example shows how to use QtXmlPatterns to query XML data
loaded from a file.
\tableofcontents
diff --git a/doc/src/examples/rsslisting.qdoc b/doc/src/examples/rsslisting.qdoc
index 88933251f2..9554842d05 100644
--- a/doc/src/examples/rsslisting.qdoc
+++ b/doc/src/examples/rsslisting.qdoc
@@ -29,7 +29,7 @@
\example xml/rsslisting
\title RSS-Listing Example
- This example shows how to create a widget that displays news items
+ The RSS-Listing example shows how to create a widget that displays news items
from RDF news sources.
\image rsslistingexample.png
diff --git a/doc/src/examples/schema.qdoc b/doc/src/examples/schema.qdoc
index 99966a62bd..77ccaf5275 100644
--- a/doc/src/examples/schema.qdoc
+++ b/doc/src/examples/schema.qdoc
@@ -29,8 +29,8 @@
\example xmlpatterns/schema
\title XML Schema Validation Example
- This example shows how to use QtXmlPatterns to validate XML with
- a W3C XML Schema.
+ The XML Schema Validation example shows how to use QtXmlPatterns to
+ validate XML with a W3C XML Schema.
\tableofcontents
diff --git a/doc/src/examples/simplewebplugin.qdoc b/doc/src/examples/simplewebplugin.qdoc
new file mode 100644
index 0000000000..9093b9b143
--- /dev/null
+++ b/doc/src/examples/simplewebplugin.qdoc
@@ -0,0 +1,181 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example webkit/simplewebplugin
+ \title Simple Web Plugin Example
+
+ The Simple Web Plugin example shows how to embed a regular Qt widget into a
+ Web page displayed using QWebView.
+
+ \image webkit-simplewebplugin.png A table widget embedded in a Web page.
+
+ In this example, we will show how to include Qt widgets in Web-centric user
+ interfaces.
+
+ \section1 QtWebKit Basics
+
+ QtWebKit provides integration between Qt and WebKit on two different levels.
+ On a low level, Qt provides widgets for Web pages to be rendered onto; on a
+ high level, a set of classes are provided that represent all the key
+ components of a Web browser.
+
+ QWebView is a widget that is used to display Web pages, QWebPage represents
+ the content in a page, and QWebFrame represents an individual frame in a
+ Web page. The code to display a Web page is very simple:
+
+ \snippet webkitsnippets/simple/main.cpp Using QWebView
+
+ The widget provides fundamental Web browsing features, such as Cascading
+ Style Sheet and JavaScript support. Other technologies can be added to
+ provide a more comprehensive experience.
+
+ \section1 Adding a Widget to a Page
+
+ Since Qt is used to render pages, it is easy to add both standard and
+ custom widgets to pages. All we need is some markup to indicate where a
+ widget is expected in a page and a mechanism that lets us know when it
+ needs to be created.
+
+ The markup used involves the \c <object> element, described in the HTML 4
+ specification, which is used to include generic objects in Web pages. When
+ describing an object to represent a widget, there are typically three
+ attributes this element can have: a \c data attribute that indicates where
+ any relevant data can be obtained; \c width and \c height attributes can
+ be used to set the size of the widget on the page.
+
+ Here's how we might describe such an object:
+
+ \snippet examples/webkit/simplewebplugin/pages/index.html embedded object
+
+ The mechanism used by QtWebKit to insert widgets into pages is a plugin
+ factory that is registered with a given WebPage instance. Factories are
+ subclasses of QWebPluginFactory and can be equipped to supply more than one
+ type of widget.
+
+ \section1 Creating a Widget to Embed
+
+ To demonstrate how the factory is used, we create a simple widget that can
+ be used to display Comma-Separated Values (CSV) files. The widget class,
+ \c CSVView, is just a subclass of QTableView with extra functions to set
+ up an internal data model. Instances of the factory class, \c CSVFactory,
+ are responsible for creating \c CSVView widgets and requesting data on
+ their behalf.
+
+ The \c CSVFactory class is defined in the following way:
+
+ \snippet examples/webkit/simplewebplugin/csvfactory.h plugin factory
+
+ The public functions give a good overview of how QtWebKit will use the
+ factory to create widgets. We begin by looking at the factory's constructor:
+
+ \snippet examples/webkit/simplewebplugin/csvfactory.cpp constructor
+
+ The factory contains a network access manager which we will use to obtain
+ data for each of the plugin widgets created.
+
+ The \c plugins() function is used to report information
+ about the kinds of widget plugins it can create; our implementation reports
+ the MIME type it expects and provides a description of the plugin:
+
+ \snippet examples/webkit/simplewebplugin/csvfactory.cpp plugins
+
+ The \c create() function is where most of the action happens. It is
+ called with a MIME type that describes the kind of data to be displayed,
+ a URL that refers to the data, and information about any additional
+ arguments that were specified in the Web page. We begin by checking the
+ basic MIME type information passed in the \c mimeType parameter, and only
+ continue if we recognize it.
+
+ \snippet examples/webkit/simplewebplugin/csvfactory.cpp begin create
+
+ We construct a view widget
+ using the fully-specified MIME type, which is guaranteed to be in the list of
+ arguments if a MIME type has been supplied.
+
+ \snippet examples/webkit/simplewebplugin/csvfactory.cpp submit request
+
+ Lastly, we use the network access manager to request the data specified by
+ the \c url parameter, connecting its \c finished() signal to the view's
+ \c updateModel() slot so that it can collect the data. The reply object is
+ intentionally created on the heap; the \c finished() signal is connected to
+ its \c deleteLater() slot, ensuring that Qt will dispose of it when it is no
+ longer needed.
+
+ The \c CSVView class provides only minor extensions to the functionality of
+ QTableView, with a public slot to handle incoming data and a private
+ variable to record exact MIME type information:
+
+ \snippet examples/webkit/simplewebplugin/csvview.h definition
+
+ The constructor is simply used to record the MIME type of the data:
+
+ \snippet examples/webkit/simplewebplugin/csvview.cpp constructor
+
+ To save space, we will only look at parts of the \c updateModel() function,
+ which begins by obtaining the QNetworkReply object that caused the slot
+ to be invoked before checking for errors:
+
+ \snippet examples/webkit/simplewebplugin/csvview.cpp update model begin
+
+ Assuming that the data is correct, we need to determine whether the
+ CSV file includes a table header, and to find out which character encoding was
+ used to store the data. Both these pieces of information may be included in
+ the complete MIME type information, so we parse this before continuing---this
+ is shown in the online example code.
+
+ \snippet examples/webkit/simplewebplugin/csvview.cpp read data begin
+
+ Since QNetworkReply is a QIODevice subclass, the reply can be read
+ using a suitably configured text stream, and the data fed into a standard
+ model. The mechanics of this can be found in the
+ \l{webkit/simplewebplugin/csvview.cpp}{code listing}. Here, we skip to the
+ end of the function where we close the reply object and set the model on
+ the view:
+
+ \snippet examples/webkit/simplewebplugin/csvview.cpp update model
+
+ Once the reply has been read, and the model populated with data, very little
+ needs to be done by the plugin. Ownership of the view widget is handled
+ elsewhere, and we have ensured that the model will be destroyed when it is
+ no longer needed by making it a child object of the view.
+
+ Let's look quickly at the \c MainWindow implementation:
+
+ \snippet examples/webkit/simplewebplugin/mainwindow.cpp constructor
+
+ Apart from creating and setting a factory on the QWebPage object, the
+ most important task is to enable Web plugins. If this global setting is not
+ enabled, plugins will not be used and our \c <object> elements will simply
+ be ignored.
+
+ \section1 Further Reading
+
+ The \l{Web Plugin Example} extends this example by adding a signal-slot
+ connection between the embedded widget and a JavaScript function in the
+ page.
+*/
diff --git a/doc/src/examples/symbianvibration.qdoc b/doc/src/examples/symbianvibration.qdoc
new file mode 100644
index 0000000000..76f79e5d47
--- /dev/null
+++ b/doc/src/examples/symbianvibration.qdoc
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*! \example widgets/symbianvibration
+ \group all-examples
+ \title Symbian Vibration Example
+
+ The Symbian Vibrator example shows how to get fine-grained vibration
+ control on Symbian devices.
+
+ Native Symbian APIs have to be used to enable vibration, since QtMobility
+ doesn't provide an interface for it yet. It is, however, planned to be
+ included in a future release. In anticipation for that, we make use of the
+ \c XQVibra class that was a part of the Mobile Extensions Technology Preview
+ API for Qt for Symbian. The pre-compiled libraries are no longer compatible
+ with Qt 4.6, but we can include the source code itself with the project.
+
+ \image symbianvibration-example.png Screenshot of the Symbian Vibration example
+
+ The example application divides the window into rectangles, which can be
+ pressed to make the device vibrate. Pressing different rectangles make the
+ device vibrate with different intensities. Each rectangle has a different
+ color and its intensity number is drawn on top of it. Moving the cursor
+ from one rectangle to another changes the vibration intensity to that of
+ the new one. Vibration stops when the mouse button has been released. It
+ is also possible to launch a short burst of vibration through the menu.
+
+ The example consists of four classes:
+
+ \list
+ \o \c XQVibra is the vibration interface class taken from the Mobile
+ Extensions for Qt for Symbian.
+
+ \o \c XQVibraPrivate is the Symbian specific private implementation of the
+ vibration implementation.
+
+ \o \c VibrationSurface is a custom widget that uses a XQVibra instance to
+ vibrate the device depending on where the user presses.
+
+ \o \c MainWindow inherits from QMainWindow and contains a \c VibrationSurface
+ as its central widget, and also has a menu from which it is possible to
+ make the phone vibrate.
+ \endlist
+
+ \section1 XQVibra Class Definition
+
+ The \c XQVibra class uses the pimpl-idiom to hide the platform specific
+ implementation behind a common interface. Technically it would be possible
+ to support more target platforms, with only the addition of a private
+ implementation. The rest of the code would work the same, since only the
+ common interface is used.
+
+ \snippet examples/widgets/symbianvibration/xqvibra.h 0
+
+ \c XQVibra provides a very simple interface for us to use. The interesting
+ part are the three slots \c start(), \c stop() and \c setIntensity(). Calling the start
+ method initiates vibration for the specified duration. Calling it while the
+ device is already vibrating causes it to stop the current one and start the
+ new one, even if the intensities are the same. The \c setIntensity() method
+ should be called before starting vibration.
+
+
+ \section1 VibrationSurface Class Definition
+
+ \c VibrationSurface inherits from QWidget and acts like a controller for a
+ \c XQVibra object. It responds to mouse events and performs custom painting.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.h 0
+
+ The virtual event methods are reimplemented from QWidget. As can be seen,
+ there is no public programmable interface beyond what QWidget provides.
+
+
+ \section1 VibrationSurface Class Implementation
+
+ Mouse events control the intensity of the vibration.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 0
+ \codeline
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 1
+ \codeline
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 2
+
+ Presses starts the vibration, movement changes the intensity and releases
+ stops the vibration. To set the right amount of vibration, the private
+ method \c applyIntensity() is used. It sets the vibration intensity according to
+ which rectangle the mouse currently resides in.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 3
+
+ We make sure only to change the intensity if it is different than last
+ time, so that the vibrator isn't stopped and restarted unnecessarily.
+
+ The range of vibration intensity ranges from 0 to XQVibra::MaxIntensity. We
+ divide this range into a set of levels. The number of levels and the intensity
+ increase for each level are stored in two constants.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 4
+
+ Each rectangle has an intensity of one \c IntensityPerLevel more than the
+ previous one.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 5
+
+ The rectangles are either put in a row, if the widget's width is greater
+ than its height (landscape), otherwise they are put in a column (portrait).
+ Each rectangle's size is thus dependent on the length of the width or the
+ height of the widget, whichever is longer. The length is then divided by
+ the number of levels, which gets us either the height or the width of each
+ rectangle. The dx and dy specify the distance from one rectangle to the
+ next, which is the same as either the width or height of the rectangle.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 6
+
+ For each level of intensity, we draw a rectangle with increasing
+ brightness. On top of the rectangle a text label is drawn, specifying the
+ intesity of this level. We use the rectangle rect as a template for
+ drawing, and move it down or right at each iteration.
+
+ The intensity is calculated by dividing the greater of the width and height
+ into \c NumberOfLevels slices.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 7
+
+ In case the widget's geometry is too small to fit all the levels, the user
+ interface will not work. For simplicity, we just return 0.
+
+ When we know the axis along which the rectangles lie, we can find the one
+ in which the mouse cursor lie.
+
+ \snippet examples/widgets/symbianvibration/vibrationsurface.cpp 8
+
+ The final clamp of the intensity value at the end is necessary in case the
+ mouse coordinate lies outside the widget's geometry.
+
+
+ \section1 MainWindow Class Definition
+
+ Here's the definition of the \c MainWindow class:
+
+ \snippet examples/widgets/symbianvibration/mainwindow.h 0
+
+ \c MainWindow is a top level window that uses a \c XQVibra and a
+ \c VibrationSurface. It also adds a menu option to the menu bar which can
+ start a short vibration.
+
+ \section1 MainWindow Class Implementation
+
+ In the \c MainWindow constructor the \c XQVibra and the \c VibrationSurface
+ are created. An action is added to the menu and is connected to the vibrate
+ slot.
+
+ \snippet examples/widgets/symbianvibration/mainwindow.cpp 0
+
+ The \c vibrate() slot offers a way to invoke the vibration in case no
+ mouse is present on the device.
+
+ \snippet examples/widgets/symbianvibration/mainwindow.cpp 1
+
+ \section1 Symbian Vibration Library
+
+ The \c XQVibra class requires a platform library to be included. It is
+ included in the \c .pro file for the symbian target.
+
+ \quotefromfile examples/widgets/symbianvibration/symbianvibration.pro
+ \skipto /^symbian \{/
+ \printuntil /^\}/
+*/
diff --git a/doc/src/examples/syntaxhighlighter.qdoc b/doc/src/examples/syntaxhighlighter.qdoc
index 703bd62e0c..919d61c3db 100644
--- a/doc/src/examples/syntaxhighlighter.qdoc
+++ b/doc/src/examples/syntaxhighlighter.qdoc
@@ -239,4 +239,14 @@
function. The QSyntaxHighlighter class also provides the \l
{QSyntaxHighlighter::document()}{document()} function which
returns the currently set document.
+
+ \section1 Other Code Editor Features
+
+ It is possible to implement parenthesis matching with
+ QSyntaxHighlighter. The "Matching Parentheses with
+ QSyntaxHighlighter" article in Qt Quarterly 31
+ (\l{http://doc.qt.nokia.com/qq/}) implements this. We also have
+ the \l{Code Editor Example}, which shows how to implement line
+ numbers and how to highlight the current line.
+
*/
diff --git a/doc/src/examples/webftpclient.qdoc b/doc/src/examples/webftpclient.qdoc
new file mode 100644
index 0000000000..469b64590e
--- /dev/null
+++ b/doc/src/examples/webftpclient.qdoc
@@ -0,0 +1,336 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example webkit/webftpclient
+ \title Web FTP Client Example
+
+ The Web FTP Client example shows how to add support for a new protocol
+ to QtWebKit-based applications.
+
+ \image webkit-webftpclient.png An FTP client displaying the contents of the ftp.qt.nokia.com site.
+
+ \section1 Introduction
+
+ The QtWebKit module presents many ways to integrate the worlds of native
+ desktop and mobile applications and the Web, making it possible for
+ developers to extend and combine features found in Qt and WebKit to create
+ new ones. In this article, we examine the use of Qt's network access API
+ with WebKit and show how to turn QWebView into a simple FTP client.
+
+ In the \l{Web Plugin Example}, we extended Qt's WebKit integration by
+ showing how to add custom widgets to Web pages. In the article, we used
+ QNetworkRequest to ask for content for display in a widget, and we obtained
+ the data returned by the server by reading from the corresponding
+ QNetworkReply.
+
+ Qt's network access API is a technology that aims to replace much, but not
+ all, of the functionality provided by the QHttp and QFtp classes.
+ Although the network access API is a Qt-specific technology, the QtWebKit
+ module integrates this Qt technology with WebKit to enable customization of
+ the browser engine by Qt application developers. It also means that we can
+ control how the browser engine obtains and renders content.
+
+ Since QNetworkRequest and QNetworkReply are designed to provide a reusable
+ abstraction for network operations, it seems obvious to use these classes
+ to add FTP support to browsers written using QtWebKit. To do this, we first
+ need to examine the network access classes before we see how the QtWebKit
+ module uses them to manage network operations.
+
+ \section1 Network Access
+
+ The central class in Qt's network access API is QNetworkAccessManager.
+ This class performs the work of dispatching requests to remote servers and
+ handling incoming replies. Applications typically construct an instance of
+ this class and use it for all high level network communication.
+
+ Applications create QNetworkRequest objects, each of them specifying a URL
+ where the request is to be sent and containing meta-data that will be
+ understood by the server. Each request is dispatched by passing it to a
+ function in the network manager \mdash there are different functions
+ corresponding to different kinds of operations, such as
+ \l{QNetworkAccessManager::}{get()}, \l{QNetworkAccessManager::}{put()} and
+ \l{QNetworkAccessManager::}{post()}. Each of these functions returns a
+ QNetworkReply object which is used to obtain the content sent in the reply,
+ as well as any meta-data that describes it.
+
+ The QtWebKit module provides the QWebPage class which represents the
+ content displayed in a QWebView widget. Behind the scenes, this class uses
+ a default network access manager to handle network communication. This
+ default manager works perfectly well for fetching content over HTTP from
+ \tt{http://} URLs, but only supports fetching of files over FTP when using
+ \tt{ftp://} URLs.
+
+ Fortunately, QWebPage provides the \l{QWebPage::}{setNetworkAccessManager()}
+ function that allows the default manager to be replaced with one with more
+ features. This lets us add improved support for FTP quite easily if we can
+ write a new manager that supports \tt{ftp://} URLs.
+
+ The process of replacing the manager and using a new one with an existing
+ QWebPage object can be broken up into three steps:
+
+ \list 1
+ \o Creating a new QNetworkAccessManager subclass.
+ \o Creating a new QNetworkReply subclass to deal with the FTP protocol.
+ \o Setting the new manager on the QWebPage.
+ \endlist
+
+ Additionally, to provide a reasonable user experience, we should also handle
+ content that the browser engine cannot display. To do this, we create a
+ custom \c{Downloader} object. We will briefly return to this topic later.
+
+ \section1 Creating a New Network Manager
+
+ Replacing an existing network manager for a QWebPage is conceptually simple:
+ we subclass QNetworkAccessManager and reimplement its
+ \l{QNetworkAccessManager::}{createRequest()} function to check for URLs
+ with the \tt{ftp} scheme. However, we want to ensure that the manager uses
+ any existing cache and proxy settings that may have been set up for the
+ existing manager used by the QWebPage.
+
+ To keep the existing proxy and cache, we give our network manager a
+ constructor that accepts the old manager as an argument. In the constructor,
+ we reuse the settings from the old manager.
+
+ \snippet examples/webkit/webftpclient/networkaccessmanager.cpp constructor
+
+ The \c{createRequest()} function is used to create and dispatch requests to
+ remote servers for each of the different kinds of operation that the API
+ presents to the developer. Since we are only interested in performing simple
+ fetches of resources using the \tt{ftp} scheme, we filter out other schemes
+ and other kinds of operation, delegating the task of handling these to the
+ default implementation.
+
+ \snippet examples/webkit/webftpclient/networkaccessmanager.cpp create request
+
+ Here, we construct and return an instance of the \c FtpReply class. This
+ class performs most of the work of handling the FTP protocol.
+
+ \section1 Creating a Custom Reply
+
+ The network access API is designed to be simple to use: we set up a request,
+ dispatch it using the network manager, and obtain a QNetworkReply object.
+ If we are not interested in the reply's meta-data, we can simply read the
+ data using its \l{QNetworkReply::}{readAll()} function because QNetworkReply
+ is a QIODevice subclass.
+
+ In order to keep the API so simple, however, we need to perform some work
+ behind the scenes. In this case, that means that we must perform a series of
+ communications with the FTP server. Fortunately, we can use the existing
+ implementation provided by QFtp to perform the low level work.
+
+ In the \c FtpReply class, we need to reimplement four functions in the
+ API to ensure that it will work correctly. These functions,
+ \l{QNetworkReply::}{abort()}, \l{QIODevice::}{bytesAvailable()},
+ \l{QIODevice::}{isSequential()}, \l{QIODevice::}{readData()},
+ rely on the rest of the implementation to fill a QByteArray with data and
+ use an integer offset to track how much has been read from the device by
+ the browser.
+
+ \snippet examples/webkit/webftpclient/ftpreply.h class definition
+
+ The \c{processCommand()}, \c{processListInfo} and \c{processData()} slots
+ handle interaction with the FTP server. The private \c{setContent()} and
+ \c{setListContent()} functions are used to add meta-data to the reply and
+ compose HTML for the browser to display.
+
+ Two of the private variables hold information about the data obtained from
+ the FTP server: \c items is updated to contain information about each
+ file found at a given URL, and \c content contains the raw data obtained
+ from the server. The \c offset variable is used to track how much data has
+ been read by the browser from the reply.
+
+ In the constructor, we construct a QFtp object and connect the signals and
+ slots that form the basis of the interaction with the FTP server. The high
+ level communication is reported by the \l{QFtp::}{commandFinished()}
+ signal. New data from the server is reported by the
+ \l{QFtp::}readyRead()} signal.
+ Individual items in an FTP directory listing are reported by the
+ \l{QFtp::}{listInfo()} signal.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp constructor
+
+ We also initialize the \c offset into the data that represents the number
+ of bytes that the browser has read from the reply. Additionally, we define
+ a list of units for use with the \c setListContent() function.
+ The last two tasks performed in the constructor are to set the URL of the
+ reply so that the browser can tell where it came from, and to connect to
+ the FTP server.
+
+ \section2 Fetching Data from the Server
+
+ All communication with the server is handled by the \c processCommand()
+ slot, which acts on responses from the server and tells us when a command
+ we have issued has completed.
+ This slot performs the task of logging in to the server when connection has
+ occurred (the \l{QFtp::}{ConnectToHost} command has completed), asking for
+ a list of files when logged in (\l{QFtp::}{Login} has completed),
+ preparing a page with a listing when all file information has been received
+ (\l{QFtp::}{List} has completed), and setting the current content for the
+ reply when data has been fetched from the server
+ (\l{QFtp::}{Get} has completed).
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp process command
+
+ The result of the \l{QFtp::}{List} command is handled by looking at the
+ number of items obtained from the server.
+ The items themselves are recorded by the \c processListInfo() slot. When a
+ \l{QFtp::}{List} command is complete, we can count the number of items
+ received and determine whether or not we should create a file listing, or
+ try to fetch the file instead by invoking a \l{QFtp::}{Get} command.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp process list info
+
+ Since the reply will only be used once, we can simply append items to a list
+ and never bother to clear it.
+
+ The \c processData() slot simply appends data obtained from the FTP server
+ to the QByteArray containing the content to be supplied to the browser.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp process data
+
+ Data is appended to the \c content array until the connection to the FTP
+ server is closed, either by the reply or by the server itself. One of the
+ ways in which this happens is when a \l{QFtp::}{Get} command completes. At
+ this point, the \c setContent() function is called from within the
+ \c processCommand() function.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp set content
+
+ Here, we prepare the reply for use by the browser by opening it for
+ unbuffered reading and setting the header that reports the amount of data
+ held by the reply. We emit signals that indicate that the network operation
+ has finished and that it has data to be read. Since we are no longer
+ interested in the FTP server, we close the connection to it.
+
+ \section2 Preparing Content for the Reader
+
+ Another way in which the reply closes the connection to the server is when
+ the \c setListContent() function is called from the \c processCommand()
+ function. Most of the implementation of this function involves transforming
+ the information about the items held in the reply's private \c items
+ variable to HTML.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp set list content
+
+ Once the HTML description of the files has been composed in a QString, we
+ convert it to a UTF-8 encoded set of bytes which we store in the reply's
+ private \c content variable. In this case, the QByteArray holds HTML
+ instead of file data. We set the reply's headers to indicate that it
+ contains UTF-8 encoded HTML with a certain length, and we emit the
+ \l{QNetworkReply::}{readyRead()} and \l{QNetworkReply::}{finished()}
+ signals to let the browser know that it can start reading the content.
+
+ \section2 Supplying Data to the Browser
+
+ We reimplement four QIODevice functions to provide basic read-only behavior,
+ simply supplying the data held in the \c content array.
+
+ We do not support aborting of the reply, so our \c abort() implementation
+ is empty.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp abort
+
+ Similarly, we do not support random access reading, so \c isSequential()
+ is reimplemented to always return true.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp is sequential
+
+ The \c bytesAvailable() function returns the total number of bytes held by
+ the reply minus the value of \c offset, which is the number of bytes we
+ have already supplied to the reader.
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp bytes available
+
+ \snippet examples/webkit/webftpclient/ftpreply.cpp read data
+
+ The \c readData() reimplementation tries to return as much data to the
+ reader as it will allow, copying bytes directly to the appropriate location
+ in memory. The \c offset variable is updated to keep track of how many
+ bytes have been read.
+
+ \section1 Enabling the Protocol
+
+ Now that we have an FTP-enabled network manager and a reply that can handle
+ communication with FTP servers, we can now enable the manager for a given
+ QWebPage.
+ We derive the \c FtpView class from QWebView and configure its behavior in
+ its constructor.
+
+ As we mentioned earlier, we pass the original network manager to the
+ newly-created manager and pass the new manager to the QWebPage belonging to
+ the browser. This enables our network manager for the content it displays.
+
+ \snippet examples/webkit/webftpclient/ftpview.cpp constructor
+
+ We also go to some effort to handle content that WebKit does not natively
+ support, using a \c Downloader helper class to manage this and files that
+ the user downloads via the browser's \gui{Save Link...} context menu entry.
+
+ In the example's \c main() function, we perform the usual steps to
+ initialize our Qt application. We choose an appropriate starting URL for
+ the \c FtpView widget to open before running the application's event loop.
+
+ \snippet examples/webkit/webftpclient/main.cpp main
+
+ \section1 Summary
+
+ As we have seen, enabling support for another protocol and URL scheme in
+ QtWebKit is a fairly simple process involving the creation of a network
+ manager and custom reply object. The implementation challenges
+ are mostly related to how the protocol is handled by the custom
+ QNetworkReply subclass where, in our case, we need to issue the appropriate
+ commands in the correct order to obtain data from the FTP server.
+
+ We also need to ensure that that the reply emits the appropriate signals to
+ inform the browser that it has content to be read. Our implementation is
+ intentionally simple, only notifying the browser with the
+ \l{QIODevice::}{readyRead()} signal when \e all the content is ready to
+ read and emitting the \l{QNetworkReply::}{finished()} signal to indicate
+ that communication is complete; a more sophisticated approach would
+ interleave the commands sent to the server with the emission of signals,
+ allowing the browser to read content as data is obtained from the FTP
+ server.
+
+ The reply also needs to be open for reading. Forgetting to call the
+ \l{QIODevice::}{open()} function is a common error to make when dealing
+ with devices, but in this case it is the reply's responsibility to open
+ itself.
+ It must indicate how much content it has for the browser to read. As we
+ have seen, this is done by setting the reply's
+ \l{QNetworkRequest::}{ContentLengthHeader} header with the appropriate
+ value. With this information available, the browser can read from the reply
+ when the content becomes available, displaying a directory listing or
+ downloading content depending on the type of data supplied.
+
+ We can use the approach described in this article to enable support for
+ other protocols by writing or extending a network manager to handle URL
+ schemes such as \tt mailto, \tt sip, \tt news, \tt file and \tt ldap.
+ Applications that integrate Web content with information from other sources
+ can also provide custom URL schemes as long as care is taken not to use an
+ existing public scheme.
+*/
diff --git a/doc/src/examples/webplugin.qdoc b/doc/src/examples/webplugin.qdoc
new file mode 100644
index 0000000000..04106705ea
--- /dev/null
+++ b/doc/src/examples/webplugin.qdoc
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example webkit/webplugin
+ \title Web Plugin Example
+
+ The Web Plugin example shows how to communicate between a Qt widget
+ embedded in a Web page and the page itself.
+
+ \image webkit-webplugin.png A table widget embedded in a Web page.
+
+ In this example, we will take the widget described in the
+ \l{Simple Web Plugin Example} and show how to set up communications between
+ the widget and the Web environment.
+
+ \section1 Setting up Communications
+
+ There are two ways of interacting with the content in a Web page. The first
+ way involves the use of QWebElement to read and modify the page
+ content and structure; this is useful for certain types of application, as
+ demonstrated by the \l{DOM Traversal Example} and the
+ \l{Simple Selector Example}.
+
+ The second way is to add Qt objects to the page, connecting their signals
+ to JavaScript functions, and executing the object's slots directly from
+ JavaScript in the page. We explore this approach in this example.
+
+ To perform this communication, we require an updated \c CSVView widget from
+ the \l{Simple Web Plugin Example} that can emit a signal whenever a row is
+ selected, a JavaScript function to modify elements on the page, and some
+ glue code to make the connection.
+
+ On the page, the plugin is declared like this:
+
+ \snippet examples/webkit/webplugin/pages/index.html embedded object
+
+ As in the previous example, the \c <object> definition includes information
+ about the data to be displayed, its location, and the dimensions of the
+ plugin in the page.
+
+ Later in the document, we include a table that we will update with data
+ from the \c CSVView widget:
+
+ \snippet examples/webkit/webplugin/pages/index.html table
+
+ The \c CSVView widget is similar to the previous version. However, we
+ wish to obtain and export individual rows of data, so we define the
+ \c rowSelected() signal and \c exportRow() slot to perform this task.
+
+ \snippet examples/webkit/webplugin/csvview.h definition
+
+ Since we wish to obtain one row of data at a time, the constructor includes
+ code to restrict how the user can interact with the view:
+
+ \snippet examples/webkit/simplewebplugin/csvview.cpp constructor
+
+ The \c exportRow() slot provides a convenient mechanism for obtaining and
+ emitting the values found on the current row of the table:
+
+ \snippet examples/webkit/webplugin/csvview.cpp export row
+
+ This slot is connected to a signal belonging to the view's selection model:
+ \l{QItemSelectionModel::}{currentChanged()}. This can be seen by examining
+ the \c updateModel() function in the source code.
+
+ \c exportRow() emits the \c rowSelected() signal, passing strings containing
+ the name, address and quantity in the current table row. To see how this
+ data is passed to the Web page, we need to look at the \c CSVFactory class.
+
+ \section1 Connecting Components Together
+
+ In the \c CSVFactory class, we reimplement the \l{QWebPluginFactory::}{create()}
+ function to create instances of the \c CSVView class, as in the previous
+ example.
+
+ \snippet examples/webkit/webplugin/csvfactory.cpp begin create
+
+ We also expose the view widget to the frame in the page that
+ contains the elements, and set up a connection between the view and a
+ JavaScript function defined in the page header:
+
+ \snippet examples/webkit/webplugin/csvfactory.cpp create connection
+
+ The view is added to the Web page as \c view, and the connection code we
+ evaluate performs a signal-slot connection from the view's \c rowSelected()
+ signal to a pure JavaScript function:
+
+ \js
+ view.rowSelected.connect(fillInTable);
+ \endjs
+
+ \c fillInTable is the name of the JavaScript function to modify the
+ form's input elements. This function expects three arguments: the name,
+ address and quantity values for a row of data.
+
+ Whenever the current row changes in the \c view object, the \c exportRow()
+ slot is called, the data found in the selected row is extracted from the
+ model and emitted in the \c rowSelected() signal as three strings, and
+ the above connection ensures that \c fillInTable() will be called with the
+ current items of data. The appropriate type conversions occur behind the
+ scenes to ensure that each QString is converted to a JavaScript string
+ object.
+
+ The rest of the function is the same as in the previous example:
+
+ \snippet examples/webkit/webplugin/csvfactory.cpp submit request
+
+ We now give the JavaScript \c fillInForm() function to show what it does
+ with the strings it is given. The function itself is defined in the HTML
+ page header:
+
+ \snippet examples/webkit/webplugin/pages/index.html script
+
+ We obtain the elements in the page that we wish to update by using the HTML
+ Document Object Model (DOM) API. The values of these elements are updated
+ with the \c name, \c address and \c quantity strings supplied.
+
+ \section1 Linking Things Together
+
+ Although we have used the widgets to demonstrate the use of signals and
+ slots for communication between Qt components and JavaScript in the browser,
+ we do not need to embed widgets in Web pages to be able to do this. By
+ inserting objects into pages and evaluating JavaScript, Qt applications can
+ be made to examine and process information found online.
+
+ One additional improvement that can be made to this example is to create
+ a relation between the embedded widget and the table to be updated. We
+ could do this by including \c <param> elements within the \c <object>
+ element that refers to the table cells by their \c id attributes. This
+ would help us to avoid hard-coding the \c customers_name,
+ \c customers_address and \c customers_quantity identifiers in the script.
+*/
diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc
index 5522082a84..d70cd4333a 100644
--- a/doc/src/external-resources.qdoc
+++ b/doc/src/external-resources.qdoc
@@ -7,20 +7,20 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms
-** and conditions contained in a signed written agreement between you
-** and Nokia.
-**
-**
-**
+** Foundation and appearing in the file included in the packaging of this
+** file.
**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -483,3 +483,13 @@
\externalpage http://www.symbiansigned.com
\title Symbian Signed
*/
+
+/*!
+ \externalpage http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_accessible_event_i_d_8idl.html
+ \title AccessibleEventID.idl File Reference
+*/
+
+/*!
+ \externalpage http://msdn.microsoft.com/en-us/library/dd318066.aspx
+ \title Microsoft Active Accessibility Event Constants
+*/
diff --git a/doc/src/frameworks-technologies/richtext.qdoc b/doc/src/frameworks-technologies/richtext.qdoc
index 59d7104bd4..236c20c918 100644
--- a/doc/src/frameworks-technologies/richtext.qdoc
+++ b/doc/src/frameworks-technologies/richtext.qdoc
@@ -880,6 +880,10 @@
\row \o \c a
\o Anchor or link
\o Supports the \c href and \c name attributes.
+ Note that the \c{:visited} selector is one of those
+ that is not supported by the rich text engine.
+ See \l{#Supported CSS Selectors}{below} for a list
+ of others.
\row \o \c address
\o Address
\o
@@ -1017,6 +1021,11 @@
\row \o \c strong
\o Strong
\o Same as \c b.
+ \row \o \c style
+ \o Style sheet
+ \o Allows styling information to be included with the rich text.
+ A \l{#CSS Properties}{limited subset of CSS syntax} can be
+ used to change the appearance of the text.
\row \o \c sub
\o Subscript
\o
@@ -1210,5 +1219,4 @@
All CSS 2.1 selector classes are supported except pseudo-class selectors such
as \c{:first-child}, \c{:visited} and \c{:hover}.
-
*/
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index df53d02c98..d597890409 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -786,6 +786,13 @@
\row \o \l{webkit/simpleselector}{Simple Selector}\raisedaster
\o A basic demonstration, showing how to use QWebElement to select elements in a
Web page.
+ \row \o \l{webkit/simplewebplugin}{Simple Web Plugin}\raisedaster
+ \o Shows how to embed a widget into a Web page displayed using a QWebView
+ widget.
+ \row \o \l{webkit/webftpclient}{Web FTP Client}\raisedaster
+ \o Shows how to add support for a new protocol to QtWebKit-based applications.
+ \row \o \l{webkit/webplugin}{Web Plugin}\raisedaster
+ \o Shows how to communicate with a widget embedded into a Web page.
\endtable
Examples marked with an asterisk (*) are fully documented.
diff --git a/doc/src/getting-started/gettingstartedqt.qdoc b/doc/src/getting-started/gettingstartedqt.qdoc
index fc9d799a34..eda5ee11fd 100644
--- a/doc/src/getting-started/gettingstartedqt.qdoc
+++ b/doc/src/getting-started/gettingstartedqt.qdoc
@@ -374,7 +374,7 @@
\code
25 Notepad::Notepad()
26 {
-27 saveAction = new QAction(tr("&Open"), this);
+27 openAction = new QAction(tr("&Open"), this);
28 saveAction = new QAction(tr("&Save"), this);
29 exitAction = new QAction(tr("E&xit"), this);
30
diff --git a/doc/src/getting-started/how-to-learn-qt.qdoc b/doc/src/getting-started/how-to-learn-qt.qdoc
index 981262cf01..d0297751c5 100644
--- a/doc/src/getting-started/how-to-learn-qt.qdoc
+++ b/doc/src/getting-started/how-to-learn-qt.qdoc
@@ -7,20 +7,20 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms
-** and conditions contained in a signed written agreement between you
-** and Nokia.
-**
-**
-**
+** Foundation and appearing in the file included in the packaging of this
+** file.
**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -31,84 +31,188 @@
\brief Links to guides and resources for learning Qt.
\nextpage Tutorials
- \section1 Getting Started
+ \section1 Required programming skills
+
+ Qt is an application development framework based on C++. Traditionally, C++ is the major programming language used to develop with Qt.
+
+ Since the introduction of Qt Quick (Qt UI Creation Kit) in the beginning of 2011, Qt has been supporting script-based declarative programming with QML. QML is very easy to understand for anybody who is familiar with JavaScript as well as for all other developers who are familiar the basics of object oriented programming and have worked with other scripting languages. Designers who are familiar with web development can start with QML and implement their ideas in executable code which can later be powered by more application logic developed by engineering teams.
+
+ A solid understanding of the basics of C++ is essential for those planning on using Qt for C++. You do not need to be a C++ expert to begin. Qt simplifies many aspects of C++ development, making it a lot of fun. The overall development effort is minimal since Qt API are easy to understand and application functionality can be implemented with a smaller a mount of code. C++ experts will find a lot of powerful APIs and tools in Qt which will make complicated things simple and new features easy to get done.
+
+ Various bindings have been developed by the Qt community for other programming languages. See the \l{Qt Language Bindings on Wiki}{this wiki page on Qt Developer Network} for more information about using other programming languages with Qt.
+
+ \section1 Tools to install
+
+ Qt provides a range of tools for all steps in application development for desktops and devices. Tools are integrated into packages that are easily installed on several platforms. You have following options:
- We assume that you already know C++ and will be using it for Qt
- development. See the \l{Qt website} for more information about
- using other programming languages with Qt.
+ \list
+ \o \l{Qt SDK Product Page}{Qt SDK} - one package with all the tools you need for the creation of applications for Symbian and Maemo in addition to desktop platforms such as Microsoft Windows, Mac OS X, and Linux.
+ \o \l{Qt Creator Product Page}{Qt Creator} - a cross-platform integrated development environment (IDE). Note, that the Qt Creator package does not contain the Qt framework itself. You can either configure it to use with a version of Qt already installed on your machine or download a new version of Qt separately.
+ \o \l{Product Overview}{Qt} binary package - a ready-to-go installer for Mac, Linux and Windows containing a precompiled tool chain, libraries, include files, documentation, demos and examples.
+ \o \l{Product Overview}{Qt} source code packages - Qt and Qt creator are available in source code as zip or tar archives as well as on the \l{Public Qt Repository}.
+ \endlist
- If you want to program purely in C++, designing your interfaces
- in code without the aid of any design tools, take a look at the
- \l{Tutorials}. These are designed to get you into Qt programming,
- with an emphasis on working code rather than being a tour of features.
+ All packages above are available for download on the \l{Downloads} page. We recommend starting with Qt SDK since it contains all you need in one package. Later on you can consider installing other packages separately. They can all coexist on your machine and be configured to work with each other.
- If you want to design your user interfaces using a design tool, then
- read at least the first few chapters of the \l{Qt Designer manual}.
+ \section1 Examples in action
- By now you'll have produced some small working applications and
- have a broad feel for Qt programming. You could start work on your
- own projects straight away, but we recommend reading a couple of
- key overviews to deepen your understanding of Qt: The Qt \l{Object
- Model} and \l{Signals and Slots}.
+ One of the most popular ways of discovering new technologies is to walk through examples.
+
+ Qt provides a large selection of examples and demos which are available in source code (check \c demos and \c examples directories in your installation).The main difference between examples and demos is that examples are smaller and more focused on one functionality whereas demos are complete, more complex applications using many Qt features.
+
+ Most of the examples and demos are precompiled and integrated into the \l{Examples and Demos Launcher}.
\div {class="float-left"}
\inlineimage qtdemo-small.png
\enddiv
- \section1 Getting an Overview
+ Run it and see Qt's features in action. You can also start all examples and demos from it as separate applications or browse to the source code. \l{Qt Creator Product Page}{Qt Creator} allows loading of examples as projects with a wizard on the "Welcome" page.
+
+ Additionally, \l{Qt Widget Gallery} provides overviews of selected Qt desktop widgets in each of the styles used on various supported platforms.
+ \clearfloat
- At this point, we recommend looking at the
- \l{All Overviews and HOWTOs}{overviews} and reading those that are
- relevant to your projects. You may also find it useful to browse the
- source code of the \l{Qt Examples}{examples} that have things in
- common with your projects. You can also read Qt's source code since
- this is supplied.
+ If you are new to Qt, you should first take a look on the following examples:
- If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's
- widgets in action.
+ \list
+ \o \l{Calculator Example}
+ \o \l{Application Example}
+ \o \l{Image Viewer Example}
+ \o \l{Basic Drawing Example}
+ \endlist
- The \l{Qt Widget Gallery} also provides overviews of selected Qt
- widgets in each of the styles used on various supported platforms.
- \clearfloat
+ \section1 Qt technology guides
+
+ At some point you should take some time to walk through the Qt technology guides and overviews provided in Qt documentation. Qt is simple to use, but you should have a basic understanding of the key concepts behind Qt to reveal its full power. There is a large selection of documents that are sorted into the following sections:
+
+ \list
+ \o \l{Programming with Qt} - about key components and technologies used in Qt development
+ \o \l{Cross-platform and Platform-specific Development} and \l{Platform-Specific Documentation} - using Qt on different platforms
+ \o \l{Qt Quick} - a home page of Qt Quick in Qt documentation
+ \o \l{UI Design with Qt} - specifics of desktop UI development
+ \o \l{Qt and Key Technologies} - how Qt addresses industry standards and also how they are used in Qt
+ \o \l{Best Practice Guides} - a collection of various tips and hints
+ \endlist
+
+ The following guides are essential for those new to Qt:
+
+ \list
+ \o \l{Object Model}
+ \o \l{Object Trees & Ownership}
+ \o \l{Signals & Slots}
+ \o \l{The Event System}
+ \o \l{Implicit Sharing}
+ \o \l{Container Classes}
+ \o \l{Internationalization with Qt}
+ \o \l{Coordinate System}
+ \o \l{Paint System}
+ \o \l{Network Programming}
+ \o \l{The Qt Resource System}
+ \endlist
+
+ The \l{Develop with Qt} guide provides a good overview of all topics in Qt development and includes links to the section mentioned above as well as many more advanced aspects.
+
+ \section1 Tutorials
- \section1 Books and Learning Materials
+ Compared to examples, tutorials walk you through the development steps of an application and show how to use Qt to implement required functionality. Some Qt tutorials also explain specific details of selected Qt features.
+
+ The \l{Getting Started Programming with Qt} tutorial is a good start for all who are new to Qt. In this tutorial you will develop a simple text editor and go through the major steps of developing of a Qt application.
+
+ Desktop developers should then proceed to the \l{Widgets Tutorial} as well as the \l{Address Book Tutorial}.
+
+ Many Qt developers use Qt Designer to compose desktop UIs in a visual editor. Take a look the \l{Qt Designer manual} to learn more about this.
+
+ The \l{Tutorials} page contains a list of all tutorials provided in Qt documentation.
+
+ \section1 Getting most of Qt documentation
Qt comes with extensive documentation, with hypertext
- cross-references throughout, so you can easily click your way to
+ cross-references throughout so you can easily click your way to
whatever interests you. The part of the documentation that you'll
probably use the most is the \link index.html API
Reference\endlink. Each link provides a different way of
- navigating the API Reference; try them all to see which work best
- for you. You might also like to try \l{Qt Assistant}:
- this tool is supplied with Qt and provides access to the entire
- Qt API, and it provides a full text search facility.
+ navigating the API Reference. Try them all to see which work best
+ for you.
- There are also a growing number of books about Qt programming.
- We recommend the official Qt book,
- \l{http://www.amazon.com/gp/product/0132354160/ref=ase_trolltech/}{C++
- GUI Programming with Qt 4, Second Edition} (ISBN 0-13-235416-0). This book
- provides comprehensive coverage of Qt programming all the way
- from "Hello Qt" to advanced features such as multithreading, 2D and
- 3D graphics, networking, item view classes, and XML. (The first edition,
- which is based on Qt 4.1, is available
- \l{http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip}{online}.)
+ The \l{All Overviews and HOWTOs} page lists all Qt technology overviews and HOWTOs in one please. This includes the overviews mentioned above, but also lists several addtional references (e.g. starting pages of all Qt modules, most of which contain a short introduction to a given module).
- See \l{Books about Qt Programming} for a complete list of Qt books,
- including translations to various languages.
+ You can find Qt documentation either directly integrated into Qt tools as well as \l{Qt Docs Web Start Page}{here}. The advantage of Qt documentation provided in tools is that it is stored on your machine and is available offline. The Qt documentation web site provides access to documentation from different Qt versions as well as the latest snapshot. Qt tools provide search functionality over the index of content as well as free text search. Advanced searches can also be conducted in Qt documentation through the use of search engines. Just limit the search to \c doc.qt.nokia.com and review help topics provided by the search engine you're using to know how to write more advanced search queries.
- Another valuable source of example code and explanations of Qt
- features is the archive of articles from \l{Qt Quarterly}, a quarterly newsletter for users of Qt.
+ The most of the content in Qt documentation is in the documentation of Qt APIs. This includes a lot of code snippets showing how to implement a functionality with Qt APIs. A good example of this is the documentation on the \l{QString} class.
- For documentation on specific Qt modules and other guides, refer to
- \l{All Overviews and HOWTOs}.
+ Make sure to take a look at the following reference documentation since they contain a lot of important details:
+ \list
+ \o \l{Qt Namespace} - contains a log of frequently used static variables
+ \o \l{Global Qt Declarations} - to get an overview of available standard types, macros, and static functions
+ \endlist
- \section1 Further Reading
+ \section1 Get advice and support from the Qt Community
Qt has an active and helpful user community who communicate using
- the \l{Qt Mailing Lists}{qt-interest} mailing list, the \l{Qt Centre}
- Web site, and a number of other community Web sites and Weblogs.
- In addition, many Qt developers are active members of the
- \l{KDE}{KDE community}.
+ the various means:
+
+ \list
+ \o \l{Qt Mailing Lists}{qt-interest} Mailing list
+ \o \l{Qt Centre} Website
+ \o \l{Forums on Qt Developer Network}
+ \o \l{Wiki on Qt Developer Network} written by the Qt community and hosted on the Qt Developer Network
+ \o The \c #qt and \c #qt-creator IRC channels on \c irc.freenode.org
+ \endlist
+
+ In addition, many Qt developers are active members of the \l{KDE}{KDE community}.
+
+ \section1 Books about Qt
+
+ There is a growing number of books about Qt programming. The Qt team maintains a list of books on the Qt Developer Network site. See \l{Books about Qt Programming} for a complete list of Qt books including translations to various languages.
+
+ \section1 Training
+
+ In many cases people prefer attending professional training courses to boost their learning progress. A training course has two unique benefits: Its scope can be adapted to your needs and you will get helped on the spot by Qt trainers who are also experienced Qt developers. \l{Qt Training Partners} offer a wide range of courses. Most courses are based on materials developed by the Qt team.
+
+ There are two types of courses: open enrollment and on-site. \l{Open Enrollment Qt Training Courses}{Open enrollment courses} are public courses open to anybody. They are a good choice for an individual developers or small groups. If you have a large Qt project, on-site training is a better choice and can be more cost efficient. You can request your own agenda for on-site training whereas open enrollment courses have a predefined agenda and scope valid for all attendees.
+
+ \section1 Listen to Qt experts on videos
+
+ A wide range of videos is available on the \l{Qt Video Portal} on the Qt Developer Network. Most of the videos are recordings of talks given by Qt experts at Qt Developer Days. You can use categories and tags to find videos which cover the scope of your needs.
+
+ Another part of the videos are recordings of training sessions recorded at Qt Developer Days:
+ \list
+ \o Qt Essentials, by ICS: (part \l{Qt Essentials by ICS part 1}{1} and \l{Qt Essentials by ICS part 1}{2}) and KDAB: (part \l{Qt Essentials by KDAB part 1}{1} and \l{Qt Essentials by KDAB part 2}{2})
+ \o \c QGraphicsView, \l{QGraphicsView by ICS}{session by ICS} and \l{QGraphicsView by ICS}{session by KDAB}
+ \o Multithreading, \l{Multithreading by ICS}{session by ICS} and \l{Multithreading by KDAB}{session by KDAB}
+ \o UI Development with Qt, \l{UI Development with Qt by ICS}{session by ICS} and \l{UI Development with Qt by KDAB}{session by KDAB}
+ \o Embedded Development, \l{Embedded Development by basysKom}{session by basysKom} and \l{Embedded Development by ICS}{session by ICS}
+ \o Model/View Programming, \l{ModelView Programming by basysKom}{session by basysKom} and \l{ModelView Programming by KDAB}{session by KDAB}
+ \o \c QWebKit, \l{QWebKit by KDAB}{by KDAB}
+ \o Qt Quick, by KDAB: part \l{Quick by KDAB part 1}{1}, \l{Quick by KDAB part 2}{2}, \l{Quick by KDAB part 3}{3}, \l{Quick by KDAB part 4}{4}
+ \o Qt Mobile Development for Nokia Devices, by Digia: part \l{Qt Mobile Development for Nokia Devices by Digia part 1}{1}, \l{Qt Mobile Development for Nokia Devices by Digia part 2}{2}, \l{Qt Mobile Development for Nokia Devices by Digia part 3}{3}
+ \endlist
+
+ Additionally, there are recordings of the Qt Essentials training modules:
+ \list
+ \o Fundamentals of Qt, part \l{Qt Essentials - Fundamentals of Qt part 1}{1} and \l{Qt Essentials - Fundamentals of Qt part 2}{2}
+ \o Application Creation, part \l{Qt Essentials - Application Creation part 1}{1}, \l{Qt Essentials - Application Creation part 2}{2}, \l{Qt Essentials - Application Creation part 3}{3}
+ \o Widgets, part \l{Qt Essentials - Widgets part 1}{1}, \l{Qt Essentials - Widgets part 2}{2}, \l{Qt Essentials - Widgets part 3}{3}
+ \o Graphics View, part \l{Qt Essentials - Graphics View part 1}{1}, \l{Qt Essentials - Graphics View part 2}{2}, \l{Qt Essentials - Graphics View part 3}{3}
+ \o Model/View I, part \l{Qt Essentials - Model/View I part 1}{1}, \l{Qt Essentials - Model/View I part 2}{2}, \l{Qt Essentials - Model/View I part 3}{3}, \l{Qt Essentials - Model/View I part 4}{4}
+ \o Model/View II, , part \l{Qt Essentials - Model/View II part 1}{1}, \l{Qt Essentials - Model/View II part 2}{2}, \l{Qt Essentials - Model/View II part 3}{3}, \l{Qt Essentials - Model/View II part 4}{4}, \l{Qt Essentials - Model/View II part 5}{5}
+ \endlist
+
+ \section1 Prove your knowledge
+
+ \l{Qt Certification} publishes the scope of each exam in Qt Curriculum as "Qt Curriculum Blocks," which are available under \l{Qt Certification Exam Preparation and Prerequisites}{this link}. The Qt Essentials Curriculum Block describes the scope of knowledge which covers all of the fundamental concepts and basic features in Qt. Review this list to find out which areas of Qt you should become familiar with in order to reach a basic level of Qt expertise. If you also have at least 6 months of Qt development experience, consider taking the Qt Essentials exam and becoming a Nokia Certified Qt Developer.
+ \section1 Further Readings and Materials
+
+ A selection of training materials is available to download under \l{Download Qt training materials}{this link} which includes slides (PDF) and source code from the following three courses:
+ \list
+ \o Qt Essentials - Widget Edition
+ \o Qt Essentials - Qt Quick Edition
+ \o Qt Quick for Designers
+ \endlist
+
+ \l{Qt in Education Course Material} is available to download as well. It is more tailored to the needs of educational institutions that use Qt for teaching purposes, but nonetheless provides helpful slides in various formats as well as labs and example code.
+
+ Another valuable source of example code and valuable information about Qt features is the archive of articles from \l{Qt Quarterly}, a quarterly newsletter for users of Qt.
+
+ Good luck and have fun!
- Good luck, and have fun!
*/
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index ef010b43b6..36d63f5832 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -47,7 +47,7 @@ for your platform from the following list.
\tableofcontents
- Qt for X11 has some requirements that are given in more detail
+ Qt for X11 has some requirements that are given in more detail
in the \l{Qt for X11 Requirements} document.
\section1 Step 1: Installing the License File (commercial editions only)
@@ -79,6 +79,8 @@ for your platform from the following list.
\snippet doc/src/snippets/code/doc_src_installation.qdoc 1
Type \c{./configure -help} to get a list of all available options.
+ The \l{Configuration Options for Qt} page gives a brief overview
+ of these.
To create the library and compile all the demos, examples, tools,
and tutorials, type:
@@ -90,7 +92,7 @@ for your platform from the following list.
place. To do this (as root if necessary), type:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 3
-
+
Note that on some systems the make utility is named differently,
e.g. gmake. The configure script tells you which make utility to
use.
@@ -218,7 +220,8 @@ for your platform from the following list.
\snippet doc/src/snippets/code/doc_src_installation.qdoc 8
- Type \c{configure -help} to get a list of all available options.
+ Type \c{configure -help} to get a list of all available options. The
+ \l{Configuration Options for Qt} page gives a brief overview of these.
If you have multiple compilers installed, and want to build the Qt library
using a specific compiler, you must specify a \c qmake specification.
@@ -286,7 +289,7 @@ script to uninstall the binary package. The script is located in /Developer/Tool
must be run as root.
\note Do not run the iPhone simulator while installing Qt. The
-\l{http://openradar.appspot.com/7214991}
+\l{http://openradar.appspot.com/7214991}
{iPhone simulator conflicts with the package installer}.
\section1 Step 1: Install the License File (commercial editions only)
@@ -433,7 +436,9 @@ in the \l{Qt for Windows CE Requirements} document.
If you want to configure Qt for another platform or with other
options, type \c{configure -help} to get a list of all available
- options. See the \c README file for the list of supported platforms.
+ options. The \l{Configuration Options for Qt} page gives a brief
+ overview of these. See the \c README file for the list of supported
+ platforms.
\section1 Step 4: Build Qt Library
@@ -562,17 +567,17 @@ Qt for the Symbian platform has some requirements that are given in more detail
in the \l{Qt for the Symbian platform Requirements} document.
This document describes how to install and configure Qt for
-the Symbian platform from scratch. If you are using pre-built binaries, follow
-the instructions given in the \l{Installing Qt for the Symbian platform from a
+the Symbian platform from scratch. If you are using pre-built binaries, follow
+the instructions given in the \l{Installing Qt for the Symbian platform from a
Binary Package} document.
\section1 Step 1: Set Up the Development Environment
- Make sure your Symbian development environment is correctly installed
+ Make sure your Symbian development environment is correctly installed
and patched as explained in the \l{Qt for the Symbian platform Requirements}
document.
- After you have finished the Symbian development environment setup, it is
+ After you have finished the Symbian development environment setup, it is
good to verify that environment is functional for example by compiling one
of the pure Symbian examples for both emulator and HW. This can be done from
command prompt as follows:
@@ -584,7 +589,7 @@ Binary Package} document.
\section1 Step 2: Install Qt
- Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source
+ Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source
package into the directory you want Qt installed, e.g. \c{C:\Qt\%VERSION%}.
\note Qt must be installed on the same drive as the Symbian SDK you are
@@ -606,8 +611,8 @@ Binary Package} document.
emulator. This is done by locating the Carbide.c++ submenu on the Start
menu, and choosing "Configure environment for WINSCW command line".
- If you are planning to use \c abld (the default build system that comes with
- the S60 SDK) to build Qt, you will also need to set the following
+ If you are planning to use \c abld (the default build system that comes with
+ the S60 SDK) to build Qt, you will also need to set the following
environment variable:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 33
@@ -620,13 +625,17 @@ Binary Package} document.
\snippet doc/src/snippets/code/doc_src_installation.qdoc 23
(to build the tools using MinGW, and the libraries using abld)
-
+
\bold or
\snippet doc/src/snippets/code/doc_src_installation.qdoc 31
(to build the tools using MinGW, and the libraries using SBSv2)
- SBSv2 (also known as \l{http://developer.symbian.org/wiki/index.php/Introduction_to_RAPTOR} {Raptor})
+ Type \c{./configure -help} to get a list of all available options.
+ The \l{Configuration Options for Qt} page gives a brief overview
+ of these.
+
+ SBSv2 (also known as \l{http://developer.symbian.org/wiki/index.php/Introduction_to_RAPTOR} {Raptor})
is a next-generation Symbian build system. SBSv2 is not officially supported
by any of the S60 SDKs currently available from Forum Nokia.
@@ -701,7 +710,7 @@ applications using Qt for Symbian can start right away.
Qt for the Symbian platform has some requirements on the development
platform. The Symbian SDK for Linux as well as a cross compiler for the ARM
-processor used on Symbian devices should be present on the development
+processor used on Symbian devices should be present on the development
machine.
See \l{http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details.
@@ -718,7 +727,7 @@ directory you want Qt installed, e.g. \c{/home/user/qt/%VERSION%}.
In order to build and use Qt, the \c PATH environment variable needs
to be extended to fine Qt tools and also to find the Symbian platform tools:
-First you need to set the \c EPOCROOT environment variable to point to the
+First you need to set the \c EPOCROOT environment variable to point to the
location of your S60 SDK:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 36
@@ -740,6 +749,9 @@ to build the libraries using RVCT or
to build the libraries using GCCE.
+Type \c{./configure -help} to get a list of all available options.
+The \l{Configuration Options for Qt} page gives a brief overview
+of these.
\section1 Step 5: Build Qt
@@ -1014,13 +1026,13 @@ We hope you will enjoy using Qt.
Qt from its source code, you will also need to install the development
packages for these libraries for your system.
- \table 100%
+ \table 100%
\header
\o Name
\o Library
\o Notes
\o Configuration options
- \o Minimum working version
+ \o Minimum working version
\row {id="OptionalColor"}
\o XRender
\o libXrender
@@ -1028,13 +1040,13 @@ We hope you will enjoy using Qt.
\o \tt{-xrender} or auto-detected
\o 0.9.0
\row {id="OptionalColor"}
- \o Xrandr
+ \o Xrandr
\o libXrandr
\o X Resize and Rotate Extension
\o \tt{-xrandr} or auto-detected
\o 1.0.2
\row {id="OptionalColor"}
- \o Xcursor
+ \o Xcursor
\o libXcursor
\o X Cursor Extension
\o \tt{-xcursor} or auto-detected
@@ -1046,7 +1058,7 @@ We hope you will enjoy using Qt.
\o \tt{-xfixes} or auto-detected
\o 3.0.0
\row {id="OptionalColor"}
- \o Xinerama
+ \o Xinerama
\o libXinerama
\o Multi-head support
\o \tt{-xinerama} or auto-detected
@@ -1062,7 +1074,7 @@ We hope you will enjoy using Qt.
\o FreeType
\o libfreetype
\o Font engine
- \o
+ \o
\o 2.1.3
\row {id="DefaultColor"}
@@ -1115,7 +1127,7 @@ We hope you will enjoy using Qt.
\o Multithreading
\o
\o 2.3.5
- \endtable
+ \endtable
\note You must compile with XRender support to get alpha transparency
support for pixmaps and images.
@@ -1199,7 +1211,7 @@ We hope you will enjoy using Qt.
{Windows Mobile 5 Pocket PC}
\o \l{http://www.microsoft.com/downloads/details.aspx?familyid=DC6C00CB-738A-4B97-8910-5CD29AB5F8D9&amp;displaylang=en}
{Windows Mobile 5 Smartphone}
- \o \l{http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&amp;displaylang=en }
+ \o \l{http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&amp;displaylang=en}
{Windows Mobile 6 Professional/Standard}
\endlist
@@ -1223,7 +1235,7 @@ We hope you will enjoy using Qt.
\section3 Requirements
\list
- \o Development environment:
+ \o Development environment:
\list
\o Microsoft Visual Studio 2005 (Standard Edition) or higher
\o ActivePerl
@@ -1368,287 +1380,297 @@ We hope you will enjoy using Qt.
/*!
\page configure-options.html
- \title Configure options for Qt
+ \title Configuration Options for Qt
\ingroup installation
- \brief Brief description of available options building Qt.
-
- This page gives a brief description of the different options
- available when building Qt using configure. To build Qt using
- default options, just call configure from the command line like
- showed below. If you would like to customize your build, please
- use the options listed in the following tables.
-
- \c {.\configure.exe}
-
- \section2 Cross platform options:
-
- \table
- \header \o Option \o Description \o Note
- \row \o \c {-buildkey } <key> \o Build the Qt library and plugins
- using the specified \o
- \row \o \c {<key>} \o When the library loads plugins, it will only
- load those that have a matching <key>. \o
- \row \o \c {-release } \o Compile and link Qt with debugging turned off. \o
- \row \o \c {-debug } \o Compile and link Qt with debugging turned on.
- \o Default value.
- \row \o \c {-debug-and-release} \o Compile and link two Qt libraries,
- with and without debugging turned on. \o This option denotes a default
- value and needs to be evaluated. If the evaluation succeeds, the
- feature is included.
- \row \o \c {-opensource} \o Compile and link the Open-Source Edition
- of Qt. \o
- \row \o \c {-commercial } \o Compile and link the Commercial Edition
- of Qt. \o
- \row \o \c {-developer-build} \o Compile and link Qt with Qt developer
- options including auto-tests exporting) \o
- \row \o \c {-shared} \o Create and use shared Qt libraries. \o Default
- value.
- \row \o \c {-static} \o Create and use static Qt libraries. \o
- \row \o \c {-ltcg} \o Use Link Time Code Generation. \o Apply to release
- builds only.
- \row \o \c {-no-ltcg} \o Do not use Link Time Code Generation. \o Default
- value.
- \row \o \c {-no-fast} \o Configure Qt normally by generating Makefiles for
- all project files. \o Default value.
- \row \o \c {-fast} \o Configure Qt quickly by generating Makefiles only for
- library and subdirectory targets. \o All other Makefiles are created as
- wrappers which will in turn run qmake.
- \row \o \c {-no-exceptions} \o Disable exceptions on platforms that support
- it. \o
- \row \o \c {-exceptions} \o Enable exceptions on platforms that support it.
- \o Default value.
- \row \o \c {-no-accessibility} \o Do not compile Windows Active
- Accessibility support. \o
- \row \o \c {-accessibility} \o Compile Windows Active Accessibility
- support. \o Default value.
- \row \o \c {-no-stl} \o Do not compile STL support. \o
- \row \o \c {-stl} \o Compile STL support. \o Default value.
- \row \o \c {-no-sql-<driver>} \o Disable SQL <driver> entirely, by default
- none are turned on. \o
- \row \o \c {-qt-sql-<driver>} \o Enable a SQL <driver> in the Qt Library.
- \o
- \row \o \c {-plugin-sql-<driver>} \o Enable SQL <driver> as a plugin to be
- linked to at run time. \o Available values for <driver>: mysql, psql,
- oci, odbc, tds, db2, sqlite, sqlite2, ibase. Drivers marked with a
- '+' during configure have been detected as available on this system.
- \row \o \c {-system-sqlite} \o Use sqlite from the operating system. \o
- \row \o \c {-no-qt3support} \o Disables the Qt 3 support functionality. \o
- \row \o \c {-no-opengl} \o Disables OpenGL functionality \o
- \row \o \c {-opengl <api>} \o Enable OpenGL support with specified API
- version. \o Available values for <api>: desktop - Enable support for
- Desktop OpenGL (Default), es1 - Enable support for OpenGL ES Common
- Profile, es2 - Enable support for OpenGL ES 2.0.
- \row \o \c {-no-openvg} \o Disables OpenVG functionality \o Default value.
- \row \o \c {-openvg} \o Enables OpenVG functionality \o Requires EGL
- support, typically supplied by an OpenGL or other graphics
- implementation.
- \row \o \c {-platform <spec> } \o The operating system and compiler you
- are building on. \o The default value is %QMAKESPEC%.
- \row \o \c {-xplatform <spec> } \o The operating system and compiler you
- are cross compiling for. \o See the README file for a list of supported
- operating systems and compilers.
- \row \o \c {-qtnamespace <namespace>} \o Wraps all Qt library code in
- 'namespace name {..} \o
- \row \o \c {-qtlibinfix <infix>} \o Renames all Qt* libs to Qt*<infix>
- \o
- \row \o \c {-D <define>} \o Add an explicit define to the preprocessor.
- \o
- \row \o \c {-I <includepath>} \o Add an explicit include path. \o
- \row \o \c {-L <librarypath>} \o Add an explicit library path. \o
- \row \o \c {-l <libraryname>} \o Add an explicit library name, residing
- in a librarypath. \o
- \row \o \c {-graphicssystem <sys>} \o Specify which graphics system should
- be used. \o Available values for <sys>: * raster - Software rasterizer,
- opengl - Using OpenGL acceleration, experimental!, openvg - Using
- OpenVG acceleration, experimental!
- \row \o \c {-help, -h, -?} \o Display this information. \o
- \endtable
-
- \section2 Third Party Libraries:
- \table
- \header \o Option \o Description \o Note
- \row \o \c {-qt-zlib} \o Use the zlib bundled with Qt. \o
- \row \o \c {-system-zlib} \o Use zlib from the operating system.
- \o See http://www.gzip.org/zlib
- \row \o \c {-no-gif} \o Do not compile GIF reading support.
- \o This option denotes a default value and needs to be evaluated.
- If the evaluation succeeds, the feature is included.
- \row \o \c {-qt-gif} \o Compile GIF reading support. \o See also
- src/gui/image/qgifhandler_p.h
- \row \o \c {-no-libpng} \o Do not compile PNG support. \o
- \row \o \c {-qt-libpng} \o Use the libpng bundled with Qt.
- \o This option denotes a default value and needs to be evaluated.
- If the evaluation succeeds, the feature is included.
- \row \o \c {-system-libpng} \o Use libpng from the operating system.
- \o See http://www.libpng.org/pub/png
- \row \o \c {-no-libmng} \o Do not compile MNG support. \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-qt-libmng} \o Use the libmng bundled with Qt. \o
- \row \o \c {-system-libmng} \o Use libmng from the operating system.
- \o See http://www.libmng.com
- \row \o \c {-no-libtiff} \o Do not compile TIFF support. \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-qt-libtiff} \o Use the libtiff bundled with Qt. \o
- \row \o \c {-system-libtiff} \o Use libtiff from the operating system.
- \o See http://www.libtiff.org
- \row \o \c {-no-libjpeg} \o Do not compile JPEG support. \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-qt-libjpeg} \o Use the libjpeg bundled with Qt. \o
- \row \o \c {-system-libjpeg} \o Use libjpeg from the operating system.
- \o See http://www.ijg.org. This option denotes a default value and
- needs to be evaluated. If the evaluation succeeds, the feature is
- included.
- \endtable
-
- \section2 Qt for Windows only:
- \table
- \header \o Option \o Description \o Note
- \row \o \c {-no-dsp} \o Do not generate VC++ .dsp files. \o
- \row \o \c {-dsp} \o Generate VC++ .dsp files, only if spec "win32-msvc".
- \o Default value.
- \row \o \c {-no-vcproj} \o Do not generate VC++ .vcproj files. \o
- \row \o \c {-vcproj} \o Generate VC++ .vcproj files, only if platform
- "win32-msvc.net". \o Default value.
- \row \o \c {-no-incredibuild-xge} \o Do not add IncrediBuild XGE distribution
- commands to custom build steps. \o
- \row \o \c {-incredibuild-xge} \o Add IncrediBuild XGE distribution commands
- to custom build steps. This will distribute MOC and UIC steps, and other
- custom buildsteps which are added to the INCREDIBUILD_XGE variable.
- \o The IncrediBuild distribution commands are only added to Visual Studio
- projects. This option denotes a default value and needs to be evaluated.
- If the evaluation succeeds, the feature is included.
- \row \o \c {-no-plugin-manifests} \o Do not embed manifests in plugins. \o
- \row \o \c {-plugin-manifests} \o Embed manifests in plugins.
- \o Default value.
- \row \o \c {-no-qmake} \o Do not compile qmake. \o
- \row \o \c {-qmake} \o Compile qmake. \o Default value
- \row \o \c {-dont-process} \o Do not generate Makefiles/Project files. This
- will override -no-fast if specified. \o
- \row \o \c {-process} \o Generate Makefiles/Project files. \o Default value.
- \row \o \c {-no-rtti} \o Do not compile runtime type information. \o
- \row \o \c {-rtti} \o Compile runtime type information. \o Default value.
- \row \o \c {-no-mmx} \o Do not compile with use of MMX instructions \o
- \row \o \c {-mmx} \o Compile with use of MMX instructions \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-no-3dnow} \o Do not compile with use of 3DNOW instructions \o
- \row \o \c {-3dnow} \o Compile with use of 3DNOW instructions \o This
- option denotes a default value and needs to be evaluated. If the
- evaluation succeeds, the feature is included.
- \row \o \c {-no-sse} \o Do not compile with use of SSE instructions \o
- \row \o \c {-sse} \o Compile with use of SSE instructions \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-no-sse2} \o Do not compile with use of SSE2 instructions \o
- \row \o \c {-sse2} \o Compile with use of SSE2 instructions \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-no-openssl} \o Do not compile in OpenSSL support \o
- \row \o \c {-openssl} \o Compile in run-time OpenSSL support \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-openssl-linked} \o Compile in linked OpenSSL support \o
- \row \o \c {-no-dbus} \o Do not compile in D-Bus support \o
- \row \o \c {-dbus} \o Compile in D-Bus support and load libdbus-1 dynamically.
- \o This option denotes a default value and needs to be evaluated.
- If the evaluation succeeds, the feature is included.
- \row \o \c {-dbus-linked} \o Compile in D-Bus support and link to
- libdbus-1 \o
- \row \o \c {-no-phonon} \o Do not compile in the Phonon module \o
- \row \o \c {-phonon} \o Compile the Phonon module. \o Phonon is built if a
- decent C++ compiler is used. This option denotes a default value and needs
- to be evaluated. If the evaluation succeeds, the feature is included.
- \row \o \c {-no-phonon-backend} \o Do not compile the platform-specific
- Phonon backend-plugin \o
- \row \o \c {-phonon-backend} \o Compile in the platform-specific Phonon
- backend-plugin \o Default value.
- \row \o \c {-no-multimedia} \o Do not compile the multimedia module \o
- \row \o \c {-multimedia} \o Compile in multimedia module \o Default value.
- \row \o \c {-no-audio-backend} \o Do not compile in the platform audio
- backend into QtMultimedia \o
- \row \o \c {-audio-backend} \o Compile in the platform audio backend into
- QtMultimedia \o This option denotes a default value and needs to be
- evaluated. If the evaluation succeeds, the feature is included.
- \row \o \c {-no-webkit} \o Do not compile in the WebKit module \o
- \row \o \c {-webkit} \o Compile in the WebKit module \o WebKit is built
- if a decent C++ compiler is used. This option denotes a default value
- and needs to be evaluated. If the evaluation succeeds, the feature is
- included.
- \row \o \c {-webkit-debug} \o Compile in the WebKit module with debug
- symbols. \o
- \row \o \c {-no-script} \o Do not build the QtScript module. \o
- \row \o \c {-script} \o Build the QtScript module. \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-no-scripttools} \o Do not build the QtScriptTools module. \o
- \row \o \c {-scripttools} \o Build the QtScriptTools module. \o This
- option denotes a default value and needs to be evaluated. If the
- evaluation succeeds, the feature is included.
- \row \o \c {-no-declarative} \o Do not build the declarative module \o
- \row \o \c {-declarative} \o Build the declarative module \o This option
- denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-no-declarative-debug} \o Do not build the declarative debugging
- support \o
- \row \o \c {-declarative-debug} \o Build the declarative debugging support
- \o Default value.
- \row \o \c {-arch <arch>} \o Specify an architecture. \o Available values for
- <arch>: * windows, windowsce, symbian, boundschecker, generic.
- \row \o \c {-no-style-<style>} \o Disable <style> entirely. \o
- \row \o \c {-qt-style-<style>} \o Enable <style> in the Qt Library.
- \o Available styles: * windows, + windowsxp, + windowsvista,
- * plastique, * cleanlooks, * motif, * cde, windowsce, windowsmobile,
- s60
- \row \o \c {-no-native-gestures} \o Do not use native gestures on Windows 7.
- \o
- \row \o \c {-native-gestures} \o Use native gestures on Windows 7.
- \o Default value.
- \row \o \c {-no-mp} \o Do not use multiple processors for compiling with MSVC
- \o Default value.
- \row \o \c {-mp} \o Use multiple processors for compiling with MSVC (-MP) \o
- \row \o \c {-loadconfig <config>} \o Run configure with the parameters from file
- configure_<config>.cache. \o
- \row \o \c {-saveconfig <config>} \o Run configure and save the parameters in
- file configure_<config>.cache. \o
- \row \o \c {-redo} \o Run configure with the same parameters as last time. \o
-\endtable
-
-\section2 Qt for Windows CE only:
- \table
- \header \o Option \o Description \o Note
- \row \o \c {-no-iwmmxt} \o Do not compile with use of IWMMXT instructions \o
- \row \o \c {-iwmmxt} \o Do compile with use of IWMMXT instructions. \o This is
- for Qt for Windows CE on Arm only. This option denotes a default value and
- needs to be evaluated. If the evaluation succeeds, the feature is included.
- \row \o \c {-no-crt} \o Do not add the C runtime to default deployment rules.
- \o Default value.
- \row \o \c {-qt-crt} \o Qt identifies C runtime during project generation \o
- \row \o \c {-crt <path>} \o Specify path to C runtime used for project
- generation. \o
- \row \o \c {-no-cetest} \o Do not compile Windows CE remote test application \o
- \row \o \c {-cetest} \o Compile Windows CE remote test application \o This
- option denotes a default value and needs to be evaluated. If the evaluation
- succeeds, the feature is included.
- \row \o \c {-signature <file>} \o Use file for signing the target project \o
- \row \o \c {-phonon-wince-ds9} \o Enable Phonon Direct Show 9 backend for
- Windows CE \o Default value
- \endtable
-
- \section2 Qt for Symbian OS only:
- \table
- \header \o Option \o Description \o Note
- \row \o \c {-no-freetype} \o Do not compile in Freetype2 support.
- \o Default value.
- \row \o \c {-qt-freetype} \o Use the libfreetype bundled with Qt. \o
- \row \o \c {-fpu <flags>} \o VFP type on ARM, supported options:
- softvfp(default) |vfpv2 | softvfp+vfpv2 \o
- \row \o \c {-no-s60} \o Do not compile in S60 support. \o
- \row \o \c {-s60} \o Compile with support for the S60 UI Framework
- \o Default value.
- \row \o \c {-no-usedeffiles} \o Disable the usage of DEF files. \o
- \row \o \c {-usedeffiles} \o Enable the usage of DEF files. \o
- \endtable
+ \brief Brief description of available options for building Qt.
+
+ This page gives a brief description of the different options available when
+ building Qt using the \c configure script or \c configure.exe binary.
+ To build Qt using the default options, just call configure from the command
+ line as shown below.
+
+ When building on Linux, Mac OS X and Unix platforms:
+
+ \c{./configure}
+
+ On Windows, run the corresponding executable:
+
+ \c{.\configure.exe}
+
+ If you would like to customize your build, please use the options listed in
+ the following tables. To see the full list of options, invoke the configure
+ tool with the \c -help command line option.
+
+ \section2 Cross platform options:
+
+ \table
+ \header \o Option \o Description \o Note
+ \row \o \c {-buildkey} <key> \o Build the Qt library and plugins
+ using the specified \o
+ \row \o \c {<key>} \o When the library loads plugins, it will only
+ load those that have a matching <key>. \o
+ \row \o \c {-release} \o Compile and link Qt with debugging turned off. \o
+ \row \o \c {-debug} \o Compile and link Qt with debugging turned on.
+ \o Default value.
+ \row \o \c {-debug-and-release} \o Compile and link two Qt libraries,
+ with and without debugging turned on. \o This option denotes a default
+ value and needs to be evaluated. If the evaluation succeeds, the
+ feature is included.
+ \row \o \c {-opensource} \o Compile and link the Open-Source Edition
+ of Qt. \o
+ \row \o \c {-commercial} \o Compile and link the Commercial Edition
+ of Qt. \o
+ \row \o \c {-developer-build} \o Compile and link Qt with Qt developer
+ options including auto-tests exporting) \o
+ \row \o \c {-shared} \o Create and use shared Qt libraries. \o Default
+ value.
+ \row \o \c {-static} \o Create and use static Qt libraries. \o
+ \row \o \c {-ltcg} \o Use Link Time Code Generation. \o Apply to release
+ builds only.
+ \row \o \c {-no-ltcg} \o Do not use Link Time Code Generation. \o Default
+ value.
+ \row \o \c {-no-fast} \o Configure Qt normally by generating Makefiles for
+ all project files. \o Default value.
+ \row \o \c {-fast} \o Configure Qt quickly by generating Makefiles only for
+ library and subdirectory targets. \o All other Makefiles are created as
+ wrappers which will in turn run qmake.
+ \row \o \c {-no-exceptions} \o Disable exceptions on platforms that support
+ it. \o
+ \row \o \c {-exceptions} \o Enable exceptions on platforms that support it.
+ \o Default value.
+ \row \o \c {-no-accessibility} \o Do not compile Windows Active
+ Accessibility support. \o
+ \row \o \c {-accessibility} \o Compile Windows Active Accessibility
+ support. \o Default value.
+ \row \o \c {-no-stl} \o Do not compile STL support. \o
+ \row \o \c {-stl} \o Compile STL support. \o Default value.
+ \row \o \c {-no-sql-<driver>} \o Disable SQL <driver> entirely, by default
+ none are turned on. \o
+ \row \o \c {-qt-sql-<driver>} \o Enable a SQL <driver> in the Qt Library.
+ \o
+ \row \o \c {-plugin-sql-<driver>} \o Enable SQL <driver> as a plugin to be
+ linked to at run time. \o Available values for <driver>: mysql, psql,
+ oci, odbc, tds, db2, sqlite, sqlite2, ibase. Drivers marked with a
+ '+' during configure have been detected as available on this system.
+ \row \o \c {-system-sqlite} \o Use sqlite from the operating system. \o
+ \row \o \c {-no-qt3support} \o Disables the Qt 3 support functionality. \o
+ \row \o \c {-no-opengl} \o Disables OpenGL functionality \o
+ \row \o \c {-opengl <api>} \o Enable OpenGL support with specified API
+ version. \o Available values for <api>: desktop - Enable support for
+ Desktop OpenGL (Default), es1 - Enable support for OpenGL ES Common
+ Profile, es2 - Enable support for OpenGL ES 2.0.
+ \row \o \c {-no-openvg} \o Disables OpenVG functionality \o Default value.
+ \row \o \c {-openvg} \o Enables OpenVG functionality \o Requires EGL
+ support, typically supplied by an OpenGL or other graphics
+ implementation.
+ \row \o \c {-platform <spec>} \o The operating system and compiler you
+ are building on. \o The default value is %QMAKESPEC%.
+ \row \o \c {-xplatform <spec>} \o The operating system and compiler you
+ are cross compiling for. \o See the README file for a list of supported
+ operating systems and compilers.
+ \row \o \c {-qtnamespace <namespace>} \o Wraps all Qt library code in
+ 'namespace name {..} \o
+ \row \o \c {-qtlibinfix <infix>} \o Renames all Qt* libs to Qt*<infix>
+ \o
+ \row \o \c {-D <define>} \o Add an explicit define to the preprocessor.
+ \o
+ \row \o \c {-I <includepath>} \o Add an explicit include path. \o
+ \row \o \c {-L <librarypath>} \o Add an explicit library path. \o
+ \row \o \c {-l <libraryname>} \o Add an explicit library name, residing
+ in a librarypath. \o
+ \row \o \c {-graphicssystem <sys>} \o Specify which graphics system should
+ be used. \o Available values for <sys>: * raster - Software rasterizer,
+ opengl - Using OpenGL acceleration, experimental!, openvg - Using
+ OpenVG acceleration, experimental!
+ \row \o \c {-help, -h, -?} \o Display this information. \o
+ \endtable
+
+ \section2 Third Party Libraries
+
+ \table
+ \header \o Option \o Description \o Note
+ \row \o \c {-qt-zlib} \o Use the zlib bundled with Qt. \o
+ \row \o \c {-system-zlib} \o Use zlib from the operating system.
+ \o See http://www.gzip.org/zlib
+ \row \o \c {-no-gif} \o Do not compile GIF reading support.
+ \o This option denotes a default value and needs to be evaluated.
+ If the evaluation succeeds, the feature is included.
+ \row \o \c {-qt-gif} \o Compile GIF reading support. \o See also
+ src/gui/image/qgifhandler_p.h
+ \row \o \c {-no-libpng} \o Do not compile PNG support. \o
+ \row \o \c {-qt-libpng} \o Use the libpng bundled with Qt.
+ \o This option denotes a default value and needs to be evaluated.
+ If the evaluation succeeds, the feature is included.
+ \row \o \c {-system-libpng} \o Use libpng from the operating system.
+ \o See http://www.libpng.org/pub/png
+ \row \o \c {-no-libmng} \o Do not compile MNG support. \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-qt-libmng} \o Use the libmng bundled with Qt. \o
+ \row \o \c {-system-libmng} \o Use libmng from the operating system.
+ \o See http://www.libmng.com
+ \row \o \c {-no-libtiff} \o Do not compile TIFF support. \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-qt-libtiff} \o Use the libtiff bundled with Qt. \o
+ \row \o \c {-system-libtiff} \o Use libtiff from the operating system.
+ \o See http://www.libtiff.org
+ \row \o \c {-no-libjpeg} \o Do not compile JPEG support. \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-qt-libjpeg} \o Use the libjpeg bundled with Qt. \o
+ \row \o \c {-system-libjpeg} \o Use libjpeg from the operating system.
+ \o See http://www.ijg.org. This option denotes a default value and
+ needs to be evaluated. If the evaluation succeeds, the feature is
+ included.
+ \endtable
+
+ \section2 Qt for Windows only:
+ \table
+ \header \o Option \o Description \o Note
+ \row \o \c {-no-dsp} \o Do not generate VC++ .dsp files. \o
+ \row \o \c {-dsp} \o Generate VC++ .dsp files, only if spec "win32-msvc".
+ \o Default value.
+ \row \o \c {-no-vcproj} \o Do not generate VC++ .vcproj files. \o
+ \row \o \c {-vcproj} \o Generate VC++ .vcproj files, only if platform
+ "win32-msvc.net". \o Default value.
+ \row \o \c {-no-incredibuild-xge} \o Do not add IncrediBuild XGE distribution
+ commands to custom build steps. \o
+ \row \o \c {-incredibuild-xge} \o Add IncrediBuild XGE distribution commands
+ to custom build steps. This will distribute MOC and UIC steps, and other
+ custom buildsteps which are added to the INCREDIBUILD_XGE variable.
+ \o The IncrediBuild distribution commands are only added to Visual Studio
+ projects. This option denotes a default value and needs to be evaluated.
+ If the evaluation succeeds, the feature is included.
+ \row \o \c {-no-plugin-manifests} \o Do not embed manifests in plugins. \o
+ \row \o \c {-plugin-manifests} \o Embed manifests in plugins.
+ \o Default value.
+ \row \o \c {-no-qmake} \o Do not compile qmake. \o
+ \row \o \c {-qmake} \o Compile qmake. \o Default value
+ \row \o \c {-dont-process} \o Do not generate Makefiles/Project files. This
+ will override -no-fast if specified. \o
+ \row \o \c {-process} \o Generate Makefiles/Project files. \o Default value.
+ \row \o \c {-no-rtti} \o Do not compile runtime type information. \o
+ \row \o \c {-rtti} \o Compile runtime type information. \o Default value.
+ \row \o \c {-no-mmx} \o Do not compile with use of MMX instructions \o
+ \row \o \c {-mmx} \o Compile with use of MMX instructions \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-no-3dnow} \o Do not compile with use of 3DNOW instructions \o
+ \row \o \c {-3dnow} \o Compile with use of 3DNOW instructions \o This
+ option denotes a default value and needs to be evaluated. If the
+ evaluation succeeds, the feature is included.
+ \row \o \c {-no-sse} \o Do not compile with use of SSE instructions \o
+ \row \o \c {-sse} \o Compile with use of SSE instructions \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-no-sse2} \o Do not compile with use of SSE2 instructions \o
+ \row \o \c {-sse2} \o Compile with use of SSE2 instructions \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-no-openssl} \o Do not compile in OpenSSL support \o
+ \row \o \c {-openssl} \o Compile in run-time OpenSSL support \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-openssl-linked} \o Compile in linked OpenSSL support \o
+ \row \o \c {-no-dbus} \o Do not compile in D-Bus support \o
+ \row \o \c {-dbus} \o Compile in D-Bus support and load libdbus-1 dynamically.
+ \o This option denotes a default value and needs to be evaluated.
+ If the evaluation succeeds, the feature is included.
+ \row \o \c {-dbus-linked} \o Compile in D-Bus support and link to
+ libdbus-1 \o
+ \row \o \c {-no-phonon} \o Do not compile in the Phonon module \o
+ \row \o \c {-phonon} \o Compile the Phonon module. \o Phonon is built if a
+ decent C++ compiler is used. This option denotes a default value and needs
+ to be evaluated. If the evaluation succeeds, the feature is included.
+ \row \o \c {-no-phonon-backend} \o Do not compile the platform-specific
+ Phonon backend-plugin \o
+ \row \o \c {-phonon-backend} \o Compile in the platform-specific Phonon
+ backend-plugin \o Default value.
+ \row \o \c {-no-multimedia} \o Do not compile the multimedia module \o
+ \row \o \c {-multimedia} \o Compile in multimedia module \o Default value.
+ \row \o \c {-no-audio-backend} \o Do not compile in the platform audio
+ backend into QtMultimedia \o
+ \row \o \c {-audio-backend} \o Compile in the platform audio backend into
+ QtMultimedia \o This option denotes a default value and needs to be
+ evaluated. If the evaluation succeeds, the feature is included.
+ \row \o \c {-no-webkit} \o Do not compile in the WebKit module \o
+ \row \o \c {-webkit} \o Compile in the WebKit module \o WebKit is built
+ if a decent C++ compiler is used. This option denotes a default value
+ and needs to be evaluated. If the evaluation succeeds, the feature is
+ included.
+ \row \o \c {-webkit-debug} \o Compile in the WebKit module with debug
+ symbols. \o
+ \row \o \c {-no-script} \o Do not build the QtScript module. \o
+ \row \o \c {-script} \o Build the QtScript module. \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-no-scripttools} \o Do not build the QtScriptTools module. \o
+ \row \o \c {-scripttools} \o Build the QtScriptTools module. \o This
+ option denotes a default value and needs to be evaluated. If the
+ evaluation succeeds, the feature is included.
+ \row \o \c {-no-declarative} \o Do not build the declarative module \o
+ \row \o \c {-declarative} \o Build the declarative module \o This option
+ denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-no-declarative-debug} \o Do not build the declarative debugging
+ support \o
+ \row \o \c {-declarative-debug} \o Build the declarative debugging support
+ \o Default value.
+ \row \o \c {-arch <arch>} \o Specify an architecture. \o Available values for
+ <arch>: * windows, windowsce, symbian, boundschecker, generic.
+ \row \o \c {-no-style-<style>} \o Disable <style> entirely. \o
+ \row \o \c {-qt-style-<style>} \o Enable <style> in the Qt Library.
+ \o Available styles: * windows, + windowsxp, + windowsvista,
+ * plastique, * cleanlooks, * motif, * cde, windowsce, windowsmobile,
+ s60
+ \row \o \c {-no-native-gestures} \o Do not use native gestures on Windows 7.
+ \o
+ \row \o \c {-native-gestures} \o Use native gestures on Windows 7.
+ \o Default value.
+ \row \o \c {-no-mp} \o Do not use multiple processors for compiling with MSVC
+ \o Default value.
+ \row \o \c {-mp} \o Use multiple processors for compiling with MSVC (-MP) \o
+ \row \o \c {-loadconfig <config>} \o Run configure with the parameters from file
+ configure_<config>.cache. \o
+ \row \o \c {-saveconfig <config>} \o Run configure and save the parameters in
+ file configure_<config>.cache. \o
+ \row \o \c {-redo} \o Run configure with the same parameters as last time. \o
+ \endtable
+
+ \section2 Qt for Windows CE only:
+ \table
+ \header \o Option \o Description \o Note
+ \row \o \c {-no-iwmmxt} \o Do not compile with use of IWMMXT instructions \o
+ \row \o \c {-iwmmxt} \o Do compile with use of IWMMXT instructions. \o This is
+ for Qt for Windows CE on Arm only. This option denotes a default value and
+ needs to be evaluated. If the evaluation succeeds, the feature is included.
+ \row \o \c {-no-crt} \o Do not add the C runtime to default deployment rules.
+ \o Default value.
+ \row \o \c {-qt-crt} \o Qt identifies C runtime during project generation \o
+ \row \o \c {-crt <path>} \o Specify path to C runtime used for project
+ generation. \o
+ \row \o \c {-no-cetest} \o Do not compile Windows CE remote test application \o
+ \row \o \c {-cetest} \o Compile Windows CE remote test application \o This
+ option denotes a default value and needs to be evaluated. If the evaluation
+ succeeds, the feature is included.
+ \row \o \c {-signature <file>} \o Use file for signing the target project \o
+ \row \o \c {-phonon-wince-ds9} \o Enable Phonon Direct Show 9 backend for
+ Windows CE \o Default value
+ \endtable
+
+ \section2 Qt for Symbian OS only:
+ \table
+ \header \o Option \o Description \o Note
+ \row \o \c {-no-freetype} \o Do not compile in Freetype2 support.
+ \o Default value.
+ \row \o \c {-qt-freetype} \o Use the libfreetype bundled with Qt. \o
+ \row \o \c {-fpu <flags>} \o VFP type on ARM, supported options:
+ softvfp(default) |vfpv2 | softvfp+vfpv2 \o
+ \row \o \c {-no-s60} \o Do not compile in S60 support. \o
+ \row \o \c {-s60} \o Compile with support for the S60 UI Framework
+ \o Default value.
+ \row \o \c {-no-usedeffiles} \o Disable the usage of DEF files. \o
+ \row \o \c {-usedeffiles} \o Enable the usage of DEF files. \o
+ \endtable
*/
diff --git a/doc/src/images/appicon_packagecontents.png b/doc/src/images/appicon_packagecontents.png
new file mode 100644
index 0000000000..49cb1e4229
--- /dev/null
+++ b/doc/src/images/appicon_packagecontents.png
Binary files differ
diff --git a/doc/src/images/appicon_screenshot.png b/doc/src/images/appicon_screenshot.png
new file mode 100644
index 0000000000..c29dd11d46
--- /dev/null
+++ b/doc/src/images/appicon_screenshot.png
Binary files differ
diff --git a/doc/src/images/cube.png b/doc/src/images/cube.png
new file mode 100644
index 0000000000..95dfc984dd
--- /dev/null
+++ b/doc/src/images/cube.png
Binary files differ
diff --git a/doc/src/images/cube_faces.png b/doc/src/images/cube_faces.png
new file mode 100644
index 0000000000..2c7102a94c
--- /dev/null
+++ b/doc/src/images/cube_faces.png
Binary files differ
diff --git a/doc/src/images/elidedlabel-example.png b/doc/src/images/elidedlabel-example.png
new file mode 100644
index 0000000000..741d2896e7
--- /dev/null
+++ b/doc/src/images/elidedlabel-example.png
Binary files differ
diff --git a/doc/src/images/glhypnotizer-demo.png b/doc/src/images/glhypnotizer-demo.png
new file mode 100644
index 0000000000..5b7a1aec49
--- /dev/null
+++ b/doc/src/images/glhypnotizer-demo.png
Binary files differ
diff --git a/doc/src/images/maemovibration-example.png b/doc/src/images/maemovibration-example.png
new file mode 100644
index 0000000000..be975fc10a
--- /dev/null
+++ b/doc/src/images/maemovibration-example.png
Binary files differ
diff --git a/doc/src/images/orientation-landscape-ui.png b/doc/src/images/orientation-landscape-ui.png
new file mode 100644
index 0000000000..c591ff14d2
--- /dev/null
+++ b/doc/src/images/orientation-landscape-ui.png
Binary files differ
diff --git a/doc/src/images/orientation-landscape.png b/doc/src/images/orientation-landscape.png
new file mode 100644
index 0000000000..e606804d21
--- /dev/null
+++ b/doc/src/images/orientation-landscape.png
Binary files differ
diff --git a/doc/src/images/orientation-portrait-ui.png b/doc/src/images/orientation-portrait-ui.png
new file mode 100644
index 0000000000..304835b93e
--- /dev/null
+++ b/doc/src/images/orientation-portrait-ui.png
Binary files differ
diff --git a/doc/src/images/orientation-portrait.png b/doc/src/images/orientation-portrait.png
new file mode 100644
index 0000000000..3d778e8d90
--- /dev/null
+++ b/doc/src/images/orientation-portrait.png
Binary files differ
diff --git a/doc/src/images/qml-listview-snippet.png b/doc/src/images/qml-listview-snippet.png
new file mode 100644
index 0000000000..0ee0ffcd0e
--- /dev/null
+++ b/doc/src/images/qml-listview-snippet.png
Binary files differ
diff --git a/doc/src/images/symbianvibration-example.png b/doc/src/images/symbianvibration-example.png
new file mode 100644
index 0000000000..21461b6a19
--- /dev/null
+++ b/doc/src/images/symbianvibration-example.png
Binary files differ
diff --git a/doc/src/images/webkit-webftpclient.png b/doc/src/images/webkit-webftpclient.png
new file mode 100644
index 0000000000..8aa7a12de9
--- /dev/null
+++ b/doc/src/images/webkit-webftpclient.png
Binary files differ
diff --git a/doc/src/images/webkit-webplugin.png b/doc/src/images/webkit-webplugin.png
new file mode 100644
index 0000000000..1594163de3
--- /dev/null
+++ b/doc/src/images/webkit-webplugin.png
Binary files differ
diff --git a/doc/src/platforms/emb-install.qdoc b/doc/src/platforms/emb-install.qdoc
index eb12cd480c..e5dc6f873a 100644
--- a/doc/src/platforms/emb-install.qdoc
+++ b/doc/src/platforms/emb-install.qdoc
@@ -74,6 +74,9 @@
\snippet doc/src/snippets/code/doc_src_emb-install.qdoc embedded help
+ The \l{Configuration Options for Qt} page gives a brief overview
+ of these.
+
Note that by default, \l{Qt for Embedded Linux} is configured for
installation in the \c{/usr/local/Trolltech/QtEmbedded-%VERSION%}
directory, but this can be changed by using the \c{-prefix}
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index 2a5d5b16bb..9b1eea2bdb 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -55,7 +55,7 @@
\endlist
\o
\list
- \o \l {Deploying an Application on the Symbian platform}{Deploying Applications}
+ \o \l {Deploying an Application on the Symbian Platform}{Deploying Applications}
\endlist
\endtable
*/
@@ -152,9 +152,9 @@
when application \c .sis needs to be separately signed before
including it into smart installer \c .sis.
\row \o \c unsigned_installer_sis \o Create unsigned \l{Smart Installer}{smart installer}
- \c .sis file for project.
- Note: The application \c .sis contained in smart installer
- \c .sis will also be unsigned.
+ \c .sis file for project.
+ Note: The application \c .sis contained in smart installer
+ \c .sis will also be unsigned.
\row \o \c stub_sis \o Create a stub sis to allow upgradability of projects
that are deployed in ROM
\endtable
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index 742de7324b..7f456b90d2 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -65,6 +65,10 @@
\title Visual Studio Integration
*/
/*!
+ \externalpage http://qt.nokia.com/products/developer-tools
+ \title Qt Creator Product Page
+*/
+/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Widgets/qtcalendarwidget/
\title Calendar Widget
*/
@@ -141,7 +145,7 @@
\title Task Tracker
*/
/*!
- \externalpage http://lists.trolltech.com
+ \externalpage http://lists.qt.nokia.com/
\title Qt Mailing Lists
*/
/*!
@@ -200,7 +204,10 @@
\externalpage http://labs.qt.nokia.com
\title Qt Labs
*/
-
+/*!
+ \externalpage http://doc.qt.nokia.com/
+ \title Qt Docs Web Start Page
+*/
/*!
\externalpage http://doc.qt.nokia.com/qtcreator/creator-qml-application.html
\title external: Developing Qt Quick Applications with Creator
@@ -210,6 +217,14 @@
\title Qt Coding Style
*/
/*!
+ \externalpage http://developer.qt.nokia.com/forums
+ \title Forums on Qt Developer Network
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/wikis
+ \title Wiki on Qt Developer Network
+*/
+/*!
\externalpage http://developer.qt.nokia.com/wiki/QtCreatorWhitepaper
\title Qt Creator Whitepaper
*/
@@ -250,6 +265,10 @@
\title external: Qt Simulator Manual
*/
/*!
+ \externalpage http://qt.nokia.com/products/qt-sdk
+ \title Qt SDK Product Page
+*/
+/*!
\externalpage http://doc.qt.nokia.com/nokia-qtsdk-latest/index.html
\title external: Qt SDK Manual
*/
@@ -298,6 +317,14 @@
\title external: Mobility Location
*/
/*!
+ \externalpage http://qt.nokia.com/partners/training/
+ \title Qt Training Partners
+*/
+/*!
+ \externalpage http://qt.nokia.com/partners/training/course-schedule
+ \title Open Enrollment Qt Training Courses
+*/
+/*!
\externalpage http://qt.nokia.com/developer/learning/online/training/training-day-at-developer-days-2009/
\title Training Day at Qt Developer Days 2009
*/
@@ -306,6 +333,10 @@
\title external: Qt Mobility Examples
*/
/*!
+ \externalpage http://developer.qt.nokia.com/elearning
+ \title Qt Video Portal
+*/
+/*!
\externalpage http://qt.nokia.com/developer/learning/online/training
\title Qt eLearning
*/
@@ -317,4 +348,194 @@
\externalpage http://qt.nokia.com/developer/learning/online/talks/developerdays2010
\title Qt Developer Days 2010
*/
+/*!
+ \externalpage http://developer.qt.nokia.com/wiki/Category:LanguageBindings
+ \title Qt Language Bindings on Wiki
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_programming_essentials_by_ics_part_1
+ \title Qt Essentials by ICS part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_programming_essentials_by_ics_part_2
+ \title Qt Essentials by ICS part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_programming_essentials_by_kdab_part_1
+ \title Qt Essentials by KDAB part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_programming_essentials_by_kdab_part_2
+ \title Qt Essentials by KDAB part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_qgraphicsview_by_ics
+ \title QGraphicsView by ICS
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_qgraphicsview_by_kdab
+ \title QGraphicsView by KDAB
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_multithreading_by_ics
+ \title Multithreading by ICS
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_multithreading_by_kdab
+ \title Multithreading by KDAB
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/training_teaser_ui_development_with_qt_by_ics
+ \title UI Development with Qt by ICS
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/training_teaser_ui_development_with_qt_by_kdab
+ \title UI Development with Qt by KDAB
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/training_teaser_embedded_development_by_basyskom
+ \title Embedded Development by basysKom
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/training_teaser_embedded_development_by_ics
+ \title Embedded Development by ICS
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_model_view_programming_by_basyskom
+ \title ModelView Programming by basysKom
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_model_view_programming_by_kdab
+ \title ModelView Programming by KDAB
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/programming_with_qt_webkit_by_kdab
+ \title QWebKit by KDAB
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_quick_introduction_to_qt_quick_part_1_4
+ \title Quick by KDAB part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_quick_user_interaction_user_input_and_states_part_2_4
+ \title Quick by KDAB part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_quick_animations_and_visual_effects_part_3_4
+ \title Quick by KDAB part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_quick_small_projects_arranging_items_qmlcomponentsand_debugging_qml_part
+ \title Quick by KDAB part 4
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_mobile_development_for_nokia_devices_introduction_to_qt_on_mobile_part_1
+ \title Qt Mobile Development for Nokia Devices by Digia part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_mobile_development_for_nokia_devices_mobile_ui_design_technologies_and_a
+ \title Qt Mobile Development for Nokia Devices by Digia part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_mobile_development_for_nokia_devices_getting_started_with_nokia_qt_sdk_p
+ \title Qt Mobile Development for Nokia Devices by Digia part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_fundamentals_of_qt_part_2_hello_world_in_qtcre
+ \title Qt Essentials - Fundamentals of Qt part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_fundamentals_of_qt_part_1_your_first_qt_applic
+ \title Qt Essentials - Fundamentals of Qt part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_application_creation_part_1_mainwindows
+ \title Qt Essentials - Application Creation part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/application_creation_part_2_settings_resources_and_application_deployment
+ \title Qt Essentials - Application Creation part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/application_creation_part_3_translation_for_developers
+ \title Qt Essentials - Application Creation part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_1_common_widgets
+ \title Qt Essentials - Widgets part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_2_layout_management
+ \title Qt Essentials - Widgets part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_3_guidelines_for_custom_widgets
+ \title Qt Essentials - Widgets part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_1_using_graphicsview_classes
+ \title Qt Essentials - Graphics View part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_2_transformations_and_coordinate_systems
+ \title Qt Essentials - Graphics View part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_3_creating_custom_items
+ \title Qt Essentials - Graphics View part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_1_model_view_concept
+ \title Qt Essentials - Model/View I part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_2_showing_simple_data
+ \title Qt Essentials - Model/View I part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_3_proxy_models
+ \title Qt Essentials - Model/View I part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_4_custom_models
+ \title Qt Essentials - Model/View I part 4
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_1_editing_item_data
+ \title Qt Essentials - Model/View II part 1
+*/
+/*!
+ \externalpage
+ \title Qt Essentials - Model/View II part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_3_data_widget_mapper
+ \title Qt Essentials - Model/View II part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_4_custom_tree_model
+ \title Qt Essentials - Model/View II part 4
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_5_drag_and_drop
+ \title Qt Essentials - Model/View II part 5
+*/
+/*!
+ \externalpage http://qt.nokia.com/certification
+ \title Qt Certification
+*/
+/*!
+ \externalpage http://qt.nokia.com/developer/learning/certification/exams/preparation-prerequisites
+ \title Qt Certification Exam Preparation and Prerequisites
+*/
+
+/*!
+ \externalpage http://qt.nokia.com/developer/learning/online/training/materials
+ \title Download Qt training materials
+*/
+
+/*!
+ \externalpage http://qt.nokia.com/partners/qt-in-education/qt-in-education-course-material/
+ \title Qt in Education Course Material
+*/
diff --git a/doc/src/snippets/declarative/grid/grid-items.qml b/doc/src/snippets/declarative/grid/grid-items.qml
new file mode 100644
index 0000000000..62a444d012
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-items.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
diff --git a/doc/src/snippets/declarative/grid/grid-no-spacing.qml b/doc/src/snippets/declarative/grid/grid-no-spacing.qml
new file mode 100644
index 0000000000..a6ca305acc
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-no-spacing.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
diff --git a/doc/src/snippets/declarative/grid/grid-spacing.qml b/doc/src/snippets/declarative/grid/grid-spacing.qml
new file mode 100644
index 0000000000..c03cdad701
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-spacing.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/listview/listview-snippet.qml b/doc/src/snippets/declarative/listview/listview-snippet.qml
new file mode 100644
index 0000000000..f2a260d988
--- /dev/null
+++ b/doc/src/snippets/declarative/listview/listview-snippet.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+ListView {
+ width: 50; height: 200
+ model: 4
+ delegate: Text {
+ text: index;
+ font.pixelSize: 40
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
index 03473bafda..1b9a9ec8bc 100644
--- a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
+++ b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
@@ -47,53 +47,53 @@ Rectangle {
width: 500; height: 500
color: "green"
-Column {
-//! [anchor fill]
-Rectangle {
- id: button
- width: 100; height: 100
+ Column {
+ //! [anchor fill]
+ Rectangle {
+ id: button
+ width: 100; height: 100
- MouseArea {
- anchors.fill: parent
- onClicked: console.log("button clicked")
- }
- MouseArea {
- width:150; height: 75
- onClicked: console.log("irregular area clicked")
- }
-}
-//! [anchor fill]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("button clicked")
+ }
+ MouseArea {
+ width:150; height: 75
+ onClicked: console.log("irregular area clicked")
+ }
+ }
+ //! [anchor fill]
-Rectangle {
- id: button
- width: 100; height: 100
+ Rectangle {
+ id: button
+ width: 100; height: 100
-//! [enable handlers]
- MouseArea {
- hoverEnabled: true
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- onEntered: console.log("mouse entered the area")
- onExited: console.log("mouse left the area")
- }
-//! [enable handlers]
-}
+ //! [enable handlers]
+ MouseArea {
+ hoverEnabled: true
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onEntered: console.log("mouse entered the area")
+ onExited: console.log("mouse left the area")
+ }
+ //! [enable handlers]
+ }
-Rectangle {
- id: button
- width: 100; height: 100
+ Rectangle {
+ id: button
+ width: 100; height: 100
-//! [mouse handlers]
- MouseArea {
- anchors.fill: parent
- onClicked: console.log("area clicked")
- onDoubleClicked: console.log("area double clicked")
- onEntered: console.log("mouse entered the area")
- onExited: console.log("mouse left the area")
- }
-//! [mouse handlers]
-}
+ //! [mouse handlers]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("area clicked")
+ onDoubleClicked: console.log("area double clicked")
+ onEntered: console.log("mouse entered the area")
+ onExited: console.log("mouse left the area")
+ }
+ //! [mouse handlers]
+ }
-} //end of column
+ } //end of column
//! [parent end]
}
//! [parent end]
diff --git a/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg
new file mode 100644
index 0000000000..8c018be6a2
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ clip-rule="evenodd"
+ stroke-miterlimit="10"
+ viewBox="0 0 174.35 209.78"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="744.09186"
+ height="895.29858"
+ sodipodi:docname="qt-logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.0"
+ style="stroke-miterlimit:10">
+ <metadata
+ id="metadata29">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="668"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="0.12195802"
+ inkscape:cx="525.6108"
+ inkscape:cy="-287.87189"
+ inkscape:window-x="476"
+ inkscape:window-y="228"
+ inkscape:current-layer="svg2" />
+ <desc
+ id="desc4">SVG generated by Lineform</desc>
+ <defs
+ id="defs6">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective31" />
+ </defs>
+ <g
+ id="g8"
+ transform="translate(-1.5304326e-4,-3.775985e-4)">
+ <path
+ d="M 43.08,0.36 C 40.94,0 38.84,-0.08 36.81,0.08 L 36.8,0.08 C 36.8,0.08 22.92,1.02 22.29,1.07 C 9.62,2.08 0,12.5 0,26.89 L 0,196.55 L 14.19,209.78 L 156.79,185.81 C 166.6,184.11 174.35,172.54 174.35,160.04 L 174.35,21.88 L 43.08,0.36"
+ id="path10"
+ style="fill:#0c481e" />
+ <path
+ d="M 174.35,160.04 C 174.35,172.54 166.6,184.11 156.79,185.82 L 14.19,209.78 L 14.19,25.99 C 14.19,9.27 27.53,-2.21 43.08,0.36 L 174.35,21.88 L 174.35,160.04"
+ id="path12"
+ style="fill:#66b036" />
+ <path
+ d="M 130.42,45.91 L 141.94,47.15 L 141.94,67.36 L 154.9,68.28 L 154.9,80.96 L 141.94,80.36 L 141.94,126.69 C 141.94,130.72 142.38,133.31 143.28,134.48 C 144.08,135.55 145.32,136.07 146.99,136.07 C 147.15,136.07 147.32,136.07 147.48,136.06 C 150.03,135.91 152.81,135.13 155.83,133.75 L 155.83,145.4 C 150.69,147.65 145.65,149 140.7,149.42 C 139.99,149.47 139.29,149.5 138.62,149.5 C 134.14,149.5 130.72,148.2 128.38,145.57 C 125.65,142.52 124.29,137.62 124.29,130.9 L 124.29,79.54 L 118.06,79.26 L 118.06,65.67 L 125.65,66.22 L 130.42,45.91"
+ id="path14"
+ style="fill:#ffffff" />
+ <path
+ d="M 154.9,80.96 L 141.94,80.36 L 141.94,80.64 L 148.88,80.96 L 154.9,80.96"
+ id="path16"
+ style="fill:#0c481e" />
+ <path
+ d="M 144.64,135.6 C 145.3,135.92 146.07,136.07 146.99,136.07 C 147.15,136.07 147.32,136.07 147.48,136.06 C 150.03,135.91 152.81,135.13 155.83,133.75 L 149.81,133.75 C 147.99,134.58 146.28,135.21 144.64,135.6"
+ id="path18"
+ style="fill:#0c481e" />
+ <path
+ d="M 128.38,145.57 C 125.65,142.52 124.29,137.62 124.29,130.9 L 124.29,79.54 L 118.06,79.26 L 118.06,65.67 L 112.05,65.67 L 112.05,68.71 C 112.92,71.98 113.6,75.53 114.11,79.35 L 118.28,79.54 L 118.28,130.9 C 118.28,137.62 119.64,142.52 122.37,145.57 C 124.71,148.2 128.13,149.5 132.61,149.5 L 138.62,149.5 C 134.14,149.5 130.72,148.2 128.38,145.57 z M 130.42,45.91 L 124.41,45.91 L 119.74,65.79 L 125.65,66.22 L 130.42,45.91"
+ id="path20"
+ style="fill:#0c481e" />
+ <path
+ d="M 91.15,132.4 C 93.5,126.36 94.66,114.49 94.66,96.79 C 94.66,80.9 93.51,69.97 91.18,63.98 C 88.84,57.95 85.35,54.69 80.66,54.28 C 80.3,54.25 79.95,54.23 79.6,54.23 C 75.26,54.23 71.92,56.77 69.59,61.86 C 67.07,67.4 65.8,78.9 65.8,96.3 C 65.8,113.11 67.04,125.05 69.54,132.05 C 71.89,138.72 75.41,142.03 80.04,142.03 C 80.25,142.03 80.45,142.02 80.66,142.01 C 85.29,141.71 88.78,138.51 91.15,132.4 M 109.13,136.15 C 105.01,145.86 98.73,152.21 90.14,155.15 C 91.01,159.6 92.32,162.6 94.06,164.17 C 95.41,165.39 97.49,165.99 100.28,165.99 C 101.09,165.99 101.96,165.94 102.87,165.84 L 102.87,178.96 L 96.91,179.75 C 95.16,179.97 93.49,180.09 91.91,180.09 C 86.69,180.09 82.47,178.82 79.29,176.26 C 75.08,172.89 71.98,166.37 69.99,156.73 C 60.86,154.78 53.73,148.97 48.8,139.23 C 43.8,129.32 41.25,114.83 41.25,95.89 C 41.25,75.46 44.74,60.38 51.6,50.81 C 57.38,42.75 65.46,38.78 75.62,38.78 C 77.24,38.78 78.93,38.88 80.66,39.08 C 92.61,40.46 101.28,46.1 106.92,55.87 C 112.46,65.43 115.17,79.14 115.17,97.13 C 115.17,113.62 113.17,126.58 109.13,136.15"
+ id="path22"
+ style="fill:#ffffff" />
+ <path
+ d="M 100.28,165.99 C 101.09,165.99 101.95,165.94 102.87,165.84 L 98.04,165.84 C 98.71,165.94 99.49,165.99 100.28,165.99"
+ id="path24"
+ style="fill:#0c481e" />
+ <path
+ d="M 84.85,63.98 C 87.19,69.97 88.34,80.9 88.34,96.79 C 88.34,114.49 87.18,126.36 84.82,132.4 C 82.93,137.28 80.3,140.31 76.96,141.48 C 77.93,141.84 78.96,142.03 80.04,142.03 C 80.25,142.03 80.45,142.02 80.66,142.01 C 85.29,141.71 88.78,138.51 91.15,132.4 C 93.5,126.36 94.66,114.49 94.66,96.79 C 94.66,80.9 93.51,69.97 91.18,63.98 C 88.84,57.95 85.35,54.69 80.66,54.28 C 80.3,54.25 79.95,54.23 79.6,54.23 C 78.51,54.23 77.48,54.39 76.52,54.72 L 76.52,54.72 C 80.12,55.83 82.89,58.93 84.85,63.98 z M 82.51,178.25 C 82.4,178.2 82.28,178.15 82.17,178.09 C 82.16,178.09 82.15,178.08 82.14,178.08 C 82.03,178.03 81.93,177.97 81.83,177.92 C 81.81,177.91 81.79,177.9 81.77,177.89 C 81.68,177.84 81.59,177.79 81.49,177.74 C 81.46,177.72 81.44,177.71 81.41,177.69 C 81.33,177.65 81.24,177.6 81.16,177.55 C 81.12,177.53 81.09,177.51 81.05,177.48 C 80.98,177.44 80.91,177.4 80.84,177.36 C 80.79,177.33 80.74,177.3 80.7,177.27 C 80.64,177.23 80.58,177.19 80.52,177.15 C 80.46,177.12 80.41,177.08 80.35,177.04 C 80.3,177.01 80.25,176.98 80.2,176.94 C 80.14,176.9 80.07,176.85 80.01,176.81 C 79.97,176.78 79.93,176.75 79.89,176.72 C 79.82,176.67 79.74,176.61 79.67,176.55 C 79.64,176.54 79.61,176.52 79.59,176.5 C 79.49,176.42 79.39,176.34 79.29,176.26 C 75.08,172.89 71.98,166.37 69.99,156.73 C 60.86,154.78 53.73,148.97 48.8,139.23 C 43.8,129.32 41.25,114.83 41.25,95.89 C 41.25,75.46 44.74,60.38 51.6,50.81 C 57.38,42.75 65.46,38.78 75.62,38.78 C 75.65,38.78 69.27,38.77 69.27,38.77 L 69.27,38.78 C 59.12,38.78 51.05,42.75 45.27,50.81 C 38.41,60.38 34.92,75.46 34.92,95.89 C 34.92,114.83 37.47,129.32 42.47,139.23 C 47.41,148.97 54.53,154.78 63.67,156.73 C 65.65,166.37 68.76,172.89 72.96,176.26 C 76.14,178.82 80.36,180.09 85.58,180.09 C 85.68,180.09 85.78,180.09 85.88,180.09 L 91.42,180.09 C 88.01,180.03 85.04,179.43 82.52,178.26 C 82.51,178.26 82.51,178.26 82.51,178.25"
+ id="path26"
+ style="fill:#0c481e" />
+ </g>
+</svg>
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
index f317d4029c..763a451646 100644
--- a/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/doc/src/snippets/qmake/qt_version.pro b/doc/src/snippets/qmake/qt_version.pro
new file mode 100644
index 0000000000..ac0338b0e9
--- /dev/null
+++ b/doc/src/snippets/qmake/qt_version.pro
@@ -0,0 +1,7 @@
+#! [checking for a specific version of Qt]
+contains(QT_VERSION, "4.7.4") {
+ message(4.7.4)
+} else {
+ message(Some other version)
+}
+#! [checking for a specific version of Qt]
diff --git a/doc/src/snippets/textdocument-listitemstyles/main.cpp b/doc/src/snippets/textdocument-listitemstyles/main.cpp
new file mode 100644
index 0000000000..6e40492c29
--- /dev/null
+++ b/doc/src/snippets/textdocument-listitemstyles/main.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow *window = new MainWindow;
+ window->resize(640, 480);
+ window->show();
+ return app.exec();
+}
diff --git a/doc/src/snippets/textdocument-listitemstyles/mainwindow.cpp b/doc/src/snippets/textdocument-listitemstyles/mainwindow.cpp
new file mode 100644
index 0000000000..94e98b3400
--- /dev/null
+++ b/doc/src/snippets/textdocument-listitemstyles/mainwindow.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwindow.h"
+
+MainWindow::MainWindow()
+{
+ QMenu *fileMenu = new QMenu(tr("&File"));
+
+ fileMenu->addAction(tr("E&xit"), this, SLOT(close()),
+ QKeySequence(tr("Ctrl+Q", "File|Exit")));
+
+ QMenu *insertMenu = new QMenu(tr("&Insert"));
+
+ insertMenu->addAction(tr("&List"), this, SLOT(insertList()),
+ QKeySequence(tr("Ctrl+L", "Insert|List")));
+
+ menuBar()->addMenu(fileMenu);
+ menuBar()->addMenu(insertMenu);
+
+ editor = new QTextEdit(this);
+ document = new QTextDocument(this);
+ editor->setDocument(document);
+
+ setCentralWidget(editor);
+ setWindowTitle(tr("Text Document List Item Styles"));
+}
+
+void MainWindow::insertList()
+{
+ QTextCursor cursor = editor->textCursor();
+ cursor.beginEditBlock();
+
+ //! [add a styled, ordered list]
+ QTextListFormat listFormat;
+
+ listFormat.setStyle(QTextListFormat::ListDecimal);
+ listFormat.setNumberPrefix("(");
+ listFormat.setNumberSuffix(")");
+
+ cursor.insertList(listFormat);
+ //! [add a styled, ordered list]
+
+ cursor.endEditBlock();
+}
diff --git a/doc/src/snippets/textdocument-listitemstyles/mainwindow.h b/doc/src/snippets/textdocument-listitemstyles/mainwindow.h
new file mode 100644
index 0000000000..649a47bb16
--- /dev/null
+++ b/doc/src/snippets/textdocument-listitemstyles/mainwindow.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WINDOW_H
+#define WINDOW_H
+
+#include <QMainWindow>
+
+class QTextDocument;
+class QTextEdit;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow();
+
+public slots:
+ void insertList();
+
+private:
+ QString currentFile;
+ QTextEdit *editor;
+ QTextDocument *document;
+};
+
+#endif
diff --git a/doc/src/snippets/textdocument-listitemstyles/textdocument-listitemstyles.pro b/doc/src/snippets/textdocument-listitemstyles/textdocument-listitemstyles.pro
new file mode 100644
index 0000000000..5da8d6e1a1
--- /dev/null
+++ b/doc/src/snippets/textdocument-listitemstyles/textdocument-listitemstyles.pro
@@ -0,0 +1,3 @@
+HEADERS = mainwindow.h
+SOURCES = main.cpp \
+ mainwindow.cpp
diff --git a/doc/src/snippets/xml/streamreader/traverse.cpp b/doc/src/snippets/xml/streamreader/traverse.cpp
new file mode 100644
index 0000000000..25b64eb751
--- /dev/null
+++ b/doc/src/snippets/xml/streamreader/traverse.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include <QFile>
+#include <QStringList>
+#include <QXmlStreamReader>
+
+#include <iostream>
+
+class Traverse
+{
+ Q_DECLARE_TR_FUNCTIONS(Traverse)
+};
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+
+ if (app.arguments().count() != 2) {
+ std::cerr << qPrintable(Traverse::tr("Usage: traverse <XML file>")) << std::endl;
+ return 1;
+ }
+
+ QFile file(app.arguments()[1]);
+ if (!file.open(QFile::ReadOnly)) {
+ std::cerr << qPrintable(Traverse::tr("Failed to open file: %1").arg(app.arguments()[1])) << std::endl;
+ return 1;
+ }
+
+ //! [traverse document]
+ QXmlStreamReader xs(&file);
+ while (!xs.atEnd()) {
+ if (xs.readNextStartElement())
+ std::cout << qPrintable(xs.name().toString()) << std::endl;
+ }
+ //! [traverse document]
+
+ file.close();
+ return 0;
+}
diff --git a/doc/src/snippets/xml/streamreader/traverse.pro b/doc/src/snippets/xml/streamreader/traverse.pro
new file mode 100644
index 0000000000..e98e6f3eac
--- /dev/null
+++ b/doc/src/snippets/xml/streamreader/traverse.pro
@@ -0,0 +1,2 @@
+QT -= gui
+SOURCES = traverse.cpp
diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
index dcd5a1d6b3..35454f4268 100644
--- a/doc/src/tutorials/modelview.qdoc
+++ b/doc/src/tutorials/modelview.qdoc
@@ -104,7 +104,6 @@
array of the data elements that the user can change. The table widget can be
integrated into a program flow by reading and writing the data elements that
the table widget provides.
-
This method is very intuitive and useful in many applications, but displaying
and editing a database table with a standard table widget can be problematic.
Two copies of the data have to be coordinated: one outside the
diff --git a/doc/src/windows-and-dialogs/mainwindow.qdoc b/doc/src/windows-and-dialogs/mainwindow.qdoc
index f2b29c9d5b..e1a5e822b6 100644
--- a/doc/src/windows-and-dialogs/mainwindow.qdoc
+++ b/doc/src/windows-and-dialogs/mainwindow.qdoc
@@ -145,6 +145,17 @@
depends on the result of QWidget::frameGeometry() and the
capability of the window manager to do proper window placement,
neither of which can be guaranteed.
+
+ \section2 Symbian Peculiarities
+
+ On Symbian, the status pane and softkeys are not created until
+ after QWidget::show() is called for the main window of the application.
+ This means that at the time when the application main window gets the
+ show event, the application main window width() and height() methods
+ still return full screen width and height instead of the client area
+ width and height as expected. The correct place to get the main window
+ size is the resize event handler of the main window, as the resize event
+ will be sent each time the client area of the window changes.
*/
/*!
diff --git a/examples/animation/animatedtiles/animatedtiles.desktop b/examples/animation/animatedtiles/animatedtiles.desktop
new file mode 100644
index 0000000000..97e646fdf8
--- /dev/null
+++ b/examples/animation/animatedtiles/animatedtiles.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Animated Tiles
+Exec=/opt/usr/bin/animatedtiles
+Icon=animatedtiles
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro
index d700642315..17528b7f7c 100644
--- a/examples/animation/animatedtiles/animatedtiles.pro
+++ b/examples/animation/animatedtiles/animatedtiles.pro
@@ -11,3 +11,4 @@ symbian {
TARGET.UID3 = 0xA000D7D1
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp
index 1badb4f3ef..46b5d1ddc5 100644
--- a/examples/animation/animatedtiles/main.cpp
+++ b/examples/animation/animatedtiles/main.cpp
@@ -210,7 +210,11 @@ int main(int argc, char **argv)
view->setBackgroundBrush(bgPix);
view->setCacheMode(QGraphicsView::CacheBackground);
view->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
+#ifdef Q_OS_SYMBIAN
+ view->showMaximized();
+#else
view->show();
+#endif
QStateMachine states;
states.addState(rootState);
diff --git a/examples/animation/appchooser/appchooser.desktop b/examples/animation/appchooser/appchooser.desktop
new file mode 100644
index 0000000000..8e413e96c2
--- /dev/null
+++ b/examples/animation/appchooser/appchooser.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Application Chooser
+Exec=/opt/usr/bin/appchooser
+Icon=appchooser
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro
index 7d45da252c..8355c6fd3c 100644
--- a/examples/animation/appchooser/appchooser.pro
+++ b/examples/animation/appchooser/appchooser.pro
@@ -11,3 +11,4 @@ symbian {
TARGET.UID3 = 0xA000E3F5
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/animation/appchooser/main.cpp b/examples/animation/appchooser/main.cpp
index 86ec073f6e..3788533aa8 100644
--- a/examples/animation/appchooser/main.cpp
+++ b/examples/animation/appchooser/main.cpp
@@ -80,6 +80,21 @@ private:
QPixmap p;
};
+class GraphicsView : public QGraphicsView
+{
+ Q_OBJECT
+public:
+ GraphicsView(QGraphicsScene *scene, QWidget *parent = 0) : QGraphicsView(scene, parent)
+ {
+ }
+
+ virtual void resizeEvent(QResizeEvent *event)
+ {
+ fitInView(sceneRect(), Qt::KeepAspectRatio);
+ }
+};
+
+
void createStates(const QObjectList &objects,
const QRect &selectedRect, QState *parent)
{
@@ -112,10 +127,10 @@ int main(int argc, char **argv)
p3->setObjectName("p3");
p4->setObjectName("p4");
- p1->setGeometry(QRectF(0.0, 0.0, 64.0, 64.0));
- p2->setGeometry(QRectF(236.0, 0.0, 64.0, 64.0));
+ p1->setGeometry(QRectF( 0.0, 0.0, 64.0, 64.0));
+ p2->setGeometry(QRectF(236.0, 0.0, 64.0, 64.0));
p3->setGeometry(QRectF(236.0, 236.0, 64.0, 64.0));
- p4->setGeometry(QRectF(0.0, 236.0, 64.0, 64.0));
+ p4->setGeometry(QRectF( 0.0, 236.0, 64.0, 64.0));
QGraphicsScene scene(0, 0, 300, 300);
scene.setBackgroundBrush(Qt::white);
@@ -124,7 +139,7 @@ int main(int argc, char **argv)
scene.addItem(p3);
scene.addItem(p4);
- QGraphicsView window(&scene);
+ GraphicsView window(&scene);
window.setFrameStyle(0);
window.setAlignment(Qt::AlignLeft | Qt::AlignTop);
window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -135,12 +150,13 @@ int main(int argc, char **argv)
QState *group = new QState(&machine);
group->setObjectName("group");
+
QRect selectedRect(86, 86, 128, 128);
QState *idleState = new QState(group);
group->setInitialState(idleState);
- QObjectList objects;
+ QObjectList objects;
objects << p1 << p2 << p3 << p4;
createStates(objects, selectedRect, group);
createAnimations(objects, &machine);
@@ -148,8 +164,12 @@ int main(int argc, char **argv)
machine.setInitialState(group);
machine.start();
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ window.showMaximized();
+#else
window.resize(300, 300);
window.show();
+#endif
return app.exec();
}
diff --git a/examples/animation/easing/easing.desktop b/examples/animation/easing/easing.desktop
new file mode 100644
index 0000000000..56d122217a
--- /dev/null
+++ b/examples/animation/easing/easing.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Easing Curves
+Exec=/opt/usr/bin/easing
+Icon=easing
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/animation/easing/easing.pro b/examples/animation/easing/easing.pro
index a8eda70728..763a680659 100644
--- a/examples/animation/easing/easing.pro
+++ b/examples/animation/easing/easing.pro
@@ -5,15 +5,18 @@ SOURCES = main.cpp \
FORMS = form.ui
-RESOURCES = easing.qrc
+RESOURCES = easing.qrc
-# install
target.path = $$[QT_INSTALL_EXAMPLES]/animation/easing
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS easing.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/easing
-INSTALLS += target sources
+INSTALLS += sources
+
+INSTALLS += target
symbian {
TARGET.UID3 = 0xA000E3F6
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/animation/easing/form.ui b/examples/animation/easing/form.ui
index b60ade86a4..364aebeda6 100644
--- a/examples/animation/easing/form.ui
+++ b/examples/animation/easing/form.ui
@@ -49,12 +49,27 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_2">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
<property name="title">
<string>Path type</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
<widget class="QRadioButton" name="lineRadio">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
<property name="text">
<string>Line</string>
</property>
@@ -66,8 +81,14 @@
</attribute>
</widget>
</item>
- <item>
+ <item row="1" column="0">
<widget class="QRadioButton" name="circleRadio">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>40</height>
+ </size>
+ </property>
<property name="text">
<string>Circle</string>
</property>
@@ -96,6 +117,18 @@
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
<property name="text">
<string>Period</string>
</property>
@@ -106,6 +139,18 @@
<property name="enabled">
<bool>false</bool>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
@@ -117,18 +162,17 @@
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Amplitude</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QDoubleSpinBox" name="amplitudeSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
@@ -140,18 +184,30 @@
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label_3">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
<property name="text">
<string>Overshoot</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="4" column="1">
<widget class="QDoubleSpinBox" name="overshootSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
@@ -163,6 +219,19 @@
</property>
</widget>
</item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Amplitude</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
diff --git a/examples/animation/easing/main.cpp b/examples/animation/easing/main.cpp
index def1db27de..66a6958cf2 100644
--- a/examples/animation/easing/main.cpp
+++ b/examples/animation/easing/main.cpp
@@ -46,7 +46,15 @@ int main(int argc, char **argv)
Q_INIT_RESOURCE(easing);
QApplication app(argc, argv);
Window w;
+
+#if defined(Q_OS_SYMBIAN)
+ w.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ w.show();
+#else
w.resize(400, 400);
w.show();
+#endif
+
return app.exec();
}
diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp
index b466cec3d0..869bca4798 100644
--- a/examples/animation/easing/window.cpp
+++ b/examples/animation/easing/window.cpp
@@ -41,7 +41,12 @@
#include "window.h"
Window::Window(QWidget *parent)
- : QWidget(parent), m_iconSize(64, 64)
+ : QWidget(parent),
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ m_iconSize(32, 32)
+#else
+ m_iconSize(64, 64)
+#endif
{
m_ui.setupUi(this);
QButtonGroup *buttonGroup = findChild<QButtonGroup *>(); // ### workaround for uic in 4.4
diff --git a/examples/animation/easing/window.h b/examples/animation/easing/window.h
index bbdf14e0dc..17899a422e 100644
--- a/examples/animation/easing/window.h
+++ b/examples/animation/easing/window.h
@@ -39,7 +39,6 @@
****************************************************************************/
#include <QtGui>
-
#include "ui_form.h"
#include "animation.h"
@@ -73,6 +72,4 @@ private:
PixmapItem *m_item;
Animation *m_anim;
QSize m_iconSize;
-
-
};
diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp
index 3194c1b623..ca1876f95a 100644
--- a/examples/animation/moveblocks/main.cpp
+++ b/examples/animation/moveblocks/main.cpp
@@ -154,25 +154,28 @@ QState *createGeometryState(QObject *w1, const QRect &rect1,
}
//![13]
+
+class GraphicsView : public QGraphicsView
+{
+ Q_OBJECT
+public:
+ GraphicsView(QGraphicsScene *scene, QWidget *parent = NULL) : QGraphicsView(scene, parent)
+ {
+ }
+
+protected:
+ virtual void resizeEvent(QResizeEvent *event)
+ {
+ fitInView(scene()->sceneRect());
+ QGraphicsView::resizeEvent(event);
+ }
+};
+
+
int main(int argc, char **argv)
{
QApplication app(argc, argv);
-#if 0
- QWidget window;
- QPalette palette;
- palette.setBrush(QPalette::Window, Qt::black);
- window.setPalette(palette);
- QPushButton *button1 = new QPushButton("A", &window);
- QPushButton *button2 = new QPushButton("B", &window);
- QPushButton *button3 = new QPushButton("C", &window);
- QPushButton *button4 = new QPushButton("D", &window);
-
- button1->setObjectName("button1");
- button2->setObjectName("button2");
- button3->setObjectName("button3");
- button4->setObjectName("button4");
-#else
//![1]
QGraphicsRectWidget *button1 = new QGraphicsRectWidget;
QGraphicsRectWidget *button2 = new QGraphicsRectWidget;
@@ -188,12 +191,11 @@ int main(int argc, char **argv)
scene.addItem(button3);
scene.addItem(button4);
//![1]
- QGraphicsView window(&scene);
+ GraphicsView window(&scene);
window.setFrameStyle(0);
window.setAlignment(Qt::AlignLeft | Qt::AlignTop);
window.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
window.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-#endif
//![2]
QStateMachine machine;
@@ -308,8 +310,13 @@ int main(int argc, char **argv)
machine.start();
//![9]
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ window.showMaximized();
+ window.fitInView(scene.sceneRect() );
+#else
window.resize(300, 300);
window.show();
+#endif
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
diff --git a/examples/animation/moveblocks/moveblocks.desktop b/examples/animation/moveblocks/moveblocks.desktop
new file mode 100644
index 0000000000..4100f448df
--- /dev/null
+++ b/examples/animation/moveblocks/moveblocks.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Move Blocks
+Exec=/opt/usr/bin/moveblocks
+Icon=moveblocks
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro
index 0a32ecfe4d..ad83ba0641 100644
--- a/examples/animation/moveblocks/moveblocks.pro
+++ b/examples/animation/moveblocks/moveblocks.pro
@@ -10,3 +10,4 @@ symbian {
TARGET.UID3 = 0xA000E3F7
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp
index 1565489069..d49aa415a7 100644
--- a/examples/animation/states/main.cpp
+++ b/examples/animation/states/main.cpp
@@ -62,6 +62,19 @@ private:
QPixmap p;
};
+class GraphicsView : public QGraphicsView
+{
+public:
+ GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene)
+ {
+ }
+
+ virtual void resizeEvent(QResizeEvent *event)
+ {
+ fitInView(sceneRect(), Qt::KeepAspectRatio);
+ }
+};
+
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(states);
@@ -130,12 +143,12 @@ int main(int argc, char *argv[])
state1->assignProperty(button, "text", "Switch to state 2");
state1->assignProperty(widget, "geometry", QRectF(0, 0, 400, 150));
state1->assignProperty(box, "geometry", QRect(-200, 150, 200, 150));
- state1->assignProperty(p1, "pos", QPointF(68, 185));
- state1->assignProperty(p2, "pos", QPointF(168, 185));
- state1->assignProperty(p3, "pos", QPointF(268, 185));
- state1->assignProperty(p4, "pos", QPointF(68-150, 48-150));
- state1->assignProperty(p5, "pos", QPointF(168, 48-150));
- state1->assignProperty(p6, "pos", QPointF(268+150, 48-150));
+ state1->assignProperty(p1, "pos", QPointF(68, 200)); // 185));
+ state1->assignProperty(p2, "pos", QPointF(168, 200)); // 185));
+ state1->assignProperty(p3, "pos", QPointF(268, 200)); // 185));
+ state1->assignProperty(p4, "pos", QPointF(68 - 150, 48 - 150));
+ state1->assignProperty(p5, "pos", QPointF(168, 48 - 150));
+ state1->assignProperty(p6, "pos", QPointF(268 + 150, 48 - 150));
state1->assignProperty(p1, "rotation", qreal(0));
state1->assignProperty(p2, "rotation", qreal(0));
state1->assignProperty(p3, "rotation", qreal(0));
@@ -154,9 +167,9 @@ int main(int argc, char *argv[])
state2->assignProperty(button, "text", "Switch to state 3");
state2->assignProperty(widget, "geometry", QRectF(200, 150, 200, 150));
state2->assignProperty(box, "geometry", QRect(9, 150, 190, 150));
- state2->assignProperty(p1, "pos", QPointF(68-150, 185+150));
- state2->assignProperty(p2, "pos", QPointF(168, 185+150));
- state2->assignProperty(p3, "pos", QPointF(268+150, 185+150));
+ state2->assignProperty(p1, "pos", QPointF(68 - 150, 185 + 150));
+ state2->assignProperty(p2, "pos", QPointF(168, 185 + 150));
+ state2->assignProperty(p3, "pos", QPointF(268 + 150, 185 + 150));
state2->assignProperty(p4, "pos", QPointF(64, 48));
state2->assignProperty(p5, "pos", QPointF(168, 48));
state2->assignProperty(p6, "pos", QPointF(268, 48));
@@ -262,8 +275,13 @@ int main(int argc, char *argv[])
machine.start();
- QGraphicsView view(&scene);
+ GraphicsView view(&scene);
+
+#if defined(Q_OS_SYMBIAN)
+ view.showMaximized();
+#else
view.show();
+#endif
return app.exec();
}
diff --git a/examples/animation/states/states.desktop b/examples/animation/states/states.desktop
new file mode 100644
index 0000000000..8429979f23
--- /dev/null
+++ b/examples/animation/states/states.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=States
+Exec=/opt/usr/bin/states
+Icon=states
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro
index 9d9a9c1ce0..307e09829a 100644
--- a/examples/animation/states/states.pro
+++ b/examples/animation/states/states.pro
@@ -11,3 +11,4 @@ symbian {
TARGET.UID3 = 0xA000E3F8
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/animation/stickman/graphicsview.cpp b/examples/animation/stickman/graphicsview.cpp
index 23036efe92..0f7ce5f1c6 100644
--- a/examples/animation/stickman/graphicsview.cpp
+++ b/examples/animation/stickman/graphicsview.cpp
@@ -54,4 +54,7 @@ void GraphicsView::keyPressEvent(QKeyEvent *e)
emit keyPressed(Qt::Key(e->key()));
}
-
+void GraphicsView::resizeEvent(QResizeEvent *event)
+{
+ fitInView(scene()->sceneRect());
+}
diff --git a/examples/animation/stickman/graphicsview.h b/examples/animation/stickman/graphicsview.h
index 9cf87b63e6..400e4a63d4 100644
--- a/examples/animation/stickman/graphicsview.h
+++ b/examples/animation/stickman/graphicsview.h
@@ -51,6 +51,7 @@ public:
GraphicsView(QWidget *parent = 0);
protected:
+ virtual void resizeEvent(QResizeEvent *event);
void keyPressEvent(QKeyEvent *);
signals:
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index 4abcdc22e5..8e9dbe1e8b 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -159,10 +159,14 @@ void LifeCycle::start()
m_machine->start();
}
-void LifeCycle::addActivity(const QString &fileName, Qt::Key key)
+void LifeCycle::addActivity(const QString &fileName, Qt::Key key, QObject *sender, const char *signal)
{
QState *state = makeState(m_alive, fileName);
m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state));
+
+ if((sender != NULL) || (signal != NULL)) {
+ m_alive->addTransition(sender, signal, state);
+ }
}
QState *LifeCycle::makeState(QState *parentState, const QString &animationFileName)
diff --git a/examples/animation/stickman/lifecycle.h b/examples/animation/stickman/lifecycle.h
index 1bf3661f6c..ca1a052c39 100644
--- a/examples/animation/stickman/lifecycle.h
+++ b/examples/animation/stickman/lifecycle.h
@@ -50,6 +50,7 @@ class QAnimationGroup;
class QState;
class QAbstractState;
class QAbstractTransition;
+class QObject;
QT_END_NAMESPACE
class GraphicsView;
class LifeCycle
@@ -59,7 +60,7 @@ public:
~LifeCycle();
void setDeathAnimation(const QString &fileName);
- void addActivity(const QString &fileName, Qt::Key key);
+ void addActivity(const QString &fileName, Qt::Key key, QObject *sender = NULL, const char *signal = NULL);
void start();
diff --git a/examples/animation/stickman/main.cpp b/examples/animation/stickman/main.cpp
index 08df766509..902e572a0e 100644
--- a/examples/animation/stickman/main.cpp
+++ b/examples/animation/stickman/main.cpp
@@ -43,6 +43,7 @@
#include "lifecycle.h"
#include "stickman.h"
#include "graphicsview.h"
+#include "rectbutton.h"
#include <QtCore>
#include <QtGui>
@@ -55,6 +56,11 @@ int main(int argc, char **argv)
StickMan *stickMan = new StickMan;
stickMan->setDrawSticks(false);
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ RectButton *buttonJump = new RectButton("Jump"); buttonJump->setPos(100, 125);
+ RectButton *buttonDance = new RectButton("Dance"); buttonDance->setPos(100, 200);
+ RectButton *buttonChill = new RectButton("Chill"); buttonChill->setPos(100, 275);
+#else
QGraphicsTextItem *textItem = new QGraphicsTextItem();
textItem->setHtml("<font color=\"white\"><b>Stickman</b>"
"<p>"
@@ -71,31 +77,55 @@ int main(int argc, char **argv)
qreal w = textItem->boundingRect().width();
QRectF stickManBoundingRect = stickMan->mapToScene(stickMan->boundingRect()).boundingRect();
textItem->setPos(-w / 2.0, stickManBoundingRect.bottom() + 25.0);
+#endif
QGraphicsScene scene;
scene.addItem(stickMan);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ scene.addItem(buttonJump);
+ scene.addItem(buttonDance);
+ scene.addItem(buttonChill);
+#else
scene.addItem(textItem);
+#endif
scene.setBackgroundBrush(Qt::black);
GraphicsView view;
view.setRenderHints(QPainter::Antialiasing);
view.setTransformationAnchor(QGraphicsView::NoAnchor);
view.setScene(&scene);
- view.show();
- view.setFocus();
QRectF sceneRect = scene.sceneRect();
// making enough room in the scene for stickman to jump and die
view.resize(sceneRect.width() + 100, sceneRect.height() + 100);
view.setSceneRect(sceneRect);
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.showMaximized();
+ view.fitInView(scene.sceneRect(), Qt::KeepAspectRatio);
+#else
+ view.show();
+ view.setFocus();
+#endif
+
LifeCycle cycle(stickMan, &view);
cycle.setDeathAnimation(":/animations/dead");
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ cycle.addActivity(":/animations/jumping", Qt::Key_J, buttonJump, SIGNAL(clicked()));
+ cycle.addActivity(":/animations/dancing", Qt::Key_D, buttonDance, SIGNAL(clicked()));
+ cycle.addActivity(":/animations/chilling", Qt::Key_C, buttonChill, SIGNAL(clicked()));
+#else
cycle.addActivity(":/animations/jumping", Qt::Key_J);
cycle.addActivity(":/animations/dancing", Qt::Key_D);
cycle.addActivity(":/animations/chilling", Qt::Key_C);
+#endif
+
cycle.start();
+
return app.exec();
}
diff --git a/examples/animation/stickman/rectbutton.cpp b/examples/animation/stickman/rectbutton.cpp
new file mode 100644
index 0000000000..d45e8abefe
--- /dev/null
+++ b/examples/animation/stickman/rectbutton.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "rectbutton.h"
+#include <QPainter>
+
+RectButton::RectButton(QString buttonText) : m_ButtonText(buttonText)
+{
+}
+
+
+RectButton::~RectButton()
+{
+}
+
+
+void RectButton::mousePressEvent (QGraphicsSceneMouseEvent *event)
+{
+ emit clicked();
+}
+
+
+QRectF RectButton::boundingRect() const
+{
+ return QRectF(0.0, 0.0, 90.0, 40.0);
+}
+
+
+void RectButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+ painter->setBrush(Qt::gray);
+ painter->drawRoundedRect(boundingRect(), 5, 5);
+
+ painter->setPen(Qt::white);
+ painter->drawText(20, 25, m_ButtonText);
+}
diff --git a/examples/animation/stickman/rectbutton.h b/examples/animation/stickman/rectbutton.h
new file mode 100644
index 0000000000..e3d1f88926
--- /dev/null
+++ b/examples/animation/stickman/rectbutton.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef RECTBUTTON_H
+#define RECTBUTTON_H
+
+#include <QGraphicsObject>
+
+class RectButton : public QGraphicsObject
+{
+ Q_OBJECT
+public:
+ RectButton(QString buttonText);
+ ~RectButton();
+
+ virtual QRectF boundingRect() const;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
+protected:
+ QString m_ButtonText;
+
+ virtual void mousePressEvent (QGraphicsSceneMouseEvent *event);
+
+signals:
+ void clicked();
+};
+
+#endif // RECTBUTTON_H
diff --git a/examples/animation/stickman/stickman.desktop b/examples/animation/stickman/stickman.desktop
new file mode 100644
index 0000000000..1722d4db3e
--- /dev/null
+++ b/examples/animation/stickman/stickman.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Stickman
+Exec=/opt/usr/bin/stickman
+Icon=stickman
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro
index 37ff8d3a8d..db0c4e5a63 100644
--- a/examples/animation/stickman/stickman.pro
+++ b/examples/animation/stickman/stickman.pro
@@ -2,13 +2,15 @@ HEADERS += stickman.h \
animation.h \
node.h \
lifecycle.h \
- graphicsview.h
+ graphicsview.h \
+ rectbutton.h
SOURCES += main.cpp \
stickman.cpp \
animation.cpp \
node.cpp \
lifecycle.cpp \
- graphicsview.cpp
+ graphicsview.cpp \
+ rectbutton.cpp
RESOURCES += stickman.qrc
@@ -22,3 +24,4 @@ symbian {
TARGET.UID3 = 0xA000E3F9
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/dbus/complexpingpong/complexping.desktop b/examples/dbus/complexpingpong/complexping.desktop
new file mode 100644
index 0000000000..0075856c74
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexping.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Complex Ping
+Exec=/opt/usr/bin/complexping
+Icon=complexping
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/complexpingpong/complexping.pro b/examples/dbus/complexpingpong/complexping.pro
index a01aed680b..276a39b0a0 100644
--- a/examples/dbus/complexpingpong/complexping.pro
+++ b/examples/dbus/complexpingpong/complexping.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
@@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/complexpingpong/complexpong.desktop b/examples/dbus/complexpingpong/complexpong.desktop
new file mode 100644
index 0000000000..2af77c54de
--- /dev/null
+++ b/examples/dbus/complexpingpong/complexpong.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Complex Pong
+Exec=/opt/usr/bin/complexpong
+Icon=complexpong
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/complexpingpong/complexpong.pro b/examples/dbus/complexpingpong/complexpong.pro
index f60863f17f..4bb036a259 100644
--- a/examples/dbus/complexpingpong/complexpong.pro
+++ b/examples/dbus/complexpingpong/complexpong.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
@@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/dbus-chat/dbus-chat.desktop b/examples/dbus/dbus-chat/dbus-chat.desktop
new file mode 100644
index 0000000000..d25c82e4ce
--- /dev/null
+++ b/examples/dbus/dbus-chat/dbus-chat.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=D-Bus Chat
+Exec=/opt/usr/bin/dbus-chat
+Icon=dbus-chat
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/dbus-chat/dbus-chat.pro b/examples/dbus/dbus-chat/dbus-chat.pro
index 1316f64b0d..5ed1bcce24 100644
--- a/examples/dbus/dbus-chat/dbus-chat.pro
+++ b/examples/dbus/dbus-chat/dbus-chat.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += qdbus
@@ -19,3 +18,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/chat
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro
index e599334f18..f6629b9e30 100644
--- a/examples/dbus/dbus.pro
+++ b/examples/dbus/dbus.pro
@@ -14,4 +14,3 @@ sources.files = *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/dbus/listnames/listnames.desktop b/examples/dbus/listnames/listnames.desktop
new file mode 100644
index 0000000000..4b2047f32a
--- /dev/null
+++ b/examples/dbus/listnames/listnames.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=D-Bus List Names
+Exec=/opt/usr/bin/listnames
+Icon=listnames
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/listnames/listnames.pro b/examples/dbus/listnames/listnames.pro
index 4b484a5100..4809ded281 100644
--- a/examples/dbus/listnames/listnames.pro
+++ b/examples/dbus/listnames/listnames.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
@@ -16,4 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/listnames
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/pingpong/ping.desktop b/examples/dbus/pingpong/ping.desktop
new file mode 100644
index 0000000000..b80ea8862a
--- /dev/null
+++ b/examples/dbus/pingpong/ping.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=D-Bus Ping
+Exec=/opt/usr/bin/ping
+Icon=ping
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/pingpong/ping.pro b/examples/dbus/pingpong/ping.pro
index 4b1affe089..6d961c62b9 100644
--- a/examples/dbus/pingpong/ping.pro
+++ b/examples/dbus/pingpong/ping.pro
@@ -16,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/pingpong/pong.desktop b/examples/dbus/pingpong/pong.desktop
new file mode 100644
index 0000000000..4b5ddc8eae
--- /dev/null
+++ b/examples/dbus/pingpong/pong.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=D-Bus Pong
+Exec=/opt/usr/bin/pong
+Icon=pong
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/pingpong/pong.pro b/examples/dbus/pingpong/pong.pro
index bd824e1520..812677ebf6 100644
--- a/examples/dbus/pingpong/pong.pro
+++ b/examples/dbus/pingpong/pong.pro
@@ -16,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/remotecontrolledcar/car/car.desktop b/examples/dbus/remotecontrolledcar/car/car.desktop
new file mode 100644
index 0000000000..ab2c53be0e
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/car/car.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=D-Bus Remote Controlled Car
+Exec=/opt/usr/bin/car
+Icon=car
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro
index d362dc9fc1..9a6931bd55 100644
--- a/examples/dbus/remotecontrolledcar/car/car.pro
+++ b/examples/dbus/remotecontrolledcar/car/car.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += qdbus
@@ -20,3 +19,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/car
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.desktop b/examples/dbus/remotecontrolledcar/controller/controller.desktop
new file mode 100644
index 0000000000..1ae6aa178e
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/controller.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=D-Bus Remote Controller
+Exec=/opt/usr/bin/controller
+Icon=controller
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro
index 375b9d7f3f..788f0fe3cb 100644
--- a/examples/dbus/remotecontrolledcar/controller/controller.pro
+++ b/examples/dbus/remotecontrolledcar/controller/controller.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += qdbus
@@ -21,3 +20,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
index 6f29977c54..bb97388a29 100644
--- a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
+++ b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
@@ -7,4 +7,3 @@ sources.files = *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.desktop b/examples/declarative/animation/basics/color-animation/coloranimation.desktop
new file mode 100644
index 0000000000..b6df2d04c4
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/coloranimation.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=color-animation
+Exec=/opt/usr/bin/color-animation
+Icon=color-animation
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.png b/examples/declarative/animation/basics/color-animation/coloranimation.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/coloranimation.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.pro b/examples/declarative/animation/basics/color-animation/coloranimation.pro
new file mode 100644
index 0000000000..c8f6297b88
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/coloranimation.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE959F610
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/basics/color-animation/coloranimation.svg b/examples/declarative/animation/basics/color-animation/coloranimation.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/coloranimation.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/basics/color-animation/main.cpp b/examples/declarative/animation/basics/color-animation/main.cpp
new file mode 100644
index 0000000000..1a5dcd5e91
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/color-animation.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/animation.qmlproject b/examples/declarative/animation/basics/color-animation/qml/basics.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/animation/animation.qmlproject
+++ b/examples/declarative/animation/basics/color-animation/qml/basics.qmlproject
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation.qml b/examples/declarative/animation/basics/color-animation/qml/color-animation.qml
new file mode 100644
index 0000000000..809f391a0b
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Item {
+ id: window
+ width: 640; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "DeepSkyBlue"; to: "#0E1533"; duration: 5000 }
+ ColorAnimation { from: "#0E1533"; to: "DeepSkyBlue"; duration: 5000 }
+ }
+ }
+ GradientStop {
+ position: 1.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "SkyBlue"; to: "#437284"; duration: 5000 }
+ ColorAnimation { from: "#437284"; to: "SkyBlue"; duration: 5000 }
+ }
+ }
+ }
+ }
+
+ // the sun, moon, and stars
+ Item {
+ width: parent.width; height: 2 * parent.height
+ NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite }
+ Image {
+ source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter
+ rotation: -3 * parent.rotation
+ }
+ Image {
+ source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter
+ rotation: -parent.rotation
+ }
+ Particles {
+ x: 0; y: parent.height/2; width: parent.width; height: parent.height/2
+ source: "images/star.png"; angleDeviation: 360; velocity: 0
+ velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite
+ NumberAnimation { from: 0; to: 1; duration: 5000 }
+ NumberAnimation { from: 1; to: 0; duration: 5000 }
+ }
+ }
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "ForestGreen"; to: "#001600"; duration: 5000 }
+ ColorAnimation { from: "#001600"; to: "ForestGreen"; duration: 5000 }
+ }
+ }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+}
diff --git a/examples/declarative/animation/basics/images/face-smile.png b/examples/declarative/animation/basics/color-animation/qml/images/face-smile.png
index 3d66d72578..3d66d72578 100644
--- a/examples/declarative/animation/basics/images/face-smile.png
+++ b/examples/declarative/animation/basics/color-animation/qml/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/animation/basics/images/moon.png b/examples/declarative/animation/basics/color-animation/qml/images/moon.png
index 9407b2b4f0..9407b2b4f0 100644
--- a/examples/declarative/animation/basics/images/moon.png
+++ b/examples/declarative/animation/basics/color-animation/qml/images/moon.png
Binary files differ
diff --git a/examples/declarative/animation/basics/images/shadow.png b/examples/declarative/animation/basics/color-animation/qml/images/shadow.png
index 8270565e87..8270565e87 100644
--- a/examples/declarative/animation/basics/images/shadow.png
+++ b/examples/declarative/animation/basics/color-animation/qml/images/shadow.png
Binary files differ
diff --git a/examples/declarative/animation/basics/images/star.png b/examples/declarative/animation/basics/color-animation/qml/images/star.png
index 27ef924267..27ef924267 100644
--- a/examples/declarative/animation/basics/images/star.png
+++ b/examples/declarative/animation/basics/color-animation/qml/images/star.png
Binary files differ
diff --git a/examples/declarative/animation/basics/images/sun.png b/examples/declarative/animation/basics/color-animation/qml/images/sun.png
index 7713ca5ce7..7713ca5ce7 100644
--- a/examples/declarative/animation/basics/images/sun.png
+++ b/examples/declarative/animation/basics/color-animation/qml/images/sun.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/qml/property-animation.qml b/examples/declarative/animation/basics/color-animation/qml/property-animation.qml
new file mode 100644
index 0000000000..0a5b3530bc
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/property-animation.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: window
+ width: 320; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "DeepSkyBlue" }
+ GradientStop { position: 1.0; color: "LightSkyBlue" }
+ }
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "ForestGreen" }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+
+ // The shadow for the smiley face
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: smiley.minHeight + 58
+ source: "images/shadow.png"
+
+ // The scale property depends on the y position of the smiley face.
+ scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight)
+ }
+
+ Image {
+ id: smiley
+ property int maxHeight: window.height / 3
+ property int minHeight: 2 * window.height / 3
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: minHeight
+ source: "images/face-smile.png"
+
+ // Animate the y property. Setting loops to Animation.Infinite makes the
+ // animation repeat indefinitely, otherwise it would only run once.
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+
+ // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function
+ NumberAnimation {
+ from: smiley.minHeight; to: smiley.maxHeight
+ easing.type: Easing.OutExpo; duration: 300
+ }
+
+ // Then move back to minHeight in 1 second, using the OutBounce easing function
+ NumberAnimation {
+ from: smiley.maxHeight; to: smiley.minHeight
+ easing.type: Easing.OutBounce; duration: 1000
+ }
+
+ // Then pause for 500ms
+ PauseAnimation { duration: 500 }
+ }
+ }
+}
diff --git a/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/animation/basics/property-animation/main.cpp b/examples/declarative/animation/basics/property-animation/main.cpp
new file mode 100644
index 0000000000..2a84ef09ac
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/property-animation.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.desktop b/examples/declarative/animation/basics/property-animation/propertyanimation.desktop
new file mode 100644
index 0000000000..6155c2f79b
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/propertyanimation.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=property-animation
+Exec=/opt/usr/bin/property-animation
+Icon=property-animation
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.png b/examples/declarative/animation/basics/property-animation/propertyanimation.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/propertyanimation.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.pro b/examples/declarative/animation/basics/property-animation/propertyanimation.pro
new file mode 100644
index 0000000000..97eb86c5ea
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/propertyanimation.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE4032BC6
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/basics/property-animation/propertyanimation.svg b/examples/declarative/animation/basics/property-animation/propertyanimation.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/propertyanimation.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/easing/easing.qmlproject b/examples/declarative/animation/basics/property-animation/qml/basics.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/animation/easing/easing.qmlproject
+++ b/examples/declarative/animation/basics/property-animation/qml/basics.qmlproject
diff --git a/examples/declarative/animation/basics/property-animation/qml/color-animation.qml b/examples/declarative/animation/basics/property-animation/qml/color-animation.qml
new file mode 100644
index 0000000000..809f391a0b
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/color-animation.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Item {
+ id: window
+ width: 640; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "DeepSkyBlue"; to: "#0E1533"; duration: 5000 }
+ ColorAnimation { from: "#0E1533"; to: "DeepSkyBlue"; duration: 5000 }
+ }
+ }
+ GradientStop {
+ position: 1.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "SkyBlue"; to: "#437284"; duration: 5000 }
+ ColorAnimation { from: "#437284"; to: "SkyBlue"; duration: 5000 }
+ }
+ }
+ }
+ }
+
+ // the sun, moon, and stars
+ Item {
+ width: parent.width; height: 2 * parent.height
+ NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite }
+ Image {
+ source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter
+ rotation: -3 * parent.rotation
+ }
+ Image {
+ source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter
+ rotation: -parent.rotation
+ }
+ Particles {
+ x: 0; y: parent.height/2; width: parent.width; height: parent.height/2
+ source: "images/star.png"; angleDeviation: 360; velocity: 0
+ velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite
+ NumberAnimation { from: 0; to: 1; duration: 5000 }
+ NumberAnimation { from: 1; to: 0; duration: 5000 }
+ }
+ }
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "ForestGreen"; to: "#001600"; duration: 5000 }
+ ColorAnimation { from: "#001600"; to: "ForestGreen"; duration: 5000 }
+ }
+ }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/images/face-smile.png b/examples/declarative/animation/basics/property-animation/qml/images/face-smile.png
index 3d66d72578..3d66d72578 100644
--- a/examples/declarative/toys/dynamicscene/images/face-smile.png
+++ b/examples/declarative/animation/basics/property-animation/qml/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/images/moon.png b/examples/declarative/animation/basics/property-animation/qml/images/moon.png
new file mode 100644
index 0000000000..9407b2b4f0
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/images/moon.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/images/shadow.png b/examples/declarative/animation/basics/property-animation/qml/images/shadow.png
new file mode 100644
index 0000000000..8270565e87
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/images/shadow.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/images/star.png b/examples/declarative/animation/basics/property-animation/qml/images/star.png
index 27ef924267..27ef924267 100644
--- a/examples/declarative/toys/dynamicscene/images/star.png
+++ b/examples/declarative/animation/basics/property-animation/qml/images/star.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/images/sun.png b/examples/declarative/animation/basics/property-animation/qml/images/sun.png
index 7713ca5ce7..7713ca5ce7 100644
--- a/examples/declarative/toys/dynamicscene/images/sun.png
+++ b/examples/declarative/animation/basics/property-animation/qml/images/sun.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation.qml b/examples/declarative/animation/basics/property-animation/qml/property-animation.qml
new file mode 100644
index 0000000000..0a5b3530bc
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: window
+ width: 320; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "DeepSkyBlue" }
+ GradientStop { position: 1.0; color: "LightSkyBlue" }
+ }
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "ForestGreen" }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+
+ // The shadow for the smiley face
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: smiley.minHeight + 58
+ source: "images/shadow.png"
+
+ // The scale property depends on the y position of the smiley face.
+ scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight)
+ }
+
+ Image {
+ id: smiley
+ property int maxHeight: window.height / 3
+ property int minHeight: 2 * window.height / 3
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: minHeight
+ source: "images/face-smile.png"
+
+ // Animate the y property. Setting loops to Animation.Infinite makes the
+ // animation repeat indefinitely, otherwise it would only run once.
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+
+ // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function
+ NumberAnimation {
+ from: smiley.minHeight; to: smiley.maxHeight
+ easing.type: Easing.OutExpo; duration: 300
+ }
+
+ // Then move back to minHeight in 1 second, using the OutBounce easing function
+ NumberAnimation {
+ from: smiley.maxHeight; to: smiley.minHeight
+ easing.type: Easing.OutBounce; duration: 1000
+ }
+
+ // Then pause for 500ms
+ PauseAnimation { duration: 500 }
+ }
+ }
+}
diff --git a/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..3f1e89dd6a
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package propertyanimation
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 16:22:35 +0100
diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..4e1c4df9bc
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+propertyanimation (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 16:22:35 +0100
diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..cc2e5efa6d
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: propertyanimation
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: propertyanimation
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..e197e3725c
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 16:22:35 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..e83893240c
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/propertyanimation.sgml > propertyanimation.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/propertyanimation.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/propertyanimation install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop
new file mode 100644
index 0000000000..95af0172b6
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=behavior-example
+Exec=/opt/usr/bin/behavior-example
+Icon=behavior-example
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.png b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.png
Binary files differ
diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro
new file mode 100644
index 0000000000..1bda064451
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEB6022A4
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behaviorexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/behaviors/behavior-example/main.cpp b/examples/declarative/animation/behaviors/behavior-example/main.cpp
new file mode 100644
index 0000000000..601371cf3d
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/behavior-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml b/examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml
new file mode 100644
index 0000000000..951742173b
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qml/SideRect.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+
+ property string text
+
+ width: 75; height: 50
+ radius: 6
+ color: "#646464"
+ border.width: 4; border.color: "white"
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onEntered: {
+ focusRect.x = myRect.x;
+ focusRect.y = myRect.y;
+ focusRect.text = myRect.text;
+ }
+ }
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml
new file mode 100644
index 0000000000..3e050abd22
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qml/behavior-example.qml
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 600; height: 400
+ color: "#343434"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 200; height: 200
+ radius: 30
+ color: "transparent"
+ border.width: 4; border.color: "white"
+
+
+ SideRect {
+ id: leftRect
+ anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.left }
+ text: "Left"
+ }
+
+ SideRect {
+ id: rightRect
+ anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.right }
+ text: "Right"
+ }
+
+ SideRect {
+ id: topRect
+ anchors { verticalCenter: parent.top; horizontalCenter: parent.horizontalCenter }
+ text: "Top"
+ }
+
+ SideRect {
+ id: bottomRect
+ anchors { verticalCenter: parent.bottom; horizontalCenter: parent.horizontalCenter }
+ text: "Bottom"
+ }
+
+
+ Rectangle {
+ id: focusRect
+
+ property string text
+
+ x: 62; y: 75; width: 75; height: 50
+ radius: 6
+ border.width: 4; border.color: "white"
+ color: "firebrick"
+
+ // Set an 'elastic' behavior on the focusRect's x property.
+ Behavior on x {
+ NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
+ }
+
+ // Set an 'elastic' behavior on the focusRect's y property.
+ Behavior on y {
+ NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
+ }
+
+ Text {
+ id: focusText
+ text: focusRect.text
+ anchors.centerIn: parent
+ color: "white"
+ font.pixelSize: 16; font.bold: true
+
+ // Set a behavior on the focusText's x property:
+ // Set the opacity to 0, set the new text value, then set the opacity back to 1.
+ Behavior on text {
+ SequentialAnimation {
+ NumberAnimation { target: focusText; property: "opacity"; to: 0; duration: 150 }
+ NumberAnimation { target: focusText; property: "opacity"; to: 1; duration: 150 }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/animation/states/states.qmlproject b/examples/declarative/animation/behaviors/behavior-example/qml/behaviors.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/animation/states/states.qmlproject
+++ b/examples/declarative/animation/behaviors/behavior-example/qml/behaviors.qmlproject
diff --git a/examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml b/examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml
new file mode 100644
index 0000000000..6cd93abbd6
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qml/wigglytext.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Drag this text..."
+ property bool animated: true
+
+ width: 640; height: 480; color: "#474747"; focus: true
+
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Delete || event.key == Qt.Key_Backspace)
+ container.remove()
+ else if (event.text != "") {
+ container.append(event.text)
+ }
+ }
+
+ function append(text) {
+ container.animated = false
+ var lastLetter = container.children[container.children.length - 1]
+ var newLetter = letterComponent.createObject(container)
+ newLetter.text = text
+ newLetter.follow = lastLetter
+ container.animated = true
+ }
+
+ function remove() {
+ if (container.children.length)
+ container.children[container.children.length - 1].destroy()
+ }
+
+ function doLayout() {
+ var follow = null
+ for (var i = 0; i < container.text.length; ++i) {
+ var newLetter = letterComponent.createObject(container)
+ newLetter.text = container.text[i]
+ newLetter.follow = follow
+ follow = newLetter
+ }
+ }
+
+ Component {
+ id: letterComponent
+ Text {
+ id: letter
+ property variant follow
+
+ x: follow ? follow.x + follow.width : container.width / 3
+ y: follow ? follow.y : container.height / 2
+
+ font.pixelSize: 40; font.bold: true
+ color: "#999999"; styleColor: "#222222"; style: Text.Raised
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: letter; drag.axis: Drag.XandYAxis
+ onPressed: letter.color = "#dddddd"
+ onReleased: letter.color = "#999999"
+ }
+
+ Behavior on x { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+ Behavior on y { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+ }
+ }
+
+ Component.onCompleted: doLayout()
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/animation/easing/easing.desktop b/examples/declarative/animation/easing/easing.desktop
new file mode 100644
index 0000000000..56437b5efb
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=easing
+Exec=/opt/usr/bin/easing
+Icon=easing
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/animation/easing/easing.png b/examples/declarative/animation/easing/easing.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.png
Binary files differ
diff --git a/examples/declarative/animation/easing/easing.pro b/examples/declarative/animation/easing/easing.pro
new file mode 100644
index 0000000000..3273d9f40c
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAA54148
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/easing/easing.svg b/examples/declarative/animation/easing/easing.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/easing/main.cpp b/examples/declarative/animation/easing/main.cpp
new file mode 100644
index 0000000000..c0151a1002
--- /dev/null
+++ b/examples/declarative/animation/easing/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/easing.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/easing/qml/content/QuitButton.qml b/examples/declarative/animation/easing/qml/content/QuitButton.qml
new file mode 100644
index 0000000000..cbbf916a4b
--- /dev/null
+++ b/examples/declarative/animation/easing/qml/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/declarative/animation/easing/content/quit.png b/examples/declarative/animation/easing/qml/content/quit.png
index b822057d4e..b822057d4e 100644
--- a/examples/declarative/animation/easing/content/quit.png
+++ b/examples/declarative/animation/easing/qml/content/quit.png
Binary files differ
diff --git a/examples/declarative/animation/easing/qml/easing.qml b/examples/declarative/animation/easing/qml/easing.qml
new file mode 100644
index 0000000000..fd974d9b59
--- /dev/null
+++ b/examples/declarative/animation/easing/qml/easing.qml
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+ width: 600; height: 460; color: "#232323"
+
+ ListModel {
+ id: easingTypes
+ ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" }
+ ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" }
+ ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" }
+ ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" }
+ ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" }
+ ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" }
+ ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" }
+ ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" }
+ ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" }
+ ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" }
+ ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" }
+ ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" }
+ ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" }
+ ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" }
+ ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" }
+ ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" }
+ ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" }
+ ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" }
+ ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" }
+ ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" }
+ ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" }
+ ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" }
+ ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" }
+ ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" }
+ ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" }
+ ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" }
+ ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" }
+ ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" }
+ ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" }
+ ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" }
+ ListElement { name: "Easing.OutElastic"; type: Easing.OutElastic; ballColor: "Chocolate" }
+ ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" }
+ ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" }
+ ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" }
+ ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" }
+ ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" }
+ ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" }
+ ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" }
+ ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" }
+ ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" }
+ ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" }
+ }
+
+ Component {
+ id: delegate
+
+ Item {
+ height: 56; width: window.width
+
+ Text { text: name; anchors.centerIn: parent; color: "White" }
+
+ Rectangle {
+ id: slot1; color: "#121212"; x: 30; height: 46; width: 46
+ border.color: "#343434"; border.width: 1; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: slot2; color: "#121212"; x: window.width - 76; height: 46; width: 46
+ border.color: "#343434"; border.width: 1; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: rect; x: 30; color: "#454545"
+ border.color: "White"; border.width: 2
+ height: 46; width: 46; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+
+ MouseArea {
+ onClicked: if (rect.state == '') rect.state = "right"; else rect.state = ''
+ anchors.fill: parent
+ anchors.margins: -5 // Make MouseArea bigger than the rectangle, itself
+ }
+
+ states : State {
+ name: "right"
+ PropertyChanges { target: rect; x: window.width - 76; color: ballColor }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: type; duration: 1000 }
+ ColorAnimation { properties: "color"; easing.type: type; duration: 1000 }
+ }
+ }
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: layout.height+50
+ Rectangle {
+ id: titlePane
+ color: "#444444"
+ height: 35
+ anchors { top: parent.top; left: parent.left; right: parent.right }
+ QuitButton {
+ id: quitButton
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ }
+ }
+ Column {
+ id: layout
+ anchors { top: titlePane.bottom; topMargin: 10; left: parent.left; right: parent.right }
+ Repeater { model: easingTypes; delegate: delegate }
+ }
+ }
+}
diff --git a/examples/declarative/examples.qmlproject b/examples/declarative/animation/easing/qml/easing.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/examples.qmlproject
+++ b/examples/declarative/animation/easing/qml/easing.qmlproject
diff --git a/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/animation/easing/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/animation/states/main.cpp b/examples/declarative/animation/states/main.cpp
new file mode 100644
index 0000000000..0f4161f0cc
--- /dev/null
+++ b/examples/declarative/animation/states/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/states.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/states/qt-logo.png b/examples/declarative/animation/states/qml/qt-logo.png
index 14ddf2a028..14ddf2a028 100644
--- a/examples/declarative/animation/states/qt-logo.png
+++ b/examples/declarative/animation/states/qml/qt-logo.png
Binary files differ
diff --git a/examples/declarative/animation/states/qml/states.qml b/examples/declarative/animation/states/qml/states.qml
new file mode 100644
index 0000000000..a9046eb018
--- /dev/null
+++ b/examples/declarative/animation/states/qml/states.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 640; height: 480
+ color: "#343434"
+
+ Image {
+ id: userIcon
+ x: topLeftRect.x; y: topLeftRect.y
+ source: "qt-logo.png"
+ }
+
+ Rectangle {
+ id: topLeftRect
+
+ anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to the default state, returning the image to
+ // its initial position
+ MouseArea { anchors.fill: parent; onClicked: page.state = '' }
+ }
+
+ Rectangle {
+ id: middleRightRect
+
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'middleRight'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'middleRight' }
+ }
+
+ Rectangle {
+ id: bottomLeftRect
+
+ anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'bottomLeft'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'bottomLeft' }
+ }
+
+ states: [
+ // In state 'middleRight', move the image to middleRightRect
+ State {
+ name: "middleRight"
+ PropertyChanges { target: userIcon; x: middleRightRect.x; y: middleRightRect.y }
+ },
+
+ // In state 'bottomLeft', move the image to bottomLeftRect
+ State {
+ name: "bottomLeft"
+ PropertyChanges { target: userIcon; x: bottomLeftRect.x; y: bottomLeftRect.y }
+ }
+ ]
+}
diff --git a/examples/declarative/i18n/i18n.qmlproject b/examples/declarative/animation/states/qml/states.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/i18n/i18n.qmlproject
+++ b/examples/declarative/animation/states/qml/states.qmlproject
diff --git a/examples/declarative/animation/states/qml/transitions.qml b/examples/declarative/animation/states/qml/transitions.qml
new file mode 100644
index 0000000000..ea73b829f4
--- /dev/null
+++ b/examples/declarative/animation/states/qml/transitions.qml
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/*
+ This is exactly the same as states.qml, except that we have appended
+ a set of transitions to apply animations when the item changes
+ between each state.
+*/
+
+Rectangle {
+ id: page
+ width: 640; height: 480
+ color: "#343434"
+
+ Image {
+ id: userIcon
+ x: topLeftRect.x; y: topLeftRect.y
+ source: "qt-logo.png"
+ }
+
+ Rectangle {
+ id: topLeftRect
+
+ anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to the default state, returning the image to
+ // its initial position
+ MouseArea { anchors.fill: parent; onClicked: page.state = '' }
+ }
+
+ Rectangle {
+ id: middleRightRect
+
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'middleRight'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'middleRight' }
+ }
+
+ Rectangle {
+ id: bottomLeftRect
+
+ anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'bottomLeft'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'bottomLeft' }
+ }
+
+ states: [
+ // In state 'middleRight', move the image to middleRightRect
+ State {
+ name: "middleRight"
+ PropertyChanges { target: userIcon; x: middleRightRect.x; y: middleRightRect.y }
+ },
+
+ // In state 'bottomLeft', move the image to bottomLeftRect
+ State {
+ name: "bottomLeft"
+ PropertyChanges { target: userIcon; x: bottomLeftRect.x; y: bottomLeftRect.y }
+ }
+ ]
+
+ // Transitions define how the properties change when the item moves between each state
+ transitions: [
+
+ // When transitioning to 'middleRight' move x,y over a duration of 1 second,
+ // with OutBounce easing function.
+ Transition {
+ from: "*"; to: "middleRight"
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; duration: 1000 }
+ },
+
+ // When transitioning to 'bottomLeft' move x,y over a duration of 2 seconds,
+ // with InOutQuad easing function.
+ Transition {
+ from: "*"; to: "bottomLeft"
+ NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 2000 }
+ },
+
+ // For any other state changes move x,y linearly over duration of 200ms.
+ Transition {
+ NumberAnimation { properties: "x,y"; duration: 200 }
+ }
+ ]
+}
diff --git a/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/animation/states/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/animation/states/states.desktop b/examples/declarative/animation/states/states.desktop
new file mode 100644
index 0000000000..31eb8d5d52
--- /dev/null
+++ b/examples/declarative/animation/states/states.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=states
+Exec=/opt/usr/bin/states
+Icon=states
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/animation/states/states.png b/examples/declarative/animation/states/states.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/animation/states/states.png
Binary files differ
diff --git a/examples/declarative/animation/states/states.pro b/examples/declarative/animation/states/states.pro
new file mode 100644
index 0000000000..d25e7e4d35
--- /dev/null
+++ b/examples/declarative/animation/states/states.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE9200E0A
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/states/states.svg b/examples/declarative/animation/states/states.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/animation/states/states.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index f700f0b45b..6493640b51 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -26,3 +26,4 @@ symbian:{
importFiles.path = ImageProviderCore
DEPLOYMENT += importFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/cppextensions/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro
index b7610a8823..0b9a354c63 100644
--- a/examples/declarative/cppextensions/plugins/plugins.pro
+++ b/examples/declarative/cppextensions/plugins/plugins.pro
@@ -27,3 +27,4 @@ symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index d92e072c4e..4b6943215d 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -22,3 +22,4 @@ symbian:{
DEPLOYMENT += importFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/demos/calculator/calculator.desktop b/examples/declarative/demos/calculator/calculator.desktop
new file mode 100644
index 0000000000..837d71091b
--- /dev/null
+++ b/examples/declarative/demos/calculator/calculator.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=calculator
+Exec=/opt/usr/bin/calculator
+Icon=calculator
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/calculator/calculator.png b/examples/declarative/demos/calculator/calculator.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/calculator/calculator.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/calculator.pro b/examples/declarative/demos/calculator/calculator.pro
new file mode 100644
index 0000000000..7e433ac994
--- /dev/null
+++ b/examples/declarative/demos/calculator/calculator.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE187B2C4
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/calculator/calculator.svg b/examples/declarative/demos/calculator/calculator.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/calculator/calculator.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/demos/calculator/main.cpp b/examples/declarative/demos/calculator/main.cpp
new file mode 100644
index 0000000000..7c1aae1cc3
--- /dev/null
+++ b/examples/declarative/demos/calculator/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/calculator.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/calculator/qml/Core/Button.qml b/examples/declarative/demos/calculator/qml/Core/Button.qml
new file mode 100644
index 0000000000..f37de48750
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/Button.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+BorderImage {
+ id: button
+
+ property alias operation: buttonText.text
+ property string color: ""
+
+ signal clicked
+
+ source: "images/button-" + color + ".png"; clip: true
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+
+ Rectangle {
+ id: shade
+ anchors.fill: button; radius: 10; color: "black"; opacity: 0
+ }
+
+ Text {
+ id: buttonText
+ anchors.centerIn: parent; anchors.verticalCenterOffset: -1
+ font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5
+ style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ doOp(operation)
+ button.clicked()
+ }
+ }
+
+ states: State {
+ name: "pressed"; when: mouseArea.pressed == true
+ PropertyChanges { target: shade; opacity: .4 }
+ }
+}
diff --git a/examples/declarative/demos/calculator/qml/Core/Display.qml b/examples/declarative/demos/calculator/qml/Core/Display.qml
new file mode 100644
index 0000000000..f928d3a75f
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/Display.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+BorderImage {
+ id: image
+
+ property alias text : displayText.text
+ property alias currentOperation : operationText
+
+ source: "images/display.png"
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+
+ Text {
+ id: displayText
+ anchors {
+ right: parent.right; verticalCenter: parent.verticalCenter; verticalCenterOffset: -1
+ rightMargin: 6; left: operationText.right
+ }
+ font.pixelSize: parent.height * .6; text: "0"; horizontalAlignment: Text.AlignRight; elide: Text.ElideRight
+ color: "#343434"; smooth: true; font.bold: true
+ }
+ Text {
+ id: operationText
+ font.bold: true; font.pixelSize: parent.height * .7
+ color: "#343434"; smooth: true
+ anchors { left: parent.left; leftMargin: 6; verticalCenterOffset: -3; verticalCenter: parent.verticalCenter }
+ }
+}
diff --git a/examples/declarative/demos/calculator/qml/Core/calculator.js b/examples/declarative/demos/calculator/qml/Core/calculator.js
new file mode 100644
index 0000000000..7c363c7f30
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/calculator.js
@@ -0,0 +1,91 @@
+
+var curVal = 0
+var memory = 0
+var lastOp = ""
+var timer = 0
+
+function disabled(op) {
+ if (op == "." && display.text.toString().search(/\./) != -1) {
+ return true
+ } else if (op == squareRoot && display.text.toString().search(/-/) != -1) {
+ return true
+ } else {
+ return false
+ }
+}
+
+function doOperation(op) {
+ if (disabled(op)) {
+ return
+ }
+
+ if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) {
+ if (display.text.toString().length >= 14)
+ return; // No arbitrary length numbers
+ if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) {
+ display.text = display.text + op.toString()
+ } else {
+ display.text = op
+ }
+ lastOp = op
+ return
+ }
+ lastOp = op
+
+ if (display.currentOperation.text == "+") {
+ display.text = Number(display.text.valueOf()) + Number(curVal.valueOf())
+ } else if (display.currentOperation.text == "-") {
+ display.text = Number(curVal) - Number(display.text.valueOf())
+ } else if (display.currentOperation.text == multiplication) {
+ display.text = Number(curVal) * Number(display.text.valueOf())
+ } else if (display.currentOperation.text == division) {
+ display.text = Number(Number(curVal) / Number(display.text.valueOf())).toString()
+ } else if (display.currentOperation.text == "=") {
+ }
+
+ if (op == "+" || op == "-" || op == multiplication || op == division) {
+ display.currentOperation.text = op
+ curVal = display.text.valueOf()
+ return
+ }
+
+ curVal = 0
+ display.currentOperation.text = ""
+
+ if (op == "1/x") {
+ display.text = (1 / display.text.valueOf()).toString()
+ } else if (op == "x^2") {
+ display.text = (display.text.valueOf() * display.text.valueOf()).toString()
+ } else if (op == "Abs") {
+ display.text = (Math.abs(display.text.valueOf())).toString()
+ } else if (op == "Int") {
+ display.text = (Math.floor(display.text.valueOf())).toString()
+ } else if (op == plusminus) {
+ display.text = (display.text.valueOf() * -1).toString()
+ } else if (op == squareRoot) {
+ display.text = (Math.sqrt(display.text.valueOf())).toString()
+ } else if (op == "mc") {
+ memory = 0;
+ } else if (op == "m+") {
+ memory += display.text.valueOf()
+ } else if (op == "mr") {
+ display.text = memory.toString()
+ } else if (op == "m-") {
+ memory = display.text.valueOf()
+ } else if (op == leftArrow) {
+ display.text = display.text.toString().slice(0, -1)
+ if (display.text.length == 0) {
+ display.text = "0"
+ }
+ } else if (op == "Off") {
+ Qt.quit();
+ } else if (op == "C") {
+ display.text = "0"
+ } else if (op == "AC") {
+ curVal = 0
+ memory = 0
+ lastOp = ""
+ display.text ="0"
+ }
+}
+
diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-.png b/examples/declarative/demos/calculator/qml/Core/images/button-.png
new file mode 100644
index 0000000000..544e514536
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/images/button-.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-blue.png b/examples/declarative/demos/calculator/qml/Core/images/button-blue.png
new file mode 100644
index 0000000000..5f92de32d0
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/images/button-blue.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-green.png b/examples/declarative/demos/calculator/qml/Core/images/button-green.png
new file mode 100644
index 0000000000..36c93914c7
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/images/button-green.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-purple.png b/examples/declarative/demos/calculator/qml/Core/images/button-purple.png
new file mode 100644
index 0000000000..347cbbea9d
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/images/button-purple.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/qml/Core/images/button-red.png b/examples/declarative/demos/calculator/qml/Core/images/button-red.png
new file mode 100644
index 0000000000..3b335891ae
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/images/button-red.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/qml/Core/images/display.png b/examples/declarative/demos/calculator/qml/Core/images/display.png
new file mode 100644
index 0000000000..9507f4382e
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/images/display.png
Binary files differ
diff --git a/examples/declarative/demos/calculator/qml/Core/qmldir b/examples/declarative/demos/calculator/qml/Core/qmldir
new file mode 100644
index 0000000000..a926b93fac
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/Core/qmldir
@@ -0,0 +1,2 @@
+Button Button.qml
+Display Display.qml
diff --git a/examples/declarative/demos/calculator/qml/calculator.qml b/examples/declarative/demos/calculator/qml/calculator.qml
new file mode 100644
index 0000000000..3e1c6507cd
--- /dev/null
+++ b/examples/declarative/demos/calculator/qml/calculator.qml
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Core"
+import "Core/calculator.js" as CalcEngine
+
+Rectangle {
+ id: window
+
+ width: 480; height: 360
+ color: "#282828"
+
+ property string rotateLeft: "\u2939"
+ property string rotateRight: "\u2935"
+ property string leftArrow: "\u2190"
+ property string division : "\u00f7"
+ property string multiplication : "\u00d7"
+ property string squareRoot : "\u221a"
+ property string plusminus : "\u00b1"
+
+ function doOp(operation) { CalcEngine.doOperation(operation) }
+
+ Item {
+ id: main
+ state: "orientation " + runtime.orientation
+
+ width: parent.width; height: parent.height; anchors.centerIn: parent
+
+ Column {
+ id: box; spacing: 8
+
+ anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 }
+
+ Display {
+ id: display
+ width: box.width-3
+ height: 64
+ }
+
+ Column {
+ id: column; spacing: 6
+
+ property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6)
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
+
+ Row {
+ spacing: 6
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" }
+ }
+
+ Row {
+ spacing: 6
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
+
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mc" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m+" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m-" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mr" }
+ }
+
+ Grid {
+ id: grid; rows: 5; columns: 5; spacing: 6
+
+ property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns)
+
+ Button { width: grid.w; height: column.h; operation: "7"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "8"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "9"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: division }
+ Button { width: grid.w; height: column.h; operation: squareRoot }
+ Button { width: grid.w; height: column.h; operation: "4"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "5"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "6"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: multiplication }
+ Button { width: grid.w; height: column.h; operation: "x^2" }
+ Button { width: grid.w; height: column.h; operation: "1"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "2"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "3"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "-" }
+ Button { width: grid.w; height: column.h; operation: "1/x" }
+ Button { width: grid.w; height: column.h; operation: "0"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "." }
+ Button { width: grid.w; height: column.h; operation: plusminus }
+ Button { width: grid.w; height: column.h; operation: "+" }
+ Button { width: grid.w; height: column.h; operation: "="; color: 'red' }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "orientation " + Orientation.Landscape
+ PropertyChanges { target: main; rotation: 90; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
+ },
+ State {
+ name: "orientation " + Orientation.PortraitInverted
+ PropertyChanges { target: main; rotation: 180; }
+ PropertyChanges { target: rotateButton; operation: rotateRight }
+ },
+ State {
+ name: "orientation " + Orientation.LandscapeInverted
+ PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
+ }
+ ]
+
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAction { target: rotateButton; property: "operation" }
+ RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
+ NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/borderimage.qmlproject b/examples/declarative/demos/calculator/qml/calculator.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/imageelements/borderimage/borderimage.qmlproject
+++ b/examples/declarative/demos/calculator/qml/calculator.qmlproject
diff --git a/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/calculator/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/flickr/flickr.desktop b/examples/declarative/demos/flickr/flickr.desktop
new file mode 100644
index 0000000000..5c8ce4fbac
--- /dev/null
+++ b/examples/declarative/demos/flickr/flickr.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=flickr
+Exec=/opt/usr/bin/flickr
+Icon=flickr
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/flickr/flickr.png b/examples/declarative/demos/flickr/flickr.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/flickr/flickr.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/flickr.pro b/examples/declarative/demos/flickr/flickr.pro
new file mode 100644
index 0000000000..4104bc5a69
--- /dev/null
+++ b/examples/declarative/demos/flickr/flickr.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE9DEEA70
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/flickr/flickr.svg b/examples/declarative/demos/flickr/flickr.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/flickr/flickr.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/demos/flickr/main.cpp b/examples/declarative/demos/flickr/main.cpp
new file mode 100644
index 0000000000..4e5ad6dc57
--- /dev/null
+++ b/examples/declarative/demos/flickr/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/flickr.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/flickr/qml/common/Progress.qml b/examples/declarative/demos/flickr/qml/common/Progress.qml
new file mode 100644
index 0000000000..b928554d8d
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/common/Progress.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property variant progress: 0
+
+ Rectangle {
+ anchors.fill: parent; smooth: true
+ border.color: "white"; border.width: 0; radius: height/2 - 2
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
+ }
+
+ Rectangle {
+ y: 2; height: parent.height-4;
+ x: 2; width: Math.max(parent.width * progress - 4, 0);
+ opacity: width < 1 ? 0 : 1; smooth: true
+ gradient: Gradient {
+ GradientStop { position: 0; color: "lightsteelblue" }
+ GradientStop { position: 1.0; color: "steelblue" }
+ }
+ radius: height/2 - 2
+ }
+
+ Text {
+ text: Math.round(progress * 100) + "%"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ color: "white"; font.bold: true; font.pixelSize: 15
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/common/RssModel.qml b/examples/declarative/demos/flickr/qml/common/RssModel.qml
new file mode 100644
index 0000000000..0c1c834174
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/common/RssModel.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+XmlListModel {
+ property string tags : ""
+
+ function commasep(x)
+ {
+ return x.replace(' ',',');
+ }
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+commasep(tags)+"&" : "")+"format=rss2"
+ query: "/rss/channel/item"
+ namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
+ XmlRole { name: "url"; query: "media:content/@url/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ XmlRole { name: "tags"; query: "media:category/string()" }
+ XmlRole { name: "photoWidth"; query: "media:content/@width/string()" }
+ XmlRole { name: "photoHeight"; query: "media:content/@height/string()" }
+ XmlRole { name: "photoType"; query: "media:content/@type/string()" }
+ XmlRole { name: "photoAuthor"; query: "author/string()" }
+ XmlRole { name: "photoDate"; query: "pubDate/string()" }
+}
diff --git a/examples/declarative/demos/flickr/qml/common/ScrollBar.qml b/examples/declarative/demos/flickr/qml/common/ScrollBar.qml
new file mode 100644
index 0000000000..dfe3cbfdfc
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/common/ScrollBar.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property variant flickableArea
+
+ Rectangle {
+ radius: 5
+ color: "black"
+ opacity: 0.3
+ border.color: "white"
+ border.width: 2
+ x: 0
+ y: flickableArea.visibleArea.yPosition * container.height
+ width: parent.width
+ height: flickableArea.visibleArea.heightRatio * container.height
+ }
+ states: [
+ State {
+ name: "show"
+ when: flickableArea.movingVertically
+ PropertyChanges {
+ target: container
+ opacity: 1
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ target: container
+ properties: "opacity"
+ duration: 400
+ }
+ }
+ ]
+}
diff --git a/examples/declarative/demos/flickr/qml/common/Slider.qml b/examples/declarative/demos/flickr/qml/common/Slider.qml
new file mode 100644
index 0000000000..edccc7ddcc
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/common/Slider.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: slider; width: 400; height: 16
+
+ // value is read/write.
+ property real value: 1
+ onValueChanged: updatePos();
+ property real maximum: 1
+ property real minimum: 1
+ property int xMax: width - handle.width - 4
+ onXMaxChanged: updatePos();
+ onMinimumChanged: updatePos();
+
+ function updatePos() {
+ if (maximum > minimum) {
+ var pos = 2 + (value - minimum) * slider.xMax / (maximum - minimum);
+ pos = Math.min(pos, width - handle.width - 2);
+ pos = Math.max(pos, 2);
+ handle.x = pos;
+ } else {
+ handle.x = 2;
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ border.color: "white"; border.width: 0; radius: 8
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
+ }
+
+ Rectangle {
+ id: handle; smooth: true
+ y: 2; width: 30; height: slider.height-4; radius: 6
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightgray" }
+ GradientStop { position: 1.0; color: "gray" }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent; drag.target: parent
+ drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2
+ onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; }
+ }
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/common/qmldir b/examples/declarative/demos/flickr/qml/common/qmldir
new file mode 100644
index 0000000000..adc2479b9f
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/common/qmldir
@@ -0,0 +1,10 @@
+ImageDetails ImageDetails.qml
+LikeOMeter LikeOMeter.qml
+Loading Loading.qml
+MediaButton MediaButton.qml
+MediaLineEdit MediaLineEdit.qml
+Progress Progress.qml
+RssModel RssModel.qml
+ScrollBar ScrollBar.qml
+Slider Slider.qml
+Star Star.qml
diff --git a/examples/declarative/demos/flickr/qml/flickr-90.qml b/examples/declarative/demos/flickr/qml/flickr-90.qml
new file mode 100644
index 0000000000..31b1d917ea
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/flickr-90.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 480; height: 320
+
+ Loader {
+ y: 320; rotation: -90
+ transformOrigin: Item.TopLeft
+ source: "flickr.qml"
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/flickr.qml b/examples/declarative/demos/flickr/qml/flickr.qml
new file mode 100644
index 0000000000..740ee3522e
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/flickr.qml
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "common" as Common
+import "mobile" as Mobile
+
+Item {
+ id: screen; width: 320; height: 480
+ property bool inListView : false
+
+ Rectangle {
+ id: background
+ anchors.fill: parent; color: "#343434";
+
+ Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
+
+ Common.RssModel { id: rssModel }
+
+ Item {
+ id: views
+ width: parent.width
+ anchors.top: titleBar.bottom; anchors.bottom: toolBar.top
+
+ GridView {
+ id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {}
+ cacheBuffer: 100
+ cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height
+ }
+
+ ListView {
+ id: photoListView; model: rssModel; delegate: Mobile.ListDelegate { }
+ width: parent.width; height: parent.height; x: -(parent.width * 1.5); cacheBuffer: 100;
+ }
+
+ states: State {
+ name: "ListView"; when: screen.inListView == true
+ PropertyChanges { target: photoListView; x: 0 }
+ PropertyChanges { target: photoGridView; x: -(parent.width * 1.5) }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+
+ Mobile.ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height }
+
+ Item { id: foreground; anchors.fill: parent }
+ }
+
+ Mobile.TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 }
+
+ Mobile.ToolBar {
+ id: toolBar
+ height: 40; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9
+ button1Label: "Update"; button2Label: "View mode"
+ onButton1Clicked: rssModel.reload()
+ onButton2Clicked: if (screen.inListView == true) screen.inListView = false; else screen.inListView = true
+ }
+
+ Connections {
+ target: imageDetails
+ onClosed: {
+ if (background.state == "DetailedView") {
+ background.state = '';
+ imageDetails.photoUrl = "";
+ }
+ }
+ }
+
+ states: State {
+ name: "DetailedView"
+ PropertyChanges { target: views; x: -parent.width }
+ PropertyChanges { target: toolBar; button1Label: "View..." }
+ PropertyChanges {
+ target: toolBar
+ onButton1Clicked: if (imageDetails.state=='') imageDetails.state='Back'; else imageDetails.state=''
+ }
+ PropertyChanges { target: toolBar; button2Label: "Back" }
+ PropertyChanges { target: toolBar; onButton2Clicked: imageDetails.closed() }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+}
diff --git a/examples/declarative/imageelements/image/image.qmlproject b/examples/declarative/demos/flickr/qml/flickr.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/imageelements/image/image.qmlproject
+++ b/examples/declarative/demos/flickr/qml/flickr.qmlproject
diff --git a/examples/declarative/demos/flickr/qml/mobile/Button.qml b/examples/declarative/demos/flickr/qml/mobile/Button.qml
new file mode 100644
index 0000000000..74a7dbb957
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/Button.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ signal clicked
+
+ property string text
+
+ BorderImage {
+ id: buttonImage
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ BorderImage {
+ id: pressed
+ opacity: 0
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ MouseArea {
+ id: mouseRegion
+ anchors.fill: buttonImage
+ onClicked: { container.clicked(); }
+ }
+ Text {
+ color: "white"
+ anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15
+ text: container.text; style: Text.Raised; styleColor: "black"
+ }
+ states: [
+ State {
+ name: "Pressed"
+ when: mouseRegion.pressed == true
+ PropertyChanges { target: pressed; opacity: 1 }
+ }
+ ]
+}
diff --git a/examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml b/examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml
new file mode 100644
index 0000000000..8f01292367
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/GridDelegate.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: wrapper; width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ scaleMe.state = "Details";
+ }
+
+ Item {
+ anchors.centerIn: parent
+ scale: 0.0
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
+ id: scaleMe
+
+ Item {
+ width: 77; height: 77; anchors.centerIn: parent
+ Rectangle {
+ id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true
+ Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true }
+ Image { source: "images/gloss.png" }
+ }
+ }
+
+ Connections {
+ target: toolBar
+ onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show'
+ }
+
+ states: [
+ State {
+ name: "Show"; when: thumb.status == Image.Ready
+ PropertyChanges { target: scaleMe; scale: 1 }
+ },
+ State {
+ name: "Details"
+ PropertyChanges { target: scaleMe; scale: 1 }
+ ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer }
+ PropertyChanges { target: background; state: "DetailedView" }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "Show"; to: "Details"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ },
+ Transition {
+ from: "Details"; to: "Show"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+ ]
+ }
+ MouseArea { anchors.fill: wrapper; onClicked: photoClicked() }
+}
+
diff --git a/examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml b/examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml
new file mode 100644
index 0000000000..9d1464ec01
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/ImageDetails.qml
@@ -0,0 +1,186 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "../common" as Common
+
+Flipable {
+ id: container
+
+ property alias frontContainer: containerFront
+ property string photoTitle: ""
+ property string photoTags: ""
+ property int photoWidth
+ property int photoHeight
+ property string photoType
+ property string photoAuthor
+ property string photoDate
+ property string photoUrl
+ property int rating: 2
+ property variant prevScale: 1.0
+
+ signal closed
+
+ transform: Rotation {
+ id: itemRotation
+ origin.x: container.width / 2;
+ axis.y: 1; axis.z: 0
+ }
+
+ front: Item {
+ id: containerFront; anchors.fill: container
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"; opacity: 0.4
+ }
+
+ Column {
+ spacing: 10
+ anchors {
+ left: parent.left; leftMargin: 10
+ right: parent.right; rightMargin: 10
+ top: parent.top; topMargin: 120
+ }
+ Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: "; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags; width: parent.width }
+ }
+ }
+
+ back: Item {
+ anchors.fill: container
+
+ Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
+
+ Common.Progress {
+ anchors.centerIn: parent; width: 200; height: 22
+ progress: bigImage.progress; visible: bigImage.status != Image.Ready
+ }
+
+ Flickable {
+ id: flickable; anchors.fill: parent; clip: true
+ contentWidth: imageContainer.width; contentHeight: imageContainer.height
+
+ function updateMinimumScale() {
+ if (bigImage.status == Image.Ready && bigImage.width != 0) {
+ slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height);
+ if (bigImage.width * slider.value > flickable.width) {
+ var xoff = (flickable.width/2 + flickable.contentX) * slider.value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
+ }
+ if (bigImage.height * slider.value > flickable.height) {
+ var yoff = (flickable.height/2 + flickable.contentY) * slider.value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
+ }
+ prevScale = slider.value;
+ }
+ }
+
+ onWidthChanged: updateMinimumScale()
+ onHeightChanged: updateMinimumScale()
+
+ Item {
+ id: imageContainer
+ width: Math.max(bigImage.width * bigImage.scale, flickable.width);
+ height: Math.max(bigImage.height * bigImage.scale, flickable.height);
+
+ Image {
+ id: bigImage; source: container.photoUrl; scale: slider.value
+ anchors.centerIn: parent; smooth: !flickable.movingVertically
+ onStatusChanged : {
+ // Default scale shows the entire image.
+ if (bigImage.status == Image.Ready && bigImage.width != 0) {
+ slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height);
+ prevScale = Math.min(slider.minimum, 1);
+ slider.value = prevScale;
+ }
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "Image Unavailable"
+ visible: bigImage.status == Image.Error
+ anchors.centerIn: parent; color: "white"; font.bold: true
+ }
+
+ Common.Slider {
+ id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum }
+ anchors {
+ bottom: parent.bottom; bottomMargin: 65
+ left: parent.left; leftMargin: 25
+ right: parent.right; rightMargin: 25
+ }
+ onValueChanged: {
+ if (bigImage.width * value > flickable.width) {
+ var xoff = (flickable.width/2 + flickable.contentX) * value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
+ }
+ if (bigImage.height * value > flickable.height) {
+ var yoff = (flickable.height/2 + flickable.contentY) * value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
+ }
+ prevScale = value;
+ }
+ }
+ }
+
+ states: State {
+ name: "Back"
+ PropertyChanges { target: itemRotation; angle: 180 }
+ PropertyChanges { target: toolBar; button2Visible: false }
+ PropertyChanges { target: toolBar; button1Label: "Back" }
+ }
+
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAction { target: bigImage; property: "smooth"; value: false }
+ NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 500 }
+ PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
+ }
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml b/examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml
new file mode 100644
index 0000000000..0773547a1e
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/ListDelegate.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Component {
+ Item {
+ id: wrapper; width: wrapper.ListView.view.width; height: 86
+ Item {
+ id: moveMe
+ Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 }
+ Rectangle {
+ x: 6; y: 4; width: 77; height: 77; color: "white"; smooth: true
+
+ Image { source: imagePath; x: 1; y: 1 }
+ Image { source: "images/gloss.png" }
+ }
+ Column {
+ x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
+ Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
+ Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/mobile/TitleBar.qml b/examples/declarative/demos/flickr/qml/mobile/TitleBar.qml
new file mode 100644
index 0000000000..f283307711
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/TitleBar.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: titleBar
+ property string untaggedString: "Uploads from everyone"
+ property string taggedString: "Recent uploads tagged "
+
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Item {
+ id: container
+ width: (parent.width * 2) - 55 ; height: parent.height
+
+ function accept() {
+ imageDetails.closed()
+ titleBar.state = ""
+ background.state = ""
+ rssModel.tags = editor.text
+ }
+
+ Image {
+ id: quitButton
+ anchors.left: parent.left//; anchors.leftMargin: 0
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
+ Text {
+ id: categoryText
+ anchors {
+ left: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ elide: Text.ElideLeft
+ text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags)
+ font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black"
+ }
+
+ Button {
+ id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..."
+ onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Item {
+ id: lineEdit
+ y: 4; height: parent.height - 9
+ anchors { left: tagButton.right; leftMargin: 5; right: parent.right; rightMargin: 5 }
+
+ BorderImage { source: "images/lineedit.sci"; anchors.fill: parent }
+
+ TextInput {
+ id: editor
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ cursorVisible: true; font.bold: true
+ color: "#151515"; selectionColor: "Green"
+ }
+
+ Keys.forwardTo: [ (returnKey), (editor)]
+
+ Item {
+ id: returnKey
+ Keys.onReturnPressed: container.accept()
+ Keys.onEnterPressed: container.accept()
+ Keys.onEscapePressed: titleBar.state = ""
+ }
+ }
+ }
+
+ states: State {
+ name: "Tags"
+ PropertyChanges { target: container; x: -tagButton.x + 5 }
+ PropertyChanges { target: tagButton; text: "OK" }
+ PropertyChanges { target: editor; focus: true }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/mobile/ToolBar.qml b/examples/declarative/demos/flickr/qml/mobile/ToolBar.qml
new file mode 100644
index 0000000000..d8abb1425e
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/ToolBar.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: toolbar
+
+ property alias button1Label: button1.text
+ property alias button2Label: button2.text
+ property alias button2Visible: button2.visible
+
+ signal button1Clicked
+ signal button2Clicked
+
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Row {
+ anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30
+ Button {
+ id: button1
+ width: 140; height: 32
+ onClicked: toolbar.button1Clicked()
+ }
+
+ Button {
+ id: button2; width: 140; height: 32
+ onClicked: toolbar.button2Clicked()
+ }
+ }
+}
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/gloss.png b/examples/declarative/demos/flickr/qml/mobile/images/gloss.png
new file mode 100644
index 0000000000..5d370cd93d
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/gloss.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/lineedit.png b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.png
new file mode 100644
index 0000000000..2cc38dc35b
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci
new file mode 100644
index 0000000000..054bff78be
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/lineedit.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 10
+border.bottom: 10
+border.right: 10
+source: lineedit.png
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/quit.png b/examples/declarative/demos/flickr/qml/mobile/images/quit.png
new file mode 100644
index 0000000000..5bda1b6e0d
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/quit.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/stripes.png b/examples/declarative/demos/flickr/qml/mobile/images/stripes.png
new file mode 100644
index 0000000000..9f36727ea4
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/stripes.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/titlebar.png b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.png
new file mode 100644
index 0000000000..51c90082d0
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci
new file mode 100644
index 0000000000..0418d94cd6
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/titlebar.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png
new file mode 100644
index 0000000000..11310013ee
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.png
Binary files differ
diff --git a/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci
new file mode 100644
index 0000000000..9e4f965307
--- /dev/null
+++ b/examples/declarative/demos/flickr/qml/mobile/images/toolbutton.sci
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton.png
diff --git a/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/flickr/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/photoviewer/main.cpp b/examples/declarative/demos/photoviewer/main.cpp
new file mode 100644
index 0000000000..7746b9bcac
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/photoviewer.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/photoviewer/photoviewer.desktop b/examples/declarative/demos/photoviewer/photoviewer.desktop
new file mode 100644
index 0000000000..0ff4d15ae1
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/photoviewer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=photoviewer
+Exec=/opt/usr/bin/photoviewer
+Icon=photoviewer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/photoviewer/photoviewer.png b/examples/declarative/demos/photoviewer/photoviewer.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/photoviewer.png
Binary files differ
diff --git a/examples/declarative/demos/photoviewer/photoviewer.pro b/examples/declarative/demos/photoviewer/photoviewer.pro
new file mode 100644
index 0000000000..076099811a
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/photoviewer.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE1762B94
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/photoviewer/photoviewer.svg b/examples/declarative/demos/photoviewer/photoviewer.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/photoviewer.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml
new file mode 100644
index 0000000000..9001033fe9
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/AlbumDelegate.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Component {
+ id: albumDelegate
+ Package {
+
+ Item {
+ Package.name: 'browser'
+ GridView {
+ id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21
+ x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false
+ onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain)
+ }
+ }
+
+ Item {
+ Package.name: 'fullscreen'
+ ListView {
+ id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal
+ width: mainWindow.width; height: mainWindow.height; interactive: false
+ onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
+ highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
+ }
+ }
+
+ Item {
+ Package.name: 'album'
+ id: albumWrapper; width: 210; height: 220
+
+ VisualDataModel {
+ id: visualModel; delegate: PhotoDelegate { }
+ model: RssModel { id: rssModel; tags: tag }
+ }
+
+ BusyIndicator {
+ id: busyIndicator
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ on: rssModel.status != XmlListModel.Ready
+ }
+
+ PathView {
+ id: photosPathView; model: visualModel.parts.stack; pathItemCount: 5
+ visible: !busyIndicator.visible
+ anchors.centerIn: parent; anchors.verticalCenterOffset: -30
+ path: Path {
+ PathAttribute { name: 'z'; value: 9999.0 }
+ PathLine { x: 1; y: 1 }
+ PathAttribute { name: 'z'; value: 0.0 }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: mainWindow.editMode ? photosModel.remove(index) : albumWrapper.state = 'inGrid'
+ }
+
+ Tag {
+ anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 }
+ frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode
+ onTagChanged: rssModel.tags = tag
+ onBackClicked: if (mainWindow.editMode) photosModel.remove(index);
+ }
+
+ states: [
+ State {
+ name: 'inGrid'
+ PropertyChanges { target: photosGridView; interactive: true }
+ PropertyChanges { target: albumsShade; opacity: 1 }
+ PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 }
+ },
+ State {
+ name: 'fullscreen'; extend: 'inGrid'
+ PropertyChanges { target: photosGridView; interactive: false }
+ PropertyChanges { target: photosListView; interactive: true }
+ PropertyChanges { target: photosShade; opacity: 1 }
+ PropertyChanges { target: backButton; y: -backButton.height - 8 }
+ }
+ ]
+
+ GridView.onAdd: NumberAnimation {
+ target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad
+ }
+ GridView.onRemove: SequentialAnimation {
+ PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true }
+ NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad }
+ PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false }
+ }
+
+ transitions: [
+ Transition {
+ from: '*'; to: 'inGrid'
+ SequentialAnimation {
+ NumberAnimation { properties: 'opacity'; duration: 250 }
+ PauseAnimation { duration: 350 }
+ NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: '*'
+ NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 }
+ }
+ ]
+ }
+ }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml
new file mode 100644
index 0000000000..7b289307a6
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/BusyIndicator.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+ NumberAnimation on rotation { running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200 }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml
new file mode 100644
index 0000000000..29f2bb7c47
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Button.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias label: labelText.text
+ property color tint: "transparent"
+ signal clicked
+
+ width: labelText.width + 70 ; height: labelText.height + 18
+
+ BorderImage {
+ anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+
+ Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true }
+
+ Rectangle {
+ anchors.fill: container; color: container.tint; visible: container.tint != ""
+ opacity: 0.25; smooth: true
+ }
+
+ Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true }
+
+ MouseArea {
+ anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
+ onClicked: container.clicked()
+ }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml
new file mode 100644
index 0000000000..06f8062d08
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/EditableButton.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property string label
+ signal clicked
+ signal labelChanged(string label)
+
+ width: textInput.width + 70 ; height: textInput.height + 18
+
+ BorderImage {
+ anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+
+ Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true }
+
+ TextInput {
+ id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true
+ Keys.onReturnPressed: {
+ container.labelChanged(textInput.text)
+ container.focus = true
+ }
+ Keys.onEnterPressed: {
+ container.labelChanged(textInput.text)
+ container.focus = true
+ }
+ Keys.onEscapePressed: {
+ textInput.text = container.label
+ container.focus = true
+ }
+ }
+
+ Rectangle {
+ anchors.fill: container; border.color: "steelblue"; border.width: 4
+ color: "transparent"; visible: textInput.focus; smooth: true
+ }
+
+ MouseArea {
+ anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
+ onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); }
+ }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml
new file mode 100644
index 0000000000..5948b5da81
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/PhotoDelegate.qml
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "script/script.js" as Script
+
+Package {
+ Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z }
+ Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 }
+ Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 }
+
+ Item {
+ width: 160; height: 153
+
+ Item {
+ id: photoWrapper
+
+ property double randomAngle: Math.random() * (2 * 6 + 1) - 6
+ property double randomAngle2: Math.random() * (2 * 6 + 1) - 6
+
+ x: 0; y: 0; width: 140; height: 133
+ z: stackItem.PathView.z; rotation: photoWrapper.randomAngle
+
+ BorderImage {
+ anchors {
+ fill: border.visible ? border : placeHolder
+ leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8
+ }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+ Rectangle {
+ id: placeHolder
+
+ property int w: Script.getWidth(content)
+ property int h: Script.getHeight(content)
+ property double s: Script.calculateScale(w, h, photoWrapper.width)
+
+ color: 'white'; anchors.centerIn: parent; smooth: true
+ width: w * s; height: h * s; visible: originalImage.status != Image.Ready
+ Rectangle {
+ color: "#878787"; smooth: true
+ anchors { fill: parent; topMargin: 3; bottomMargin: 3; leftMargin: 3; rightMargin: 3 }
+ }
+ }
+ Rectangle {
+ id: border; color: 'white'; anchors.centerIn: parent; smooth: true
+ width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6
+ visible: !placeHolder.visible
+ }
+ BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready }
+ Image {
+ id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content)
+ fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
+ }
+ Image {
+ id: hqImage; smooth: true; source: ""; visible: false
+ fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
+ }
+ Binding {
+ target: mainWindow; property: "downloadProgress"; value: hqImage.progress
+ when: listItem.ListView.isCurrentItem
+ }
+ Binding {
+ target: mainWindow; property: "imageLoading"
+ value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem
+ }
+ MouseArea {
+ width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage
+ onClicked: {
+ if (albumWrapper.state == 'inGrid') {
+ gridItem.GridView.view.currentIndex = index;
+ albumWrapper.state = 'fullscreen'
+ } else {
+ gridItem.GridView.view.currentIndex = index;
+ albumWrapper.state = 'inGrid'
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: 'stacked'; when: albumWrapper.state == ''
+ ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 }
+ PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 }
+ },
+ State {
+ name: 'inGrid'; when: albumWrapper.state == 'inGrid'
+ ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 }
+ },
+ State {
+ name: 'fullscreen'; when: albumWrapper.state == 'fullscreen'
+ ParentChange {
+ target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0
+ width: mainWindow.width; height: mainWindow.height
+ }
+ PropertyChanges { target: border; opacity: 0 }
+ PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: 'stacked'; to: 'inGrid'
+ SequentialAnimation {
+ PauseAnimation { duration: 10 * index }
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart'
+ }
+ }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: 'stacked'
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: 'fullscreen'
+ SequentialAnimation {
+ PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 }
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ targets: [ photoWrapper, border ]
+ properties: 'x,y,width,height,opacity,rotation'
+ duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart'
+ }
+ }
+ }
+ },
+ Transition {
+ from: 'fullscreen'; to: 'inGrid'
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ targets: [ photoWrapper, border ]
+ properties: 'x,y,width,height,rotation,opacity'
+ duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart'
+ }
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml
new file mode 100644
index 0000000000..a0756aee82
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/ProgressBar.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property real progress: 0
+
+ Behavior on opacity { NumberAnimation { duration: 600 } }
+
+ Rectangle { anchors.fill: parent; color: "black"; opacity: 0.5 }
+
+ Rectangle {
+ id: fill; color: "white"; height: container.height
+ width: container.width * container.progress
+ }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml
new file mode 100644
index 0000000000..15bb67f863
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/RssModel.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+XmlListModel {
+ property string tags : ""
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")
+ query: "/feed/entry"
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "content"; query: "content/string()" }
+ XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" }
+}
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml
new file mode 100644
index 0000000000..935897517f
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/Tag.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Flipable {
+ id: flipable
+
+ property alias frontLabel: frontButton.label
+ property alias backLabel: backButton.label
+
+ property int angle: 0
+ property int randomAngle: Math.random() * (2 * 6 + 1) - 6
+ property bool flipped: false
+
+ signal frontClicked
+ signal backClicked
+ signal tagChanged(string tag)
+
+ front: EditableButton {
+ id: frontButton; rotation: flipable.randomAngle
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ onClicked: flipable.frontClicked()
+ onLabelChanged: flipable.tagChanged(label)
+ }
+
+ back: Button {
+ id: backButton; tint: "red"; rotation: flipable.randomAngle
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ onClicked: flipable.backClicked()
+ }
+
+ transform: Rotation {
+ origin.x: flipable.width / 2; origin.y: flipable.height / 2
+ axis.x: 0; axis.y: 1; axis.z: 0
+ angle: flipable.angle
+ }
+
+ states: State {
+ name: "back"; when: flipable.flipped
+ PropertyChanges { target: flipable; angle: 180 }
+ }
+
+ transitions: Transition {
+ ParallelAnimation {
+ NumberAnimation { properties: "angle"; duration: 400 }
+ SequentialAnimation {
+ NumberAnimation { target: flipable; property: "scale"; to: 0.8; duration: 200 }
+ NumberAnimation { target: flipable; property: "scale"; to: 1.0; duration: 200 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/content/shadow.png b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png
index 431af8545d..431af8545d 100644
--- a/examples/declarative/imageelements/borderimage/content/shadow.png
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/box-shadow.png
Binary files differ
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png
new file mode 100644
index 0000000000..664c2b1491
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/busy.png
Binary files differ
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png
new file mode 100644
index 0000000000..1847ab528d
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/images/cardboard.png
Binary files differ
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir
new file mode 100644
index 0000000000..d3c247f21a
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/qmldir
@@ -0,0 +1,8 @@
+AlbumDelegate AlbumDelegate.qml
+PhotoDelegate PhotoDelegate.qml
+ProgressBar ProgressBar.qml
+RssModel RssModel.qml
+BusyIndicator BusyIndicator.qml
+EditableButton EditableButton.qml
+Button Button.qml
+Tag Tag.qml
diff --git a/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js
new file mode 100644
index 0000000000..e8ef93a847
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/PhotoViewerCore/script/script.js
@@ -0,0 +1,27 @@
+.pragma library
+
+function getWidth(string) {
+ return (string.match(/width=\"([0-9]+)\"/))[1]
+}
+
+function getHeight(string) {
+ return (string.match(/height=\"([0-9]+)\"/))[1]
+}
+
+function getImagePath(string) {
+ var pattern = /src=\"http:\/\/(\S+)\"/
+ return (string.match(pattern))[1]
+}
+
+function calculateScale(width, height, cellSize) {
+ var widthScale = (cellSize * 1.0) / width
+ var heightScale = (cellSize * 1.0) / height
+ var scale = 0
+
+ if (widthScale <= heightScale) {
+ scale = widthScale;
+ } else if (heightScale < widthScale) {
+ scale = heightScale;
+ }
+ return scale;
+}
diff --git a/examples/declarative/demos/photoviewer/qml/i18n/base.ts b/examples/declarative/demos/photoviewer/qml/i18n/base.ts
new file mode 100644
index 0000000000..1accfd2f90
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/i18n/base.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm
new file mode 100644
index 0000000000..c24fcbc46c
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.qm
Binary files differ
diff --git a/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts
new file mode 100644
index 0000000000..9f892db616
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/i18n/qml_fr.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation>Supprimer</translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation>Ajouter</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation>Éditer</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation>Retour</translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer.qml b/examples/declarative/demos/photoviewer/qml/photoviewer.qml
new file mode 100644
index 0000000000..0f59c64079
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qml/photoviewer.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "PhotoViewerCore"
+
+Rectangle {
+ id: mainWindow
+
+ property real downloadProgress: 0
+ property bool imageLoading: false
+ property bool editMode: false
+
+ width: 800; height: 480; color: "#d5d6d8"
+
+ ListModel {
+ id: photosModel
+ ListElement { tag: "Flowers" }
+ ListElement { tag: "Wildlife" }
+ ListElement { tag: "Prague" }
+ }
+
+ VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} }
+
+ GridView {
+ id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220
+ model: albumVisualModel.parts.album; visible: albumsShade.opacity != 1.0
+ }
+
+ Column {
+ spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 }
+ Button {
+ id: newButton; label: qsTr("Add"); rotation: 3
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ mainWindow.editMode = false
+ photosModel.append( { tag: "" } )
+ albumView.positionViewAtIndex(albumView.count - 1, GridView.Contain)
+ }
+ }
+ Button {
+ id: deleteButton; label: qsTr("Edit"); rotation: -2;
+ onClicked: mainWindow.editMode = !mainWindow.editMode
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Button {
+ id: quitButton; label: qsTr("Quit"); rotation: -2;
+ onClicked: Qt.quit()
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Rectangle {
+ id: albumsShade; color: mainWindow.color
+ width: parent.width; height: parent.height; opacity: 0.0
+ }
+
+ ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false }
+
+ Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 }
+
+ Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
+
+ ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false }
+
+ Item { id: foreground; anchors.fill: parent }
+
+ ProgressBar {
+ progress: mainWindow.downloadProgress; width: parent.width; height: 4
+ anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0
+ }
+}
diff --git a/examples/declarative/imageelements/imageelements.qmlproject b/examples/declarative/demos/photoviewer/qml/photoviewer.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/imageelements/imageelements.qmlproject
+++ b/examples/declarative/demos/photoviewer/qml/photoviewer.qmlproject
diff --git a/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/photoviewer/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/rssnews/main.cpp b/examples/declarative/demos/rssnews/main.cpp
new file mode 100644
index 0000000000..f03c578f24
--- /dev/null
+++ b/examples/declarative/demos/rssnews/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/rssnews.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml b/examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml
new file mode 100644
index 0000000000..e305cbea77
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/BusyIndicator.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+
+ NumberAnimation on rotation {
+ running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200
+ }
+}
diff --git a/examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml b/examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml
new file mode 100644
index 0000000000..c4fa8cccdf
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/CategoryDelegate.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: delegate
+
+ width: delegate.ListView.view.width; height: 60
+
+ Text {
+ text: name
+ color: delegate.ListView.isCurrentItem ? "white" : "black"
+ font { family: "Helvetica"; pixelSize: 16; bold: true }
+ anchors {
+ left: parent.left; leftMargin: 15
+ verticalCenter: parent.verticalCenter
+ }
+ }
+
+ BusyIndicator {
+ scale: 0.6
+ on: delegate.ListView.isCurrentItem && window.loading
+ anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter }
+ }
+
+ Rectangle {
+ width: delegate.width; height: 1; color: "#cccccc"
+ anchors.bottom: delegate.bottom
+ visible: delegate.ListView.isCurrentItem ? false : true
+ }
+ Rectangle {
+ width: delegate.width; height: 1; color: "white"
+ visible: delegate.ListView.isCurrentItem ? false : true
+ }
+
+ MouseArea {
+ anchors.fill: delegate
+ onClicked: {
+ delegate.ListView.view.currentIndex = index
+ window.currentFeed = feed
+ }
+ }
+}
diff --git a/examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml b/examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml
new file mode 100644
index 0000000000..cf88f4ebb0
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/NewsDelegate.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: delegate
+ height: column.height + 40
+ width: delegate.ListView.view.width
+
+ Column {
+ id: column
+ x: 20; y: 20
+ width: parent.width - 40
+
+ Text {
+ id: titleText
+ text: title; width: parent.width; wrapMode: Text.WordWrap
+ font { bold: true; family: "Helvetica"; pointSize: 16 }
+ }
+
+ Text {
+ id: descriptionText
+ width: parent.width; text: description
+ wrapMode: Text.WordWrap; font.family: "Helvetica"
+ }
+ }
+
+ Rectangle {
+ width: parent.width; height: 1; color: "#cccccc"
+ anchors.bottom: parent.bottom
+ }
+}
diff --git a/examples/declarative/demos/rssnews/qml/content/RssFeeds.qml b/examples/declarative/demos/rssnews/qml/content/RssFeeds.qml
new file mode 100644
index 0000000000..37c4b6976a
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/RssFeeds.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ id: rssFeeds
+
+ ListElement { name: "Top Stories"; feed: "rss.news.yahoo.com/rss/topstories" }
+ ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" }
+ ListElement { name: "Europe"; feed: "rss.news.yahoo.com/rss/europe" }
+ ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" }
+ ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" }
+ ListElement { name: "Politics"; feed: "rss.news.yahoo.com/rss/politics" }
+ ListElement { name: "Business"; feed: "rss.news.yahoo.com/rss/business" }
+ ListElement { name: "Technology"; feed: "rss.news.yahoo.com/rss/tech" }
+ ListElement { name: "Entertainment"; feed: "rss.news.yahoo.com/rss/entertainment" }
+ ListElement { name: "Health"; feed: "rss.news.yahoo.com/rss/health" }
+ ListElement { name: "Science"; feed: "rss.news.yahoo.com/rss/science" }
+ ListElement { name: "Sports"; feed: "rss.news.yahoo.com/rss/sports" }
+}
diff --git a/examples/declarative/demos/rssnews/qml/content/ScrollBar.qml b/examples/declarative/demos/rssnews/qml/content/ScrollBar.qml
new file mode 100644
index 0000000000..f20f0aa4ae
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/ScrollBar.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property variant scrollArea
+ property variant orientation: Qt.Vertical
+
+ opacity: 0
+
+ function position()
+ {
+ var ny = 0;
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+ if (ny > 2) return ny; else return 2;
+ }
+
+ function size()
+ {
+ var nh, ny;
+
+ if (container.orientation == Qt.Vertical)
+ nh = scrollArea.visibleArea.heightRatio * container.height;
+ else
+ nh = scrollArea.visibleArea.widthRatio * container.width;
+
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+
+ if (ny > 3) {
+ var t;
+ if (container.orientation == Qt.Vertical)
+ t = Math.ceil(container.height - 3 - ny);
+ else
+ t = Math.ceil(container.width - 3 - ny);
+ if (nh > t) return t; else return nh;
+ } else return nh + ny;
+ }
+
+ Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 }
+
+ BorderImage {
+ source: "images/scrollbar.png"
+ border { left: 1; right: 1; top: 1; bottom: 1 }
+ x: container.orientation == Qt.Vertical ? 2 : position()
+ width: container.orientation == Qt.Vertical ? container.width - 4 : size()
+ y: container.orientation == Qt.Vertical ? position() : 2
+ height: container.orientation == Qt.Vertical ? size() : container.height - 4
+ }
+
+ states: State {
+ name: "visible"
+ when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
+ PropertyChanges { target: container; opacity: 1.0 }
+ }
+
+ transitions: Transition {
+ from: "visible"; to: ""
+ NumberAnimation { properties: "opacity"; duration: 600 }
+ }
+}
diff --git a/examples/declarative/demos/rssnews/qml/content/images/busy.png b/examples/declarative/demos/rssnews/qml/content/images/busy.png
new file mode 100644
index 0000000000..664c2b1491
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/images/busy.png
Binary files differ
diff --git a/examples/declarative/demos/rssnews/qml/content/images/scrollbar.png b/examples/declarative/demos/rssnews/qml/content/images/scrollbar.png
new file mode 100644
index 0000000000..0228dcf9eb
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/content/images/scrollbar.png
Binary files differ
diff --git a/examples/declarative/demos/rssnews/qml/rssnews.qml b/examples/declarative/demos/rssnews/qml/rssnews.qml
new file mode 100644
index 0000000000..f6fe188211
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qml/rssnews.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+ width: 800; height: 480
+
+ property string currentFeed: "rss.news.yahoo.com/rss/topstories"
+ property bool loading: feedModel.status == XmlListModel.Loading
+
+ RssFeeds { id: rssFeeds }
+
+ XmlListModel {
+ id: feedModel
+ source: "http://" + window.currentFeed
+ query: "/rss/channel/item"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "link"; query: "link/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ }
+
+ Row {
+ Rectangle {
+ width: 220; height: window.height
+ color: "#efefef"
+
+ ListView {
+ focus: true
+ id: categories
+ anchors.fill: parent
+ model: rssFeeds
+ footer: quitButtonDelegate
+ delegate: CategoryDelegate {}
+ highlight: Rectangle { color: "steelblue" }
+ highlightMoveSpeed: 9999999
+ }
+ ScrollBar {
+ scrollArea: categories; height: categories.height; width: 8
+ anchors.right: categories.right
+ }
+ }
+ ListView {
+ id: list
+ width: window.width - 220; height: window.height
+ model: feedModel
+ delegate: NewsDelegate {}
+ }
+ }
+ Component {
+ id: quitButtonDelegate
+ Item {
+ width: categories.width; height: 60
+ Text {
+ text: "Quit"
+ font { family: "Helvetica"; pixelSize: 16; bold: true }
+ anchors {
+ left: parent.left; leftMargin: 15
+ verticalCenter: parent.verticalCenter
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+ }
+ ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
+ Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" }
+}
diff --git a/examples/declarative/keyinteraction/focus/focus.qmlproject b/examples/declarative/demos/rssnews/qml/rssnews.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/keyinteraction/focus/focus.qmlproject
+++ b/examples/declarative/demos/rssnews/qml/rssnews.qmlproject
diff --git a/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/rssnews/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/rssnews/rssnews.desktop b/examples/declarative/demos/rssnews/rssnews.desktop
new file mode 100644
index 0000000000..ba6110f28e
--- /dev/null
+++ b/examples/declarative/demos/rssnews/rssnews.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=rssnews
+Exec=/opt/usr/bin/rssnews
+Icon=rssnews
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/rssnews/rssnews.png b/examples/declarative/demos/rssnews/rssnews.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/rssnews/rssnews.png
Binary files differ
diff --git a/examples/declarative/demos/rssnews/rssnews.pro b/examples/declarative/demos/rssnews/rssnews.pro
new file mode 100644
index 0000000000..a44d567b60
--- /dev/null
+++ b/examples/declarative/demos/rssnews/rssnews.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE72E9E51
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/rssnews/rssnews.svg b/examples/declarative/demos/rssnews/rssnews.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/rssnews/rssnews.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/demos/samegame/main.cpp b/examples/declarative/demos/samegame/main.cpp
new file mode 100644
index 0000000000..58ec3b8e48
--- /dev/null
+++ b/examples/declarative/demos/samegame/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/samegame.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml b/examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml
new file mode 100644
index 0000000000..afda29c096
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/BoomBlock.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Item {
+ id: block
+ property bool dying: false
+ property bool spawned: false
+ property int type: 0
+
+ Behavior on x {
+ enabled: spawned;
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+ Behavior on y {
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+
+ Image {
+ id: img
+ source: {
+ if(type == 0){
+ "pics/redStone.png";
+ } else if(type == 1) {
+ "pics/blueStone.png";
+ } else {
+ "pics/greenStone.png";
+ }
+ }
+ opacity: 0
+ Behavior on opacity { NumberAnimation { duration: 200 } }
+ anchors.fill: parent
+ }
+
+ Particles {
+ id: particles
+
+ width: 1; height: 1
+ anchors.centerIn: parent
+
+ emissionRate: 0
+ lifeSpan: 700; lifeSpanDeviation: 600
+ angle: 0; angleDeviation: 360;
+ velocity: 100; velocityDeviation: 30
+ source: {
+ if(type == 0){
+ "pics/redStar.png";
+ } else if (type == 1) {
+ "pics/blueStar.png";
+ } else {
+ "pics/greenStar.png";
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "AliveState"; when: spawned == true && dying == false
+ PropertyChanges { target: img; opacity: 1 }
+ },
+
+ State {
+ name: "DeathState"; when: dying == true
+ StateChangeScript { script: particles.burst(50); }
+ PropertyChanges { target: img; opacity: 0 }
+ StateChangeScript { script: block.destroy(1000); }
+ }
+ ]
+}
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/Button.qml b/examples/declarative/demos/samegame/qml/SamegameCore/Button.qml
new file mode 100644
index 0000000000..140b1968c0
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/Button.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Button"
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 20
+ smooth: true
+ border { width: 1; color: Qt.darker(activePalette.button) }
+ radius: 8
+ color: activePalette.button
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: {
+ if (mouseArea.pressed)
+ return activePalette.dark
+ else
+ return activePalette.light
+ }
+ }
+ GradientStop { position: 1.0; color: activePalette.button }
+ }
+
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
+
+ Text {
+ id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText; font.pixelSize: 24
+ }
+}
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml b/examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml
new file mode 100644
index 0000000000..e1f3900c43
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/Dialog.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+
+ property Item text: dialogText
+
+ signal closed
+ signal opened
+ function forceClose() {
+ if(page.opacity == 0)
+ return; //already closed
+ page.closed();
+ page.opacity = 0;
+ }
+
+ function show(txt) {
+ page.opened();
+ dialogText.text = txt;
+ page.opacity = 1;
+ }
+
+ width: dialogText.width + 20; height: dialogText.height + 20
+ color: "white"
+ border.width: 1
+ opacity: 0
+ visible: opacity > 0
+ Behavior on opacity {
+ NumberAnimation { duration: 1000 }
+ }
+
+ Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" }
+
+ MouseArea { anchors.fill: parent; onClicked: forceClose(); }
+}
+
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png
new file mode 100644
index 0000000000..3734a27744
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/background.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png
new file mode 100644
index 0000000000..ff9588f80a
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStar.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png
new file mode 100644
index 0000000000..20e43c75b6
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/blueStone.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png
new file mode 100644
index 0000000000..cd06854719
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStar.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png
new file mode 100644
index 0000000000..b568a1900c
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/greenStone.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png
new file mode 100644
index 0000000000..0a4dffe583
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStar.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png
new file mode 100644
index 0000000000..36b09a2686
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/redStone.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png
new file mode 100644
index 0000000000..defbde53ca
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/star.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png b/examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png
new file mode 100644
index 0000000000..b1ce76212c
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/pics/yellowStone.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/qmldir b/examples/declarative/demos/samegame/qml/SamegameCore/qmldir
new file mode 100644
index 0000000000..e17b1f5d2b
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/qmldir
@@ -0,0 +1,3 @@
+BoomBlock BoomBlock.qml
+Button Button.qml
+Dialog Dialog.qml
diff --git a/examples/declarative/demos/samegame/qml/SamegameCore/samegame.js b/examples/declarative/demos/samegame/qml/SamegameCore/samegame.js
new file mode 100644
index 0000000000..9266767738
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/SamegameCore/samegame.js
@@ -0,0 +1,238 @@
+/* This script file handles the game logic */
+
+var maxColumn = 10;
+var maxRow = 15;
+var maxIndex = maxColumn*maxRow;
+var board = new Array(maxIndex);
+var blockSrc = "SamegameCore/BoomBlock.qml";
+var scoresURL = "";
+var gameDuration;
+var component = Qt.createComponent(blockSrc);
+
+//Index function used instead of a 2D array
+function index(column,row) {
+ return column + (row * maxColumn);
+}
+
+function timeStr(msecs) {
+ var secs = Math.floor(msecs/1000);
+ var m = Math.floor(secs/60);
+ var ret = "" + m + "m " + (secs%60) + "s";
+ return ret;
+}
+
+function startNewGame()
+{
+ //Delete blocks from previous game
+ for(var i = 0; i<maxIndex; i++){
+ if(board[i] != null)
+ board[i].destroy();
+ }
+
+ //Calculate board size
+ maxColumn = Math.floor(gameCanvas.width/gameCanvas.blockSize);
+ maxRow = Math.floor(gameCanvas.height/gameCanvas.blockSize);
+ maxIndex = maxRow*maxColumn;
+
+ //Close dialogs
+ nameInputDialog.forceClose();
+ dialog.forceClose();
+
+ //Initialize Board
+ board = new Array(maxIndex);
+ gameCanvas.score = 0;
+ for(var column=0; column<maxColumn; column++){
+ for(var row=0; row<maxRow; row++){
+ board[index(column,row)] = null;
+ createBlock(column,row);
+ }
+ }
+ gameDuration = new Date();
+}
+
+var fillFound;//Set after a floodFill call to the number of blocks found
+var floodBoard;//Set to 1 if the floodFill reaches off that node
+//NOTE: Be careful with vars named x,y, as the calling object's x,y are still in scope
+function handleClick(x,y)
+{
+ var column = Math.floor(x/gameCanvas.blockSize);
+ var row = Math.floor(y/gameCanvas.blockSize);
+ if(column >= maxColumn || column < 0 || row >= maxRow || row < 0)
+ return;
+ if(board[index(column, row)] == null)
+ return;
+ //If it's a valid block, remove it and all connected (does nothing if it's not connected)
+ floodFill(column,row, -1);
+ if(fillFound <= 0)
+ return;
+ gameCanvas.score += (fillFound - 1) * (fillFound - 1);
+ shuffleDown();
+ victoryCheck();
+}
+
+function floodFill(column,row,type)
+{
+ if(board[index(column, row)] == null)
+ return;
+ var first = false;
+ if(type == -1){
+ first = true;
+ type = board[index(column,row)].type;
+
+ //Flood fill initialization
+ fillFound = 0;
+ floodBoard = new Array(maxIndex);
+ }
+ if(column >= maxColumn || column < 0 || row >= maxRow || row < 0)
+ return;
+ if(floodBoard[index(column, row)] == 1 || (!first && type != board[index(column,row)].type))
+ return;
+ floodBoard[index(column, row)] = 1;
+ floodFill(column+1,row,type);
+ floodFill(column-1,row,type);
+ floodFill(column,row+1,type);
+ floodFill(column,row-1,type);
+ if(first==true && fillFound == 0)
+ return;//Can't remove single blocks
+ board[index(column,row)].dying = true;
+ board[index(column,row)] = null;
+ fillFound += 1;
+}
+
+function shuffleDown()
+{
+ //Fall down
+ for(var column=0; column<maxColumn; column++){
+ var fallDist = 0;
+ for(var row=maxRow-1; row>=0; row--){
+ if(board[index(column,row)] == null){
+ fallDist += 1;
+ }else{
+ if(fallDist > 0){
+ var obj = board[index(column,row)];
+ obj.y = (row+fallDist) * gameCanvas.blockSize;
+ board[index(column,row+fallDist)] = obj;
+ board[index(column,row)] = null;
+ }
+ }
+ }
+ }
+ //Fall to the left
+ fallDist = 0;
+ for(column=0; column<maxColumn; column++){
+ if(board[index(column, maxRow - 1)] == null){
+ fallDist += 1;
+ }else{
+ if(fallDist > 0){
+ for(row=0; row<maxRow; row++){
+ obj = board[index(column,row)];
+ if(obj == null)
+ continue;
+ obj.x = (column-fallDist) * gameCanvas.blockSize;
+ board[index(column-fallDist,row)] = obj;
+ board[index(column,row)] = null;
+ }
+ }
+ }
+ }
+}
+
+function victoryCheck()
+{
+ //awards bonuses for no blocks left
+ var deservesBonus = true;
+ for(var column=maxColumn-1; column>=0; column--)
+ if(board[index(column, maxRow - 1)] != null)
+ deservesBonus = false;
+ if(deservesBonus)
+ gameCanvas.score += 500;
+ //Checks for game over
+ if(deservesBonus || !(floodMoveCheck(0,maxRow-1, -1))){
+ gameDuration = new Date() - gameDuration;
+ nameInputDialog.show("You won! Please enter your name: ");
+ nameInputDialog.initialWidth = nameInputDialog.text.width + 20;
+ if(nameInputDialog.name == "")
+ nameInputDialog.width = nameInputDialog.initialWidth;
+ nameInputDialog.text.opacity = 0;//Just a spacer
+ }
+}
+
+//only floods up and right, to see if it can find adjacent same-typed blocks
+function floodMoveCheck(column, row, type)
+{
+ if(column >= maxColumn || column < 0 || row >= maxRow || row < 0)
+ return false;
+ if(board[index(column, row)] == null)
+ return false;
+ var myType = board[index(column, row)].type;
+ if(type == myType)
+ return true;
+ return floodMoveCheck(column + 1, row, myType) ||
+ floodMoveCheck(column, row - 1, board[index(column,row)].type);
+}
+
+function createBlock(column,row){
+ // Note that we don't wait for the component to become ready. This will
+ // only work if the block QML is a local file. Otherwise the component will
+ // not be ready immediately. There is a statusChanged signal on the
+ // component you could use if you want to wait to load remote files.
+ if(component.status == Component.Ready){
+ var dynamicObject = component.createObject(gameCanvas);
+ if(dynamicObject == null){
+ console.log("error creating block");
+ console.log(component.errorString());
+ return false;
+ }
+ dynamicObject.type = Math.floor(Math.random() * 3);
+ dynamicObject.x = column*gameCanvas.blockSize;
+ dynamicObject.y = row*gameCanvas.blockSize;
+ dynamicObject.width = gameCanvas.blockSize;
+ dynamicObject.height = gameCanvas.blockSize;
+ dynamicObject.spawned = true;
+ board[index(column,row)] = dynamicObject;
+ }else{
+ console.log("error loading block component");
+ console.log(component.errorString());
+ return false;
+ }
+ return true;
+}
+
+function saveHighScore(name) {
+ if(scoresURL!="")
+ sendHighScore(name);
+ //OfflineStorage
+ var db = openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores",100);
+ var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)";
+ var data = [name, gameCanvas.score, maxColumn+"x"+maxRow ,Math.floor(gameDuration/1000)];
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)');
+ tx.executeSql(dataStr, data);
+
+ //Only show results for the current grid size
+ var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'+maxColumn+"x"+maxRow+'" ORDER BY score desc LIMIT 10');
+ var r = "\nHIGH SCORES for this grid size\n\n"
+ for(var i = 0; i < rs.rows.length; i++){
+ r += (i+1)+". " + rs.rows.item(i).name +' got '
+ + rs.rows.item(i).score + ' points in '
+ + rs.rows.item(i).time + ' seconds.\n';
+ }
+ dialog.show(r);
+ }
+ );
+}
+
+function sendHighScore(name) {
+ var postman = new XMLHttpRequest()
+ var postData = "name="+name+"&score="+gameCanvas.score
+ +"&gridSize="+maxColumn+"x"+maxRow +"&time="+Math.floor(gameDuration/1000);
+ postman.open("POST", scoresURL, true);
+ postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ postman.onreadystatechange = function() {
+ if (postman.readyState == postman.DONE) {
+ dialog.show("Your score has been uploaded.");
+ }
+ }
+ postman.send(postData);
+}
diff --git a/examples/declarative/demos/samegame/qml/highscores/README b/examples/declarative/demos/samegame/qml/highscores/README
new file mode 100644
index 0000000000..eaa00fae37
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/highscores/README
@@ -0,0 +1 @@
+The SameGame example can interface with a simple PHP script to store XML high score data on a remote server. We do not have a publically accessible server available for this use, but if you have access to a PHP capable webserver you can copy the files (score_data.xml, score.php, score_style.xsl) to it and alter the highscore_server variable at the top of the samegame.js file to point to it.
diff --git a/examples/declarative/demos/samegame/qml/highscores/score_data.xml b/examples/declarative/demos/samegame/qml/highscores/score_data.xml
new file mode 100644
index 0000000000..c3fd90d9cf
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/highscores/score_data.xml
@@ -0,0 +1,2 @@
+<record><score>1000000</score><name>Alan the Tester</name><gridSize>0x0</gridSize><seconds>0</seconds></record>
+<record><score>6213</score><name>Alan</name><gridSize>12x17</gridSize><seconds>51</seconds></record>
diff --git a/examples/declarative/demos/samegame/qml/highscores/score_style.xsl b/examples/declarative/demos/samegame/qml/highscores/score_style.xsl
new file mode 100644
index 0000000000..670354c965
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/highscores/score_style.xsl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:template match="/">
+ <html>
+ <head><title>SameGame High Scores</title></head>
+ <body>
+ <h2>SameGame High Scores</h2>
+ <table border="1">
+ <tr bgcolor="lightsteelblue">
+ <th>Name</th>
+ <th>Score</th>
+ <th>Grid Size</th>
+ <th>Time, s</th>
+ </tr>
+ <xsl:for-each select="records/record">
+ <xsl:sort select="score" data-type="number" order="descending"/>
+ <tr>
+ <td><xsl:value-of select="name"/></td>
+ <td><xsl:value-of select="score"/></td>
+ <td><xsl:value-of select="gridSize"/></td>
+ <td><xsl:value-of select="seconds"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/examples/declarative/demos/samegame/qml/highscores/scores.php b/examples/declarative/demos/samegame/qml/highscores/scores.php
new file mode 100644
index 0000000000..3cceb2d738
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/highscores/scores.php
@@ -0,0 +1,34 @@
+<?php
+ $score = $_POST["score"];
+ echo "<html>";
+ echo "<head><title>SameGame High Scores</title></head><body>";
+ if($score > 0){#Sending in a new high score
+ $name = $_POST["name"];
+ $grid = $_POST["gridSize"];
+ $time = $_POST["time"];
+ if($name == "")
+ $name = "Anonymous";
+ //if($grid != "10x10"){
+ //Need a standard, so as to reject others?
+ //}
+ $file = fopen("score_data.xml", "a"); #It's XML. Happy?
+ $ret = fwrite($file, "<record><score>". $score . "</score><name>"
+ . $name . "</name><gridSize>" . $grid . "</gridSize><seconds>"
+ . $time . "</seconds></record>\n");
+ echo "Your score has been recorded. Thanks for playing!";
+ if($ret == False)
+ echo "<br/> There was an error though, so don't expect to see that score again.";
+ }else{#Read high score list
+ #Now uses XSLT to display. So just print the file. With XML cruft added.
+ #Note that firefox at least won't apply the XSLT on a php file. So redirecting
+ $file = fopen("scores.xml", "w");
+ $ret = fwrite($file, '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"
+ . '<?xml-stylesheet type="text/xsl" href="score_style.xsl"?>' . "\n"
+ . "<records>\n" . file_get_contents("score_data.xml") . "</records>\n");
+ if($ret == False)
+ echo "There was an internal error. Sorry.";
+ else
+ echo '<script type="text/javascript">window.location.replace("scores.xml")</script>';
+ }
+ echo "</body></html>";
+?>
diff --git a/examples/declarative/demos/samegame/qml/samegame.qml b/examples/declarative/demos/samegame/qml/samegame.qml
new file mode 100644
index 0000000000..ab49c04f22
--- /dev/null
+++ b/examples/declarative/demos/samegame/qml/samegame.qml
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "SamegameCore"
+import "SamegameCore/samegame.js" as Logic
+
+Rectangle {
+ id: screen
+ width: 490; height: 720
+ property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos
+
+ SystemPalette { id: activePalette }
+
+ Item {
+ width: parent.width
+ anchors { top: parent.top; bottom: toolBar.top }
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "SamegameCore/pics/background.png"
+ fillMode: Image.PreserveAspectCrop
+ }
+
+ Item {
+ id: gameCanvas
+ property int score: 0
+ property int blockSize: 40
+
+ z: 20; anchors.centerIn: parent
+ width: parent.width - (parent.width % blockSize);
+ height: parent.height - (parent.height % blockSize);
+
+ MouseArea {
+ anchors.fill: parent; onClicked: Logic.handleClick(mouse.x,mouse.y);
+ }
+ }
+ }
+
+ Dialog { id: dialog; anchors.centerIn: parent; z: 21 }
+
+ Dialog {
+ id: nameInputDialog
+
+ property int initialWidth: 0
+ property alias name: nameInputText.text
+
+ anchors.centerIn: parent
+ z: 22;
+
+ Behavior on width {
+ NumberAnimation {}
+ enabled: nameInputDialog.initialWidth != 0
+ }
+
+ onClosed: {
+ if (nameInputText.text != "")
+ Logic.saveHighScore(nameInputText.text);
+ }
+ Text {
+ id: dialogText
+ anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter }
+ text: "You won! Please enter your name: "
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (nameInputText.text == "")
+ nameInputText.openSoftwareInputPanel();
+ else
+ nameInputDialog.forceClose();
+ }
+ }
+
+ TextInput {
+ id: nameInputText
+ anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }
+ focus: visible
+ autoScroll: false
+ maximumLength: 24
+ onTextChanged: {
+ var newWidth = nameInputText.width + dialogText.width + 40;
+ if ( (newWidth > nameInputDialog.width && newWidth < screen.width)
+ || (nameInputDialog.width > nameInputDialog.initialWidth) )
+ nameInputDialog.width = newWidth;
+ }
+ onAccepted: {
+ nameInputDialog.forceClose();
+ }
+ }
+ }
+
+ Rectangle {
+ id: toolBar
+ width: parent.width; height: 58
+ color: activePalette.window
+ anchors.bottom: screen.bottom
+
+ Button {
+ id: newGameButton
+ anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ text: "New Game"
+ onClicked: Logic.startNewGame()
+ }
+
+ Button {
+ visible: !inAnotherDemo
+ text: "Quit"
+ anchors { left: newGameButton.right; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ onClicked: Qt.quit();
+ }
+
+ Text {
+ id: score
+ anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter }
+ text: "Score: " + gameCanvas.score
+ font.bold: true
+ font.pixelSize: 24
+ color: activePalette.windowText
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/keyinteraction.qmlproject b/examples/declarative/demos/samegame/qml/samegame.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/keyinteraction/keyinteraction.qmlproject
+++ b/examples/declarative/demos/samegame/qml/samegame.qmlproject
diff --git a/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/samegame/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/samegame/samegame.desktop b/examples/declarative/demos/samegame/samegame.desktop
new file mode 100644
index 0000000000..e9e79c60b5
--- /dev/null
+++ b/examples/declarative/demos/samegame/samegame.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=samegame
+Exec=/opt/usr/bin/samegame
+Icon=samegame
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/samegame/samegame.png b/examples/declarative/demos/samegame/samegame.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/samegame/samegame.png
Binary files differ
diff --git a/examples/declarative/demos/samegame/samegame.pro b/examples/declarative/demos/samegame/samegame.pro
new file mode 100644
index 0000000000..ac548d524f
--- /dev/null
+++ b/examples/declarative/demos/samegame/samegame.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE6438E92
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/samegame/samegame.svg b/examples/declarative/demos/samegame/samegame.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/samegame/samegame.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/demos/twitter/main.cpp b/examples/declarative/demos/twitter/main.cpp
new file mode 100644
index 0000000000..7d868d5686
--- /dev/null
+++ b/examples/declarative/demos/twitter/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/twitter.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/Button.qml b/examples/declarative/demos/twitter/qml/TwitterCore/Button.qml
new file mode 100644
index 0000000000..a1fc2a288f
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/Button.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ signal clicked
+
+ property string text
+ property bool keyUsing: false
+
+ BorderImage {
+ id: buttonImage
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ BorderImage {
+ id: pressed
+ opacity: 0
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ MouseArea {
+ id: mouseRegion
+ anchors.fill: buttonImage
+ onClicked: { container.clicked(); }
+ }
+ Text {
+ id: btnText
+ color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";}
+ anchors.centerIn: buttonImage; font.bold: true
+ text: container.text; style: Text.Raised; styleColor: "black"
+ font.pixelSize: 12
+ }
+ states: [
+ State {
+ name: "Pressed"
+ when: mouseRegion.pressed == true
+ PropertyChanges { target: pressed; opacity: 1 }
+ },
+ State {
+ name: "Focused"
+ when: container.activeFocus == true
+ PropertyChanges { target: btnText; color: "#FFFFFF" }
+ }
+ ]
+ transitions: Transition {
+ ColorAnimation { target: btnText; }
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml b/examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml
new file mode 100644
index 0000000000..896abbe7b2
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/FatDelegate.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Component {
+ id: listDelegate
+ Item {
+ id: wrapper; width: wrapper.ListView.view.width; height: if(txt.height > 60){txt.height+10}else{60} //50+5+5
+ function handleLink(link){
+ if(link.slice(0,3) == 'app'){
+ screen.setUser(link.slice(7));
+ }else if(link.slice(0,4) == 'http'){
+ Qt.openUrlExternally(link);
+ }
+ }
+ function addTags(str){
+ var ret = str.replace(/@[a-zA-Z0-9_]+/g, '<a href="app://$&">$&</a>');//click to jump to user?
+ var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '<a href="$&">$&</a>');//surrounds http links with html link tags
+ return ret2;
+ }
+
+ // Strip away paranthesis
+ function userName(str) {
+ var user = str.replace(/\([\S|\s]*\)/gi, "");
+ return user.trim();
+ }
+
+ Item {
+ id: moveMe; height: parent.height
+ Rectangle {
+ id: blackRect
+ color: "black"; opacity: wrapper.ListView.index % 2 ? 0.2 : 0.3; height: wrapper.height-2; width: wrapper.width; y: 1
+ }
+ Item {
+ id: image; x: 6; width: 48; height: 48; smooth: true
+ anchors.verticalCenter: parent.verticalCenter
+
+ Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != Image.Ready }
+ Image {
+ id: realImage;
+ source: userImage; x: 1; y: 1;
+ width:48; height:48; opacity:0 ;
+ onStatusChanged: {
+ if(status==Image.Ready)
+ image.state="loaded"
+ }
+ }
+ states: State {
+ name: "loaded";
+ PropertyChanges { target: realImage ; opacity:1 }
+ }
+ transitions: Transition { NumberAnimation { target: realImage; property: "opacity"; duration: 200 } }
+
+ }
+ Text { id:txt; y:4; x: 56
+ text: '<html><style type="text/css">a:link {color:"#aaccaa"}; a:visited {color:"#336633"}</style>'
+ + '<a href="app://@'+userName(name)+'"><b>'+userName(name) + "</b></a> from " +source
+ + "<br /><b>" + statusText + "</b></html>";
+ textFormat: Qt.RichText
+ color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap
+ anchors.left: image.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6
+ onLinkActivated: wrapper.handleLink(link)
+ }
+ }
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/Input.qml b/examples/declarative/demos/twitter/qml/TwitterCore/Input.qml
new file mode 100644
index 0000000000..b15f0d540f
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/Input.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id:container
+ width: 220
+ height: 28
+ BorderImage { source: "images/lineedit.sci"; anchors.fill: parent }
+ signal accepted
+ property alias text: input.text
+ property alias item:input
+ TextInput{
+ id: input
+ width: parent.width - 12
+ anchors.centerIn: parent
+ maximumLength:21
+ font.pixelSize: 16;
+ font.bold: true
+ color: "#151515"; selectionColor: "mediumseagreen"
+ focus: true
+ onAccepted:{container.accepted()}
+ text: ""
+ selectByMouse: true
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml b/examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml
new file mode 100644
index 0000000000..afeafa0738
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/Loading.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: loading; source: "images/loading.png"
+ NumberAnimation on rotation {
+ from: 0; to: 360; running: loading.visible == true; loops: Animation.Infinite; duration: 900
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml b/examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml
new file mode 100644
index 0000000000..bc8e0de64c
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/MultiTitleBar.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ TitleBar { id: titleBar; width: parent.width; height: 60;
+ y: -80
+ untaggedString: "Latest tweets from everyone"
+ taggedString: "Latest tweets from "
+ }
+ states: [
+ State {
+ name: "search"; when: screen.state!="search"
+ PropertyChanges { target: titleBar; y: 0 }
+ }
+ ]
+ transitions: [
+ Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } }
+ ]
+}
+
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml b/examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml
new file mode 100644
index 0000000000..276df62037
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/RssModel.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item { id: wrapper
+ property variant model: xmlModel
+ property string from : ""
+ property string to : ""
+ property string phrase : ""
+
+ property string mode : "everyone"
+ property int status: xmlModel.status
+ function reload() { xmlModel.reload(); }
+ XmlListModel {
+ id: xmlModel
+
+ source: (from=="" && to=="" && phrase=="") ? "" :
+ 'http://search.twitter.com/search.atom?from='+from+"&to="+to+"&phrase="+phrase
+
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom'; " +
+ "declare namespace twitter=\"http://api.twitter.com/\";";
+
+ query: "/feed/entry"
+
+ XmlRole { name: "statusText"; query: "content/string()" }
+ XmlRole { name: "timestamp"; query: "published/string()" }
+ XmlRole { name: "source"; query: "twitter:source/string()" }
+ XmlRole { name: "name"; query: "author/name/string()" }
+ XmlRole { name: "userImage"; query: "link[@rel = 'image']/@href/string()" }
+
+ }
+ Binding {
+ property: "mode"
+ target: wrapper
+ value: {if(wrapper.tags==''){"everyone";}else if(wrapper.tags=='my timeline'){"self";}else{"user";}}
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml b/examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml
new file mode 100644
index 0000000000..effab301ea
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/SearchView.qml
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id: wrapper
+ Column {
+ anchors.centerIn: parent
+ spacing: 20
+ Column{
+ spacing: 4
+ Text {
+ text: "Posted by:"
+ font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black"
+ horizontalAlignment: Qt.AlignRight
+ }
+ Input{
+ id: fromIn
+ KeyNavigation.backtab: searchbutton
+ KeyNavigation.tab:toIn
+ onAccepted:searchbutton.doSearch();
+ focus: true
+ }
+ Text {
+ text: "In reply to:"
+ font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black"
+ horizontalAlignment: Qt.AlignRight
+ }
+ Input{
+ id: toIn
+ KeyNavigation.backtab: fromIn
+ KeyNavigation.tab:phraseIn
+ onAccepted:searchbutton.doSearch();
+ }
+ Text {
+ text: "Search phrase:"
+ font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black"
+ horizontalAlignment: Qt.AlignRight
+ }
+ Input{
+ id: phraseIn
+ KeyNavigation.backtab: toIn
+ KeyNavigation.tab:searchbutton
+ onAccepted:searchbutton.doSearch();
+ text: "Qt Quick"
+ }
+ }
+ Button {
+ width: 100
+ height: 32
+ id: searchbutton
+ keyUsing: true;
+ opacity: 1
+ text: "Search"
+ KeyNavigation.tab: fromIn
+ Keys.onReturnPressed: searchbutton.doSearch();
+ Keys.onEnterPressed: searchbutton.doSearch();
+ Keys.onSelectPressed: searchbutton.doSearch();
+ Keys.onSpacePressed: searchbutton.doSearch();
+ onClicked: searchbutton.doSearch();
+
+ function doSearch() {
+ // Search ! allowed
+ if (wrapper.state=="invalidinput")
+ return;
+
+ rssModel.from=fromIn.text;
+ rssModel.to= toIn.text;
+ rssModel.phrase = phraseIn.text;
+ screen.focus = true;
+ screen.state = ""
+ }
+ }
+ }
+ states:
+ State {
+ name: "invalidinput"
+ when: fromIn.text=="" && toIn.text=="" && phraseIn.text==""
+ PropertyChanges { target: searchbutton ; opacity: 0.6 ; }
+ }
+ transitions:
+ Transition {
+ NumberAnimation { target: searchbutton; property: "opacity"; duration: 200 }
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml b/examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml
new file mode 100644
index 0000000000..19da491968
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/TitleBar.qml
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: titleBar
+ property string untaggedString: "Uploads from everyone"
+ property string taggedString: "Recent uploads tagged "
+
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Item {
+ id: container
+ width: (parent.width * 2) - 55 ; height: parent.height
+
+ function accept() {
+ titleBar.state = ""
+ background.state = ""
+ rssModel.tags = editor.text
+ }
+
+ Item {
+ id:imageBox
+ x: 6; width: 0; height: 50; smooth: true
+ anchors.verticalCenter: parent.verticalCenter
+
+ UserModel { user: rssModel.from; id: userModel }
+ Component {
+ id: imgDelegate;
+ Item {
+ id:imageitem
+ visible:true
+ Loading { width:48; height:48; visible: realImage.status != Image.Ready }
+ Image { id: realImage; source: image; width:48; height:48; opacity:0; }
+ states:
+ State {
+ name: "loaded"
+ when: (realImage.status == Image.Ready)
+ PropertyChanges { target: realImage; opacity:1 }
+ }
+ transitions: Transition {
+ NumberAnimation { target: realImage; property: "opacity"; duration: 200 }
+ }
+ }
+ }
+ ListView { id:view; model: userModel.model; x:1; y:1; delegate: imgDelegate }
+ states:
+ State {
+ when: !userModel.user==""
+ PropertyChanges { target: imageBox; width: 50; }
+ }
+ transitions:
+ Transition {
+ NumberAnimation { target: imageBox; property: "width"; duration: 200 }
+ }
+ }
+
+ Image {
+ id: quitButton
+ x: 5
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
+ Text {
+ id: categoryText
+ anchors {
+ left: quitButton.right; right: parent.right; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ elide: Text.ElideLeft
+ text: (rssModel.from=="" ? untaggedString : taggedString + rssModel.from)
+ font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black"
+ font.pixelSize: 12
+ }
+ }
+
+ states: State {
+ name: "Tags"
+ PropertyChanges { target: container; x: -tagButton.x + 5 }
+ PropertyChanges { target: editor; focus: true }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml b/examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml
new file mode 100644
index 0000000000..4ef92ffe57
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/ToolBar.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: toolbar
+
+ property alias button1Label: button1.text
+ property alias button2Label: button2.text
+ signal button1Clicked
+ signal button2Clicked
+ focus:true
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+ Button {
+ id: button1
+ anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32
+ onClicked: toolbar.button1Clicked()
+ focus:true
+ }
+ Button {
+ id: button2
+ anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32
+ onClicked: toolbar.button2Clicked()
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml b/examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml
new file mode 100644
index 0000000000..013b8275af
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/UserModel.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//This "model" gets the user information about the searched user. Mainly for the icon.
+
+Item { id: wrapper
+ property variant model: xmlModel
+ property string user : ""
+ property int status: xmlModel.status
+ function reload() { xmlModel.reload(); }
+ XmlListModel {
+ id: xmlModel
+
+ source: user!= "" ? "http://twitter.com/users/show.xml?screen_name="+user : ""
+ query: "/user"
+
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "screenName"; query: "screen_name/string()" }
+ XmlRole { name: "image"; query: "profile_image_url/string()" }
+ XmlRole { name: "location"; query: "location/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ XmlRole { name: "followers"; query: "followers_count/string()" }
+ //TODO: Could also get the user's color scheme, timezone and a few other things
+ }
+}
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png
new file mode 100644
index 0000000000..5d370cd93d
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/gloss.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png
new file mode 100644
index 0000000000..2cc38dc35b
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci
new file mode 100644
index 0000000000..054bff78be
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/lineedit.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 10
+border.bottom: 10
+border.right: 10
+source: lineedit.png
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png
new file mode 100644
index 0000000000..47a1589c5d
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/loading.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png
new file mode 100644
index 0000000000..5bda1b6e0d
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/quit.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png
new file mode 100644
index 0000000000..9f36727ea4
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/stripes.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png
new file mode 100644
index 0000000000..51c90082d0
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci
new file mode 100644
index 0000000000..0418d94cd6
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/titlebar.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png
new file mode 100644
index 0000000000..11310013ee
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci
new file mode 100644
index 0000000000..9e4f965307
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/images/toolbutton.sci
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton.png
diff --git a/examples/declarative/demos/twitter/qml/TwitterCore/qmldir b/examples/declarative/demos/twitter/qml/TwitterCore/qmldir
new file mode 100644
index 0000000000..84d85c2885
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/TwitterCore/qmldir
@@ -0,0 +1,10 @@
+SearchView 1.0 SearchView.qml
+Button 1.0 Button.qml
+Input 1.0 Input.qml
+FatDelegate 1.0 FatDelegate.qml
+Loading 1.0 Loading.qml
+MultiTitleBar 1.0 MultiTitleBar.qml
+TitleBar 1.0 TitleBar.qml
+RssModel 1.0 RssModel.qml
+UserModel 1.0 UserModel.qml
+ToolBar 1.0 ToolBar.qml
diff --git a/examples/declarative/demos/twitter/qml/twitter.qml b/examples/declarative/demos/twitter/qml/twitter.qml
new file mode 100644
index 0000000000..74bab37ecb
--- /dev/null
+++ b/examples/declarative/demos/twitter/qml/twitter.qml
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "TwitterCore" 1.0 as Twitter
+
+Item {
+ id: screen; width: 320; height: 480
+ property bool userView : false
+ property variant tmpStr
+ function setUser(str){hack.running = true; tmpStr = str}
+ function reallySetUser(){rssModel.from = tmpStr;rssModel.to = ""; rssModel.phrase = ""}
+ state:"searchquery"
+ //Workaround for bug 260266
+ Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack }
+ Keys.onEscapePressed: screen.state="searchquery"
+ Keys.onBacktabPressed: screen.state="searchquery"
+ Rectangle {
+ id: background
+ anchors.fill: parent; color: "#343434";
+
+ state:"searchquery"
+ Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: screen.focus = false;
+ }
+
+ Twitter.RssModel { id: rssModel }
+ Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'}
+ Text {
+ width: 180
+ text: "Could not access twitter using this screen name and password pair.";
+ color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap
+ visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent
+ }
+
+ Item {
+ id: views
+ x: 2; width: parent.width - 4
+ y:60 //Below the title bars
+ height: parent.height - 100
+
+ Text {
+ id:title
+ text: "Search Twitter"
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.pixelSize: 20; font.bold: true; color: "#bbb"; style: Text.Raised; styleColor: "black"
+ opacity:0
+ }
+
+ Twitter.SearchView{
+ id: searchView
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width; height: parent.height-60;
+ x: -(screen.width * 1.5)
+ }
+
+ Twitter.FatDelegate { id: fatDelegate }
+ ListView {
+ id: mainView; model: rssModel.model; delegate: fatDelegate;
+ width: parent.width; height: parent.height; x: 0; cacheBuffer: 100;
+ }
+ }
+
+ Twitter.MultiTitleBar { id: titleBar; width: parent.width }
+ Twitter.ToolBar { id: toolBar; height: 40;
+ //anchors.bottom: parent.bottom;
+ //TODO: Use anchor changes instead of hard coding
+ y: screen.height - 40
+ width: parent.width; opacity: 0.9
+ button1Label: "New Search"
+ button2Label: "Update"
+ onButton1Clicked:
+ {
+ screen.state="searchquery"
+ }
+ onButton2Clicked: rssModel.reload();
+ }
+ }
+ states: [
+ State {
+ name: "searchquery";
+ PropertyChanges { target: searchView; x: 0; focus:true}
+ PropertyChanges { target: mainView; x: -(parent.width * 1.5) }
+ PropertyChanges { target: titleBar; y: -80 }
+ PropertyChanges { target: toolBar; y: screen.height }
+ PropertyChanges { target: toolBar }
+ PropertyChanges { target: title; opacity:1}
+ }
+ ]
+ transitions: [
+ Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutQuad } }
+ ]
+}
diff --git a/examples/declarative/modelviews/modelviews.qmlproject b/examples/declarative/demos/twitter/qml/twitter.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/modelviews/modelviews.qmlproject
+++ b/examples/declarative/demos/twitter/qml/twitter.qmlproject
diff --git a/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/twitter/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/twitter/twitter.desktop b/examples/declarative/demos/twitter/twitter.desktop
new file mode 100644
index 0000000000..afe52c5e6c
--- /dev/null
+++ b/examples/declarative/demos/twitter/twitter.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=twitter
+Exec=/opt/usr/bin/twitter
+Icon=twitter
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/twitter/twitter.png b/examples/declarative/demos/twitter/twitter.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/twitter/twitter.png
Binary files differ
diff --git a/examples/declarative/demos/twitter/twitter.pro b/examples/declarative/demos/twitter/twitter.pro
new file mode 100644
index 0000000000..253e5db7e5
--- /dev/null
+++ b/examples/declarative/demos/twitter/twitter.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE49225BD
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/twitter/twitter.svg b/examples/declarative/demos/twitter/twitter.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/twitter/twitter.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/demos/webbrowser/main.cpp b/examples/declarative/demos/webbrowser/main.cpp
new file mode 100644
index 0000000000..6518c3341e
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/webbrowser.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/demos/webbrowser/qml/content/Button.qml b/examples/declarative/demos/webbrowser/qml/content/Button.qml
new file mode 100644
index 0000000000..2da1c117a9
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/Button.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property alias image: icon.source
+ property variant action
+
+ signal clicked
+
+ width: 40; height: parent.height
+
+ Image {
+ id: icon; anchors.centerIn: parent
+ opacity: if (action != undefined) { action.enabled ? 1.0 : 0.4 } else 1
+ }
+
+ MouseArea {
+ anchors { fill: parent; topMargin: -10; bottomMargin: -10 }
+ onClicked: {
+ if (action != undefined)
+ action.trigger()
+ parent.clicked()
+ }
+ }
+}
diff --git a/examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml b/examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml
new file mode 100644
index 0000000000..6f4e09c522
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/FlickableWebView.qml
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Flickable {
+ property alias title: webView.title
+ property alias icon: webView.icon
+ property alias progress: webView.progress
+ property alias url: webView.url
+ property alias back: webView.back
+ property alias stop: webView.stop
+ property alias reload: webView.reload
+ property alias forward: webView.forward
+
+ id: flickable
+ width: parent.width
+ contentWidth: Math.max(parent.width,webView.width)
+ contentHeight: Math.max(parent.height,webView.height)
+ anchors.top: headerSpace.bottom
+ anchors.bottom: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ pressDelay: 200
+
+ onWidthChanged : {
+ // Expand (but not above 1:1) if otherwise would be smaller that available width.
+ if (width > webView.width*webView.contentsScale && webView.contentsScale < 1.0)
+ webView.contentsScale = width / webView.width * webView.contentsScale;
+ }
+
+ WebView {
+ id: webView
+ transformOrigin: Item.TopLeft
+
+ function fixUrl(url)
+ {
+ if (url == "") return url
+ if (url[0] == "/") return "file://"+url
+ if (url.indexOf(":")<0) {
+ if (url.indexOf(".")<0 || url.indexOf(" ")>=0) {
+ // Fall back to a search engine; hard-code Wikipedia
+ return "http://en.wikipedia.org/w/index.php?search="+url
+ } else {
+ return "http://"+url
+ }
+ }
+ return url
+ }
+
+ url: fixUrl(webBrowser.urlString)
+ smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
+ focus: true
+
+ onAlert: console.log(message)
+
+ function doZoom(zoom,centerX,centerY)
+ {
+ if (centerX) {
+ var sc = zoom*contentsScale;
+ scaleAnim.to = sc;
+ flickVX.from = flickable.contentX
+ flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width))
+ finalX.value = flickVX.to
+ flickVY.from = flickable.contentY
+ flickVY.to = Math.max(0,Math.min(centerY-flickable.height/2,webView.height*sc-flickable.height))
+ finalY.value = flickVY.to
+ quickZoom.start()
+ }
+ }
+
+ Keys.onLeftPressed: webView.contentsScale -= 0.1
+ Keys.onRightPressed: webView.contentsScale += 0.1
+
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
+ contentsScale: 1
+ onContentsSizeChanged: {
+ // zoom out
+ contentsScale = Math.min(1,flickable.width / contentsSize.width)
+ }
+ onUrlChanged: {
+ // got to topleft
+ flickable.contentX = 0
+ flickable.contentY = 0
+ if (url != null) { header.editUrl = url.toString(); }
+ }
+ onDoubleClick: {
+ if (!heuristicZoom(clickX,clickY,2.5)) {
+ var zf = flickable.width / contentsSize.width
+ if (zf >= contentsScale)
+ zf = 2.0/zoomFactor // zoom in (else zooming out)
+ doZoom(zf,clickX*zf,clickY*zf)
+ }
+ }
+
+ SequentialAnimation {
+ id: quickZoom
+
+ PropertyAction {
+ target: webView
+ property: "renderingEnabled"
+ value: false
+ }
+ ParallelAnimation {
+ NumberAnimation {
+ id: scaleAnim
+ target: webView
+ property: "contentsScale"
+ // the to property is set before calling
+ easing.type: Easing.Linear
+ duration: 200
+ }
+ NumberAnimation {
+ id: flickVX
+ target: flickable
+ property: "contentX"
+ easing.type: Easing.Linear
+ duration: 200
+ from: 0 // set before calling
+ to: 0 // set before calling
+ }
+ NumberAnimation {
+ id: flickVY
+ target: flickable
+ property: "contentY"
+ easing.type: Easing.Linear
+ duration: 200
+ from: 0 // set before calling
+ to: 0 // set before calling
+ }
+ }
+ // Have to set the contentXY, since the above 2
+ // size changes may have started a correction if
+ // contentsScale < 1.0.
+ PropertyAction {
+ id: finalX
+ target: flickable
+ property: "contentX"
+ value: 0 // set before calling
+ }
+ PropertyAction {
+ id: finalY
+ target: flickable
+ property: "contentY"
+ value: 0 // set before calling
+ }
+ PropertyAction {
+ target: webView
+ property: "renderingEnabled"
+ value: true
+ }
+ }
+ onZoomTo: doZoom(zoom,centerX,centerY)
+ }
+}
diff --git a/examples/declarative/demos/webbrowser/qml/content/Header.qml b/examples/declarative/demos/webbrowser/qml/content/Header.qml
new file mode 100644
index 0000000000..88e30002e0
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/Header.qml
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: header
+
+ property alias editUrl: urlInput.url
+ property bool urlChanged: false
+
+ source: "pics/titlebar-bg.png"; fillMode: Image.TileHorizontally
+
+ x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
+ ? -webView.contentX+webView.contentWidth-webView.width : 0
+ y: {
+ if (webView.progress < 1.0)
+ return 0;
+ else {
+ webView.contentY < 0 ? -webView.contentY : webView.contentY > height ? -height : -webView.contentY
+ }
+ }
+ Column {
+ width: parent.width
+
+ Item {
+ width: parent.width; height: 20
+ Text {
+ anchors.centerIn: parent
+ text: webView.title; font.pixelSize: 14; font.bold: true
+ color: "white"; styleColor: "black"; style: Text.Sunken
+ }
+ }
+
+ Item {
+ width: parent.width; height: 40
+
+ Button {
+ id: backButton
+ action: webView.back; image: "pics/go-previous-view.png"
+ anchors { left: parent.left; bottom: parent.bottom }
+ }
+
+ Button {
+ id: nextButton
+ anchors.left: backButton.right
+ action: webView.forward; image: "pics/go-next-view.png"
+ }
+
+ UrlInput {
+ id: urlInput
+ anchors { left: nextButton.right; right: reloadButton.left }
+ image: "pics/display.png"
+ onUrlEntered: {
+ webBrowser.urlString = url
+ webBrowser.focus = true
+ header.urlChanged = false
+ }
+ onUrlChanged: header.urlChanged = true
+ }
+
+ Button {
+ id: reloadButton
+ anchors { right: quitButton.left; rightMargin: 10 }
+ action: webView.reload; image: "pics/view-refresh.png"
+ visible: webView.progress == 1.0 && !header.urlChanged
+ }
+ Text {
+ id: quitButton
+ color: "white"
+ style: Text.Sunken
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 18
+ width: 60
+ text: "Quit"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ Rectangle {
+ width: 1
+ y: 5
+ height: parent.height-10
+ anchors.right: parent.left
+ color: "darkgray"
+ }
+ }
+
+ Button {
+ id: stopButton
+ anchors { right: quitButton.left; rightMargin: 10 }
+ action: webView.stop; image: "pics/edit-delete.png"
+ visible: webView.progress < 1.0 && !header.urlChanged
+ }
+
+ Button {
+ id: goButton
+ anchors { right: parent.right; rightMargin: 4 }
+ onClicked: {
+ webBrowser.urlString = urlInput.url
+ webBrowser.focus = true
+ header.urlChanged = false
+ }
+ image: "pics/go-jump-locationbar.png"; visible: header.urlChanged
+ }
+ }
+ }
+}
diff --git a/examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml b/examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml
new file mode 100644
index 0000000000..19309fad58
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/ScrollBar.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property variant scrollArea
+ property variant orientation: Qt.Vertical
+
+ opacity: 0
+
+ function position()
+ {
+ var ny = 0;
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+ if (ny > 2) return ny; else return 2;
+ }
+
+ function size()
+ {
+ var nh, ny;
+
+ if (container.orientation == Qt.Vertical)
+ nh = scrollArea.visibleArea.heightRatio * container.height;
+ else
+ nh = scrollArea.visibleArea.widthRatio * container.width;
+
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+
+ if (ny > 3) {
+ var t;
+ if (container.orientation == Qt.Vertical)
+ t = Math.ceil(container.height - 3 - ny);
+ else
+ t = Math.ceil(container.width - 3 - ny);
+ if (nh > t) return t; else return nh;
+ } else return nh + ny;
+ }
+
+ Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.5 }
+
+ BorderImage {
+ source: "pics/scrollbar.png"
+ border { left: 1; right: 1; top: 1; bottom: 1 }
+ x: container.orientation == Qt.Vertical ? 2 : position()
+ width: container.orientation == Qt.Vertical ? container.width - 4 : size()
+ y: container.orientation == Qt.Vertical ? position() : 2
+ height: container.orientation == Qt.Vertical ? size() : container.height - 4
+ }
+
+ states: State {
+ name: "visible"
+ when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
+ PropertyChanges { target: container; opacity: 1.0 }
+ }
+
+ transitions: Transition {
+ from: "visible"; to: ""
+ NumberAnimation { properties: "opacity"; duration: 600 }
+ }
+}
diff --git a/examples/declarative/demos/webbrowser/qml/content/UrlInput.qml b/examples/declarative/demos/webbrowser/qml/content/UrlInput.qml
new file mode 100644
index 0000000000..0468b64b5f
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/UrlInput.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias image: bg.source
+ property alias url: urlText.text
+
+ signal urlEntered(string url)
+ signal urlChanged
+
+ width: parent.height; height: parent.height
+
+ BorderImage {
+ id: bg; rotation: 180
+ x: 8; width: parent.width - 16; height: 30;
+ anchors.verticalCenter: parent.verticalCenter
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ }
+
+ Rectangle {
+ anchors.bottom: bg.bottom
+ x: 18; height: 4; color: "#63b1ed"
+ width: (bg.width - 20) * webView.progress
+ opacity: webView.progress == 1.0 ? 0.0 : 1.0
+ }
+
+ TextInput {
+ id: urlText
+ horizontalAlignment: TextEdit.AlignLeft
+ font.pixelSize: 14;
+
+ onTextChanged: container.urlChanged()
+
+ Keys.onEscapePressed: {
+ urlText.text = webView.url
+ webView.focus = true
+ }
+
+ Keys.onEnterPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+
+ Keys.onReturnPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18
+ verticalCenter: parent.verticalCenter
+ }
+ }
+}
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/display.png b/examples/declarative/demos/webbrowser/qml/content/pics/display.png
new file mode 100644
index 0000000000..9507f4382e
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/display.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png b/examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png
new file mode 100644
index 0000000000..df2a147d24
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/edit-delete.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png b/examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png
new file mode 100644
index 0000000000..61f779ce2b
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/go-jump-locationbar.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png b/examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png
new file mode 100644
index 0000000000..a585cab80c
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/go-next-view.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png b/examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png
new file mode 100644
index 0000000000..612fb34dce
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/go-previous-view.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png b/examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png
new file mode 100644
index 0000000000..0228dcf9eb
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/scrollbar.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png b/examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png
new file mode 100644
index 0000000000..06961e8d84
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/titlebar-bg.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png b/examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png
new file mode 100644
index 0000000000..afa2a9d774
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/content/pics/view-refresh.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/qml/webbrowser.qml b/examples/declarative/demos/webbrowser/qml/webbrowser.qml
new file mode 100644
index 0000000000..a21fa0b23b
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qml/webbrowser.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+import "content"
+
+Rectangle {
+ id: webBrowser
+
+ property string urlString : "http://www.nokia.com/"
+
+ width: 800; height: 600
+ color: "#343434"
+
+ FlickableWebView {
+ id: webView
+ url: webBrowser.urlString
+ onProgressChanged: header.urlChanged = false
+ anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom }
+ }
+
+ Item { id: headerSpace; width: parent.width; height: 62 }
+
+ Header {
+ id: header
+ editUrl: webBrowser.urlString
+ width: headerSpace.width; height: headerSpace.height
+ }
+
+ ScrollBar {
+ scrollArea: webView; width: 8
+ anchors { right: parent.right; top: header.bottom; bottom: parent.bottom }
+ }
+
+ ScrollBar {
+ scrollArea: webView; height: 8; orientation: Qt.Horizontal
+ anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom }
+ }
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject b/examples/declarative/demos/webbrowser/qml/webbrowser.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject
+++ b/examples/declarative/demos/webbrowser/qml/webbrowser.qmlproject
diff --git a/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/demos/webbrowser/webbrowser.desktop b/examples/declarative/demos/webbrowser/webbrowser.desktop
new file mode 100644
index 0000000000..26da1fe000
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/webbrowser.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=webbrowser
+Exec=/opt/usr/bin/webbrowser
+Icon=webbrowser
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/demos/webbrowser/webbrowser.png b/examples/declarative/demos/webbrowser/webbrowser.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/webbrowser.png
Binary files differ
diff --git a/examples/declarative/demos/webbrowser/webbrowser.pro b/examples/declarative/demos/webbrowser/webbrowser.pro
new file mode 100644
index 0000000000..580cc55451
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/webbrowser.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE1704EEA
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/demos/webbrowser/webbrowser.svg b/examples/declarative/demos/webbrowser/webbrowser.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/demos/webbrowser/webbrowser.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/i18n/i18n.desktop b/examples/declarative/i18n/i18n.desktop
new file mode 100644
index 0000000000..8dd6e345da
--- /dev/null
+++ b/examples/declarative/i18n/i18n.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=i18n
+Exec=/opt/usr/bin/i18n
+Icon=i18n
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/i18n/i18n.png b/examples/declarative/i18n/i18n.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/i18n/i18n.png
Binary files differ
diff --git a/examples/declarative/i18n/i18n.pro b/examples/declarative/i18n/i18n.pro
new file mode 100644
index 0000000000..184feabd9a
--- /dev/null
+++ b/examples/declarative/i18n/i18n.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE069582C
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/i18n/i18n.svg b/examples/declarative/i18n/i18n.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/i18n/i18n.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/i18n/i18n/qml_en_AU.qm b/examples/declarative/i18n/i18n/qml_en_AU.qm
deleted file mode 100644
index fb8b710349..0000000000
--- a/examples/declarative/i18n/i18n/qml_en_AU.qm
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/i18n/i18n/qml_fr.qm b/examples/declarative/i18n/i18n/qml_fr.qm
deleted file mode 100644
index 583562ecca..0000000000
--- a/examples/declarative/i18n/i18n/qml_fr.qm
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/i18n/main.cpp b/examples/declarative/i18n/main.cpp
new file mode 100644
index 0000000000..bc650f277a
--- /dev/null
+++ b/examples/declarative/i18n/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/i18n.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/i18n/qml/i18n.qml b/examples/declarative/i18n/qml/i18n.qml
new file mode 100644
index 0000000000..219deda894
--- /dev/null
+++ b/examples/declarative/i18n/qml/i18n.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//
+// The QML runtime automatically loads a translation from the i18n subdirectory of the root
+// QML file, based on the system language.
+//
+// The files are created/updated by running:
+//
+// lupdate i18n.qml -ts i18n/base.ts
+//
+// Translations for new languages are created by copying i18n/base.ts to i18n/qml_<lang>.ts
+// The .ts files can then be edited with Linguist:
+//
+// linguist i18n/qml_fr.ts
+//
+// The run-time translation files are then generaeted by running:
+//
+// lrelease i18n/*.ts
+//
+
+Rectangle {
+ width: 640; height: 480
+
+ Column {
+ anchors.fill: parent; spacing: 20
+
+ Text {
+ text: "If a translation is available for the system language (eg. French) then the
+ string below will translated (eg. 'Bonjour'). Otherwise it will show 'Hello'."
+ width: parent.width; wrapMode: Text.WordWrap
+ }
+
+ Text {
+ text: qsTr("Hello")
+ font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+}
diff --git a/examples/declarative/text/text.qmlproject b/examples/declarative/i18n/qml/i18n.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/text/text.qmlproject
+++ b/examples/declarative/i18n/qml/i18n.qmlproject
diff --git a/examples/declarative/i18n/i18n/base.ts b/examples/declarative/i18n/qml/i18n/base.ts
index 82547a1f93..82547a1f93 100644
--- a/examples/declarative/i18n/i18n/base.ts
+++ b/examples/declarative/i18n/qml/i18n/base.ts
diff --git a/examples/declarative/i18n/i18n/qml_en_AU.ts b/examples/declarative/i18n/qml/i18n/qml_en_AU.ts
index e991affe7f..e991affe7f 100644
--- a/examples/declarative/i18n/i18n/qml_en_AU.ts
+++ b/examples/declarative/i18n/qml/i18n/qml_en_AU.ts
diff --git a/examples/declarative/i18n/i18n/qml_fr.ts b/examples/declarative/i18n/qml/i18n/qml_fr.ts
index 365abd95c2..365abd95c2 100644
--- a/examples/declarative/i18n/i18n/qml_fr.ts
+++ b/examples/declarative/i18n/qml/i18n/qml_fr.ts
diff --git a/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/i18n/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/imageelements/borderimage/borderimage.desktop b/examples/declarative/imageelements/borderimage/borderimage.desktop
new file mode 100644
index 0000000000..35f4d2bb03
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=borderimage
+Exec=/opt/usr/bin/borderimage
+Icon=borderimage
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/imageelements/borderimage/borderimage.png b/examples/declarative/imageelements/borderimage/borderimage.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/borderimage.pro b/examples/declarative/imageelements/borderimage/borderimage.pro
new file mode 100644
index 0000000000..fd4967652e
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEBB4D123
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/imageelements/borderimage/borderimage.svg b/examples/declarative/imageelements/borderimage/borderimage.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/imageelements/borderimage/main.cpp b/examples/declarative/imageelements/borderimage/main.cpp
new file mode 100644
index 0000000000..c8a9b85b78
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/shadows.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage.qml b/examples/declarative/imageelements/borderimage/qml/borderimage.qml
new file mode 100644
index 0000000000..53e35f97e8
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: page
+ width: 1030; height: 540
+
+ Grid {
+ anchors.centerIn: parent; spacing: 20
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ }
+}
diff --git a/examples/declarative/text/textselection/textselection.qmlproject b/examples/declarative/imageelements/borderimage/qml/borderimage.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/text/textselection/textselection.qmlproject
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage.qmlproject
diff --git a/examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml b/examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml
new file mode 100644
index 0000000000..96495cbefa
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/content/MyBorderImage.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias horizontalMode: image.horizontalTileMode
+ property alias verticalMode: image.verticalTileMode
+ property alias source: image.source
+
+ property int minWidth
+ property int minHeight
+ property int maxWidth
+ property int maxHeight
+ property int margin
+
+ width: 240; height: 240
+
+ BorderImage {
+ id: image; anchors.centerIn: parent
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minWidth; to: container.maxWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxWidth; to: container.minWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minHeight; to: container.maxHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxHeight; to: container.minHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ border.top: container.margin
+ border.left: container.margin
+ border.bottom: container.margin
+ border.right: container.margin
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml b/examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml
new file mode 100644
index 0000000000..839ecf1177
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/content/ShadowRectangle.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property alias color : rectangle.color
+
+ BorderImage {
+ anchors.fill: rectangle
+ anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ source: "shadow.png"; smooth: true
+ }
+
+ Rectangle { id: rectangle; anchors.fill: parent }
+}
diff --git a/examples/declarative/imageelements/borderimage/content/bw.png b/examples/declarative/imageelements/borderimage/qml/content/bw.png
index 486eaae96e..486eaae96e 100644
--- a/examples/declarative/imageelements/borderimage/content/bw.png
+++ b/examples/declarative/imageelements/borderimage/qml/content/bw.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/content/colors-round.sci b/examples/declarative/imageelements/borderimage/qml/content/colors-round.sci
index 506f6f5f99..506f6f5f99 100644
--- a/examples/declarative/imageelements/borderimage/content/colors-round.sci
+++ b/examples/declarative/imageelements/borderimage/qml/content/colors-round.sci
diff --git a/examples/declarative/imageelements/borderimage/content/colors-stretch.sci b/examples/declarative/imageelements/borderimage/qml/content/colors-stretch.sci
index e4989a723c..e4989a723c 100644
--- a/examples/declarative/imageelements/borderimage/content/colors-stretch.sci
+++ b/examples/declarative/imageelements/borderimage/qml/content/colors-stretch.sci
diff --git a/examples/declarative/imageelements/borderimage/content/colors.png b/examples/declarative/imageelements/borderimage/qml/content/colors.png
index dfb62f3d64..dfb62f3d64 100644
--- a/examples/declarative/imageelements/borderimage/content/colors.png
+++ b/examples/declarative/imageelements/borderimage/qml/content/colors.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/qml/content/shadow.png b/examples/declarative/imageelements/borderimage/qml/content/shadow.png
new file mode 100644
index 0000000000..431af8545d
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/content/shadow.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/qml/shadows.qml b/examples/declarative/imageelements/borderimage/qml/shadows.qml
new file mode 100644
index 0000000000..d547f63eac
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/shadows.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "gray"
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 250; height: 250
+ color: "lightsteelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 200; height: 200
+ color: "steelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 150; height: 150
+ color: "thistle"
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..421e6e32ba
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package borderimage
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 16:13:09 +0100
diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..77071e007a
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+borderimage (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 16:13:09 +0100
diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..4bdc93ef3e
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: borderimage
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: borderimage
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..e1c7a293e9
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 16:13:09 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..3799b01dd7
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/borderimage.sgml > borderimage.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/borderimage.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/borderimage install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/imageelements/image/image.desktop b/examples/declarative/imageelements/image/image.desktop
new file mode 100644
index 0000000000..6103d44733
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=image
+Exec=/opt/usr/bin/image
+Icon=image
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/imageelements/image/image.png b/examples/declarative/imageelements/image/image.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.png
Binary files differ
diff --git a/examples/declarative/imageelements/image/image.pro b/examples/declarative/imageelements/image/image.pro
new file mode 100644
index 0000000000..c5e94cc159
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE5D64785
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/imageelements/image/image.svg b/examples/declarative/imageelements/image/image.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/imageelements/image/main.cpp b/examples/declarative/imageelements/image/main.cpp
new file mode 100644
index 0000000000..09cc88438d
--- /dev/null
+++ b/examples/declarative/imageelements/image/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/image.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/imageelements/image/qml/ImageCell.qml b/examples/declarative/imageelements/image/qml/ImageCell.qml
new file mode 100644
index 0000000000..e8a6c55102
--- /dev/null
+++ b/examples/declarative/imageelements/image/qml/ImageCell.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Item {
+ property alias mode: image.fillMode
+ property alias caption: captionItem.text
+
+ width: parent.cellWidth; height: parent.cellHeight
+
+ Image {
+ id: image
+ width: parent.width; height: parent.height - captionItem.height
+ source: "qt-logo.png"
+ clip: true // only makes a difference if mode is PreserveAspectCrop
+ smooth: true
+ }
+
+ Text {
+ id: captionItem
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom
+ }
+}
diff --git a/examples/declarative/imageelements/image/qml/image.qml b/examples/declarative/imageelements/image/qml/image.qml
new file mode 100644
index 0000000000..f00fc18f8e
--- /dev/null
+++ b/examples/declarative/imageelements/image/qml/image.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 490
+ height: 285
+
+ Grid {
+ property int cellWidth: (width - (spacing * (columns - 1))) / columns
+ property int cellHeight: (height - (spacing * (rows - 1))) / rows
+
+ anchors.fill: parent
+ anchors.margins: 30
+
+ columns: 3
+ rows: 2
+ spacing: 30
+
+ ImageCell { mode: Image.Stretch; caption: "Stretch" }
+ ImageCell { mode: Image.PreserveAspectFit; caption: "PreserveAspectFit" }
+ ImageCell { mode: Image.PreserveAspectCrop; caption: "PreserveAspectCrop" }
+
+ ImageCell { mode: Image.Tile; caption: "Tile" }
+ ImageCell { mode: Image.TileHorizontally; caption: "TileHorizontally" }
+ ImageCell { mode: Image.TileVertically; caption: "TileVertically" }
+ }
+}
diff --git a/examples/declarative/threading/threading.qmlproject b/examples/declarative/imageelements/image/qml/image.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/threading/threading.qmlproject
+++ b/examples/declarative/imageelements/image/qml/image.qmlproject
diff --git a/examples/declarative/imageelements/image/qt-logo.png b/examples/declarative/imageelements/image/qml/qt-logo.png
index 14ddf2a028..14ddf2a028 100644
--- a/examples/declarative/imageelements/image/qt-logo.png
+++ b/examples/declarative/imageelements/image/qml/qt-logo.png
Binary files differ
diff --git a/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/imageelements/image/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/imageelements/shadows/main.cpp b/examples/declarative/imageelements/shadows/main.cpp
new file mode 100644
index 0000000000..c8a9b85b78
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/shadows.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/imageelements/shadows/qml/borderimage.qml b/examples/declarative/imageelements/shadows/qml/borderimage.qml
new file mode 100644
index 0000000000..53e35f97e8
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/borderimage.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: page
+ width: 1030; height: 540
+
+ Grid {
+ anchors.centerIn: parent; spacing: 20
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ }
+}
diff --git a/examples/declarative/touchinteraction/gestures/gestures.qmlproject b/examples/declarative/imageelements/shadows/qml/borderimage.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/touchinteraction/gestures/gestures.qmlproject
+++ b/examples/declarative/imageelements/shadows/qml/borderimage.qmlproject
diff --git a/examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml b/examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml
new file mode 100644
index 0000000000..96495cbefa
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/MyBorderImage.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias horizontalMode: image.horizontalTileMode
+ property alias verticalMode: image.verticalTileMode
+ property alias source: image.source
+
+ property int minWidth
+ property int minHeight
+ property int maxWidth
+ property int maxHeight
+ property int margin
+
+ width: 240; height: 240
+
+ BorderImage {
+ id: image; anchors.centerIn: parent
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minWidth; to: container.maxWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxWidth; to: container.minWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minHeight; to: container.maxHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxHeight; to: container.minHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ border.top: container.margin
+ border.left: container.margin
+ border.bottom: container.margin
+ border.right: container.margin
+ }
+}
diff --git a/examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml b/examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml
new file mode 100644
index 0000000000..839ecf1177
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/ShadowRectangle.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property alias color : rectangle.color
+
+ BorderImage {
+ anchors.fill: rectangle
+ anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ source: "shadow.png"; smooth: true
+ }
+
+ Rectangle { id: rectangle; anchors.fill: parent }
+}
diff --git a/examples/declarative/imageelements/shadows/qml/content/bw.png b/examples/declarative/imageelements/shadows/qml/content/bw.png
new file mode 100644
index 0000000000..486eaae96e
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/bw.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/qml/content/colors-round.sci b/examples/declarative/imageelements/shadows/qml/content/colors-round.sci
new file mode 100644
index 0000000000..506f6f5f99
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/colors-round.sci
@@ -0,0 +1,7 @@
+border.left:30
+border.top:30
+border.right:30
+border.bottom:30
+horizontalTileRule:Round
+verticalTileRule:Round
+source:colors.png
diff --git a/examples/declarative/imageelements/shadows/qml/content/colors-stretch.sci b/examples/declarative/imageelements/shadows/qml/content/colors-stretch.sci
new file mode 100644
index 0000000000..e4989a723c
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/colors-stretch.sci
@@ -0,0 +1,5 @@
+border.left:30
+border.top:30
+border.right:30
+border.bottom:30
+source:colors.png
diff --git a/examples/declarative/imageelements/shadows/qml/content/colors.png b/examples/declarative/imageelements/shadows/qml/content/colors.png
new file mode 100644
index 0000000000..dfb62f3d64
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/colors.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/qml/content/shadow.png b/examples/declarative/imageelements/shadows/qml/content/shadow.png
new file mode 100644
index 0000000000..431af8545d
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/content/shadow.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/qml/shadows.qml b/examples/declarative/imageelements/shadows/qml/shadows.qml
new file mode 100644
index 0000000000..d547f63eac
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "gray"
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 250; height: 250
+ color: "lightsteelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 200; height: 200
+ color: "steelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 150; height: 150
+ color: "thistle"
+ }
+}
diff --git a/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/imageelements/shadows/shadows.desktop b/examples/declarative/imageelements/shadows/shadows.desktop
new file mode 100644
index 0000000000..83acea36a1
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=shadows
+Exec=/opt/usr/bin/shadows
+Icon=shadows
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/imageelements/shadows/shadows.png b/examples/declarative/imageelements/shadows/shadows.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/shadows.pro b/examples/declarative/imageelements/shadows/shadows.pro
new file mode 100644
index 0000000000..6c8889682c
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE2C00C58
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/imageelements/shadows/shadows.svg b/examples/declarative/imageelements/shadows/shadows.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/keyinteraction/focus/focus.desktop b/examples/declarative/keyinteraction/focus/focus.desktop
new file mode 100644
index 0000000000..68513b3f89
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=focus
+Exec=/opt/usr/bin/focus
+Icon=focus
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/keyinteraction/focus/focus.png b/examples/declarative/keyinteraction/focus/focus.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.png
Binary files differ
diff --git a/examples/declarative/keyinteraction/focus/focus.pro b/examples/declarative/keyinteraction/focus/focus.pro
new file mode 100644
index 0000000000..db502a0b54
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEC9F742D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/keyinteraction/focus/focus.svg b/examples/declarative/keyinteraction/focus/focus.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/keyinteraction/focus/main.cpp b/examples/declarative/keyinteraction/focus/main.cpp
new file mode 100644
index 0000000000..2f4deff9ef
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/focus.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml b/examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml
new file mode 100644
index 0000000000..79273ad130
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/Core/ContextMenu.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id: container
+
+ property bool open: false
+
+ Item {
+ anchors.fill: parent
+
+ Rectangle {
+ anchors.fill: parent
+ color: "#D1DBBD"
+ focus: true
+ Keys.onRightPressed: mainView.focus = true
+
+ Text {
+ anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; margins: 30 }
+ color: "black"
+ font.pixelSize: 14
+ text: "Context Menu"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml
new file mode 100644
index 0000000000..263adad732
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/Core/GridMenu.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ property alias interactive: gridView.interactive
+
+ onActiveFocusChanged: {
+ if (activeFocus)
+ mainView.state = ""
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ clip: true
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#193441" }
+ GradientStop { position: 1.0; color: Qt.darker("#193441") }
+ }
+
+ GridView {
+ id: gridView
+ anchors.fill: parent; anchors.leftMargin: 20; anchors.rightMargin: 20
+ cellWidth: 152; cellHeight: 152
+ focus: true
+ model: 12
+
+ KeyNavigation.down: listMenu
+ KeyNavigation.left: contextMenu
+
+ delegate: Item {
+ id: container
+ width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ Rectangle {
+ id: content
+ color: "transparent"
+ smooth: true
+ anchors.fill: parent; anchors.margins: 20; radius: 10
+
+ Rectangle { color: "#91AA9D"; anchors.fill: parent; anchors.margins: 3; radius: 8; smooth: true }
+ Image { source: "images/qt-logo.png"; anchors.centerIn: parent; smooth: true }
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+
+ onClicked: {
+ GridView.view.currentIndex = index
+ container.forceActiveFocus()
+ }
+ }
+
+ states: State {
+ name: "active"; when: container.activeFocus
+ PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; duration: 100 }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml b/examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml
new file mode 100644
index 0000000000..cefc9a354e
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/Core/ListMenu.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ clip: true
+
+ onActiveFocusChanged: {
+ if (activeFocus)
+ mainView.state = "showListViews"
+ }
+
+ ListView {
+ id: list1
+ y: activeFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
+ focus: true
+ KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2
+ model: 10; cacheBuffer: 200
+ delegate: ListViewDelegate {}
+
+ Behavior on y {
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ ListView {
+ id: list2
+ y: activeFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
+ KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
+ model: 10; cacheBuffer: 200
+ delegate: ListViewDelegate {}
+
+ Behavior on y {
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ ListView {
+ id: list3
+ y: activeFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
+ KeyNavigation.up: gridMenu; KeyNavigation.left: list2
+ model: 10; cacheBuffer: 200
+ delegate: ListViewDelegate {}
+
+ Behavior on y {
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ Rectangle { width: parent.width; height: 1; color: "#D1DBBD" }
+
+ Rectangle {
+ y: 1; width: parent.width; height: 10
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#3E606F" }
+ GradientStop { position: 1.0; color: "transparent" }
+ }
+ }
+
+ Rectangle {
+ y: parent.height - 10; width: parent.width; height: 10
+ gradient: Gradient {
+ GradientStop { position: 1.0; color: "#3E606F" }
+ GradientStop { position: 0.0; color: "transparent" }
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml
new file mode 100644
index 0000000000..7b63cd8d9e
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/Core/ListViewDelegate.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+ width: ListView.view.width; height: 60; anchors.leftMargin: 10; anchors.rightMargin: 10
+
+ Rectangle {
+ id: content
+ anchors.centerIn: parent; width: container.width - 40; height: container.height - 10
+ color: "transparent"
+ smooth: true
+ radius: 10
+
+ Rectangle { anchors.fill: parent; anchors.margins: 3; color: "#91AA9D"; smooth: true; radius: 8 }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: content
+ text: "List element " + (index + 1)
+ color: "#193441"
+ font.pixelSize: 14
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+
+ onClicked: {
+ ListView.view.currentIndex = index
+ container.forceActiveFocus()
+ }
+ }
+
+ states: State {
+ name: "active"; when: container.activeFocus
+ PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ PropertyChanges { target: label; font.pixelSize: 16 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; duration: 100 }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/Core/images/arrow.png b/examples/declarative/keyinteraction/focus/qml/Core/images/arrow.png
index 14978c2e56..14978c2e56 100644
--- a/examples/declarative/keyinteraction/focus/Core/images/arrow.png
+++ b/examples/declarative/keyinteraction/focus/qml/Core/images/arrow.png
Binary files differ
diff --git a/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png b/examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png
index 14ddf2a028..14ddf2a028 100644
--- a/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png
+++ b/examples/declarative/keyinteraction/focus/qml/Core/images/qt-logo.png
Binary files differ
diff --git a/examples/declarative/keyinteraction/focus/qml/focus.qml b/examples/declarative/keyinteraction/focus/qml/focus.qml
new file mode 100644
index 0000000000..e2115d84c3
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Core"
+
+Rectangle {
+ id: window
+
+ width: 800; height: 480
+ color: "#3E606F"
+
+ FocusScope {
+ id: mainView
+
+ width: parent.width; height: parent.height
+ focus: true
+
+ GridMenu {
+ id: gridMenu
+ width: parent.width; height: 320
+
+ focus: true
+ interactive: parent.activeFocus
+ }
+
+ ListMenu {
+ id: listMenu
+ y: 320; width: parent.width; height: 320
+ }
+
+ Rectangle {
+ id: shade
+ anchors.fill: parent
+ color: "black"
+ opacity: 0
+ }
+
+ states: State {
+ name: "showListViews"
+ PropertyChanges { target: gridMenu; y: -160 }
+ PropertyChanges { target: listMenu; y: 160 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ Image {
+ source: "Core/images/arrow.png"
+ rotation: 90
+ anchors.verticalCenter: parent.verticalCenter
+
+ MouseArea {
+ anchors.fill: parent; anchors.margins: -10
+ onClicked: window.state = "contextMenuOpen"
+ }
+ }
+
+ ContextMenu { id: contextMenu; x: -265; width: 260; height: parent.height }
+
+ states: State {
+ name: "contextMenuOpen"
+ when: !mainView.activeFocus
+ PropertyChanges { target: contextMenu; x: 0; open: true }
+ PropertyChanges { target: mainView; x: 130 }
+ PropertyChanges { target: shade; opacity: 0.25 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint }
+ }
+}
diff --git a/examples/declarative/touchinteraction/touchinteraction.qmlproject b/examples/declarative/keyinteraction/focus/qml/focus.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/touchinteraction/touchinteraction.qmlproject
+++ b/examples/declarative/keyinteraction/focus/qml/focus.qmlproject
diff --git a/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/Delegate/Delegate.desktop b/examples/declarative/modelviews/Delegate/Delegate.desktop
new file mode 100644
index 0000000000..9815dedb52
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/Delegate.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Delegate
+Exec=/opt/usr/bin/Delegate
+Icon=Delegate
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/Delegate/Delegate.png b/examples/declarative/modelviews/Delegate/Delegate.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/Delegate.png
Binary files differ
diff --git a/examples/declarative/modelviews/Delegate/Delegate.pro b/examples/declarative/modelviews/Delegate/Delegate.pro
new file mode 100644
index 0000000000..1b2a7e9b63
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/Delegate.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE5FF52C0
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/Delegate/Delegate.svg b/examples/declarative/modelviews/Delegate/Delegate.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/Delegate.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/Delegate/main.cpp b/examples/declarative/modelviews/Delegate/main.cpp
new file mode 100644
index 0000000000..4108851f8f
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/Delegate.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/Delegate/qml/Delegate.qml b/examples/declarative/modelviews/Delegate/qml/Delegate.qml
new file mode 100644
index 0000000000..57048f4154
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/qml/Delegate.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Package {
+ Text { id: listDelegate; width: 200; height: 25; text: 'Empty'; Package.name: 'list' }
+ Text { id: gridDelegate; width: 100; height: 50; text: 'Empty'; Package.name: 'grid' }
+
+ Rectangle {
+ id: wrapper
+ width: 200; height: 25
+ color: 'lightsteelblue'
+
+ Text { text: display; anchors.centerIn: parent }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (wrapper.state == 'inList')
+ wrapper.state = 'inGrid';
+ else
+ wrapper.state = 'inList';
+ }
+ }
+
+ state: 'inList'
+ states: [
+ State {
+ name: 'inList'
+ ParentChange { target: wrapper; parent: listDelegate }
+ },
+ State {
+ name: 'inGrid'
+ ParentChange {
+ target: wrapper; parent: gridDelegate
+ x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParentAnimation {
+ NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
+ }
+ }
+ ]
+ }
+}
+//![0]
diff --git a/examples/declarative/toys/clocks/clocks.qmlproject b/examples/declarative/modelviews/Delegate/qml/package.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/toys/clocks/clocks.qmlproject
+++ b/examples/declarative/modelviews/Delegate/qml/package.qmlproject
diff --git a/examples/declarative/modelviews/Delegate/qml/view.qml b/examples/declarative/modelviews/Delegate/qml/view.qml
new file mode 100644
index 0000000000..cbe8f0689f
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/qml/view.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 400
+ height: 200
+
+ ListModel {
+ id: myModel
+ ListElement { display: "One" }
+ ListElement { display: "Two" }
+ ListElement { display: "Three" }
+ ListElement { display: "Four" }
+ ListElement { display: "Five" }
+ ListElement { display: "Six" }
+ ListElement { display: "Seven" }
+ ListElement { display: "Eight" }
+ }
+ //![0]
+ VisualDataModel {
+ id: visualModel
+ delegate: Delegate {}
+ model: myModel
+ }
+
+ ListView {
+ width: 200; height:200
+ model: visualModel.parts.list
+ }
+ GridView {
+ x: 200; width: 200; height:200
+ cellHeight: 50
+ model: visualModel.parts.grid
+ }
+ //![0]
+}
diff --git a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/Delegate/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.desktop b/examples/declarative/modelviews/gridview-example/gridviewexample.desktop
new file mode 100644
index 0000000000..1ba59a4190
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/gridviewexample.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=gridview-example
+Exec=/opt/usr/bin/gridview-example
+Icon=gridview-example
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.png b/examples/declarative/modelviews/gridview-example/gridviewexample.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/gridviewexample.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.pro b/examples/declarative/modelviews/gridview-example/gridviewexample.pro
new file mode 100644
index 0000000000..61d7865af2
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/gridviewexample.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE53E8FDC
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/gridview-example/gridviewexample.svg b/examples/declarative/modelviews/gridview-example/gridviewexample.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/gridviewexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/gridview-example/main.cpp b/examples/declarative/modelviews/gridview-example/main.cpp
new file mode 100644
index 0000000000..54f49ad50d
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/gridview-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml b/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml
new file mode 100644
index 0000000000..85fefda273
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/qml/gridview-example.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 400
+ color: "white"
+
+ ListModel {
+ id: appModel
+ ListElement { name: "Music"; icon: "pics/AudioPlayer_48.png" }
+ ListElement { name: "Movies"; icon: "pics/VideoPlayer_48.png" }
+ ListElement { name: "Camera"; icon: "pics/Camera_48.png" }
+ ListElement { name: "Calendar"; icon: "pics/DateBook_48.png" }
+ ListElement { name: "Messaging"; icon: "pics/EMail_48.png" }
+ ListElement { name: "Todo List"; icon: "pics/TodoList_48.png" }
+ ListElement { name: "Contacts"; icon: "pics/AddressBook_48.png" }
+ }
+
+ Component {
+ id: appDelegate
+
+ Item {
+ width: 100; height: 100
+
+ Image {
+ id: myIcon
+ y: 20; anchors.horizontalCenter: parent.horizontalCenter
+ source: icon
+ }
+ Text {
+ anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
+ text: name
+ }
+ }
+ }
+
+ Component {
+ id: appHighlight
+ Rectangle { width: 80; height: 80; color: "lightsteelblue" }
+ }
+
+ GridView {
+ anchors.fill: parent
+ cellWidth: 100; cellHeight: 100
+ highlight: appHighlight
+ focus: true
+ model: appModel
+ delegate: appDelegate
+ }
+}
diff --git a/examples/declarative/toys/corkboards/corkboards.qmlproject b/examples/declarative/modelviews/gridview-example/qml/gridview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/toys/corkboards/corkboards.qmlproject
+++ b/examples/declarative/modelviews/gridview-example/qml/gridview.qmlproject
diff --git a/examples/declarative/modelviews/gridview/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png
index 1ab7c8eec1..1ab7c8eec1 100644
--- a/examples/declarative/modelviews/gridview/pics/AddressBook_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/AddressBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png
index f4b8689f87..f4b8689f87 100644
--- a/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/AudioPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/pics/Camera_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png
index c76b524945..c76b524945 100644
--- a/examples/declarative/modelviews/gridview/pics/Camera_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/Camera_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/pics/DateBook_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png
index 58f5787fb8..58f5787fb8 100644
--- a/examples/declarative/modelviews/gridview/pics/DateBook_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/DateBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/pics/EMail_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png
index d6d84a61be..d6d84a61be 100644
--- a/examples/declarative/modelviews/gridview/pics/EMail_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/EMail_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/pics/TodoList_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png
index 0988448d9b..0988448d9b 100644
--- a/examples/declarative/modelviews/gridview/pics/TodoList_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/TodoList_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png
index 52638c50a7..52638c50a7 100644
--- a/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png
+++ b/examples/declarative/modelviews/gridview-example/qml/pics/VideoPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/gridview-example/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop
new file mode 100644
index 0000000000..d056093dfe
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=dynamiclist
+Exec=/opt/usr/bin/dynamiclist
+Icon=dynamiclist
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro
new file mode 100644
index 0000000000..39b1ad13d5
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE49D962F
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/dynamiclist/main.cpp b/examples/declarative/modelviews/listview/dynamiclist/main.cpp
new file mode 100644
index 0000000000..757b1135b7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/dynamiclist.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml
new file mode 100644
index 0000000000..5220763813
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml
new file mode 100644
index 0000000000..d6808a49c3
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml
new file mode 100644
index 0000000000..6056b90382
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml
new file mode 100644
index 0000000000..f26d775f2c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png
new file mode 100644
index 0000000000..29d1d4439a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg
index da5a6b10a2..da5a6b10a2 100644
--- a/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg
index d0a15be1bf..d0a15be1bf 100644
--- a/examples/declarative/modelviews/listview/content/pics/hamburger.jpg
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg
index db445c9ac8..db445c9ac8 100644
--- a/examples/declarative/modelviews/listview/content/pics/lemonade.jpg
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png
new file mode 100644
index 0000000000..df2a147d24
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png
new file mode 100644
index 0000000000..d6f233d739
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/moreDown.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png
index 31a35d5c20..31a35d5c20 100644
--- a/examples/declarative/modelviews/listview/content/pics/moreDown.png
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/moreUp.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png
index fefb9c9098..fefb9c9098 100644
--- a/examples/declarative/modelviews/listview/content/pics/moreUp.png
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg
index 60c439638e..60c439638e 100644
--- a/examples/declarative/modelviews/listview/content/pics/pancakes.jpg
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png
new file mode 100644
index 0000000000..40df1134f8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg
index 9dce332041..9dce332041 100644
--- a/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml
new file mode 100644
index 0000000000..f25f0fab23
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml
new file mode 100644
index 0000000000..bd3d3a9cd2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml
new file mode 100644
index 0000000000..249c73b3a0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml
new file mode 100644
index 0000000000..58d37a3787
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject b/examples/declarative/modelviews/listview/dynamiclist/qml/listview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/listview.qmlproject
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml
new file mode 100644
index 0000000000..32488998a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop
new file mode 100644
index 0000000000..6113e0004e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=expandingdelegates
+Exec=/opt/usr/bin/expandingdelegates
+Icon=expandingdelegates
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro
new file mode 100644
index 0000000000..59f0554c9a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEEA16F93
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/main.cpp b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp
new file mode 100644
index 0000000000..b411dff2ec
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/expandingdelegates.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml
new file mode 100644
index 0000000000..5220763813
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml
new file mode 100644
index 0000000000..d6808a49c3
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml
new file mode 100644
index 0000000000..6056b90382
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml
new file mode 100644
index 0000000000..f26d775f2c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png
new file mode 100644
index 0000000000..29d1d4439a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg
new file mode 100644
index 0000000000..da5a6b10a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg
new file mode 100644
index 0000000000..d0a15be1bf
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg
new file mode 100644
index 0000000000..db445c9ac8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png
new file mode 100644
index 0000000000..df2a147d24
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png
new file mode 100644
index 0000000000..d6f233d739
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png
new file mode 100644
index 0000000000..31a35d5c20
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png
new file mode 100644
index 0000000000..fefb9c9098
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg
new file mode 100644
index 0000000000..60c439638e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png
new file mode 100644
index 0000000000..40df1134f8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg
new file mode 100644
index 0000000000..9dce332041
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml
new file mode 100644
index 0000000000..f25f0fab23
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml
new file mode 100644
index 0000000000..bd3d3a9cd2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml
new file mode 100644
index 0000000000..249c73b3a0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml
new file mode 100644
index 0000000000..58d37a3787
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject b/examples/declarative/modelviews/listview/expandingdelegates/qml/listview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/listview.qmlproject
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml
new file mode 100644
index 0000000000..32488998a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..1ceed78db4
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package expandingdelegates
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:28:38 +0100
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..5161d7d624
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+expandingdelegates (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:28:38 +0100
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..6993cea518
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: expandingdelegates
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: expandingdelegates
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..6185298041
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:28:38 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..96213efd2b
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/expandingdelegates.sgml > expandingdelegates.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/expandingdelegates.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/expandingdelegates install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.desktop b/examples/declarative/modelviews/listview/highlight/highlight.desktop
new file mode 100644
index 0000000000..5348e40e9c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=highlight
+Exec=/opt/usr/bin/highlight
+Icon=highlight
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.png b/examples/declarative/modelviews/listview/highlight/highlight.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.pro b/examples/declarative/modelviews/listview/highlight/highlight.pro
new file mode 100644
index 0000000000..60ae50c428
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE9439941
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.svg b/examples/declarative/modelviews/listview/highlight/highlight.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/highlight/main.cpp b/examples/declarative/modelviews/listview/highlight/main.cpp
new file mode 100644
index 0000000000..7b8cdf2119
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/highlight.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml
new file mode 100644
index 0000000000..5220763813
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml
new file mode 100644
index 0000000000..d6808a49c3
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml b/examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml
new file mode 100644
index 0000000000..6056b90382
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml
new file mode 100644
index 0000000000..f26d775f2c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png
new file mode 100644
index 0000000000..29d1d4439a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg
new file mode 100644
index 0000000000..da5a6b10a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg
new file mode 100644
index 0000000000..d0a15be1bf
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg
new file mode 100644
index 0000000000..db445c9ac8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png
new file mode 100644
index 0000000000..df2a147d24
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png
new file mode 100644
index 0000000000..d6f233d739
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png
new file mode 100644
index 0000000000..31a35d5c20
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png
new file mode 100644
index 0000000000..fefb9c9098
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg
new file mode 100644
index 0000000000..60c439638e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png
new file mode 100644
index 0000000000..40df1134f8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg
new file mode 100644
index 0000000000..9dce332041
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml
new file mode 100644
index 0000000000..f25f0fab23
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml b/examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml
new file mode 100644
index 0000000000..bd3d3a9cd2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight.qml
new file mode 100644
index 0000000000..249c73b3a0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml b/examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml
new file mode 100644
index 0000000000..58d37a3787
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/toys/toys.qmlproject b/examples/declarative/modelviews/listview/highlight/qml/listview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/toys/toys.qmlproject
+++ b/examples/declarative/modelviews/listview/highlight/qml/listview.qmlproject
diff --git a/examples/declarative/modelviews/listview/highlight/qml/sections.qml b/examples/declarative/modelviews/listview/highlight/qml/sections.qml
new file mode 100644
index 0000000000..32488998a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..37e930ad1d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package highlight
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:33:55 +0100
diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..43e669b50d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+highlight (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:33:55 +0100
diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..0ed2ce2d00
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: highlight
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: highlight
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..b795943e8a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:33:55 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..986e3ee119
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/highlight.sgml > highlight.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/highlight.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/highlight install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop b/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop
new file mode 100644
index 0000000000..57200be95e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=highlightranges
+Exec=/opt/usr/bin/highlightranges
+Icon=highlightranges
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.png b/examples/declarative/modelviews/listview/highlightranges/highlightranges.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro
new file mode 100644
index 0000000000..4dd178f83f
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE7A0AE23
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg b/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/highlightranges/main.cpp b/examples/declarative/modelviews/listview/highlightranges/main.cpp
new file mode 100644
index 0000000000..fad8f0cfbf
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/highlightranges.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml
new file mode 100644
index 0000000000..5220763813
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml
new file mode 100644
index 0000000000..d6808a49c3
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml
new file mode 100644
index 0000000000..6056b90382
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml
new file mode 100644
index 0000000000..f26d775f2c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png
new file mode 100644
index 0000000000..29d1d4439a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg
new file mode 100644
index 0000000000..da5a6b10a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg
new file mode 100644
index 0000000000..d0a15be1bf
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg
new file mode 100644
index 0000000000..db445c9ac8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png
new file mode 100644
index 0000000000..df2a147d24
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png
new file mode 100644
index 0000000000..d6f233d739
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png
new file mode 100644
index 0000000000..31a35d5c20
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png
new file mode 100644
index 0000000000..fefb9c9098
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg
new file mode 100644
index 0000000000..60c439638e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png
new file mode 100644
index 0000000000..40df1134f8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg
new file mode 100644
index 0000000000..9dce332041
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml
new file mode 100644
index 0000000000..f25f0fab23
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml b/examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml
new file mode 100644
index 0000000000..bd3d3a9cd2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml
new file mode 100644
index 0000000000..249c73b3a0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml
new file mode 100644
index 0000000000..58d37a3787
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/toys/tvtennis/tvtennis.qmlproject b/examples/declarative/modelviews/listview/highlightranges/qml/listview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/toys/tvtennis/tvtennis.qmlproject
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/listview.qmlproject
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml b/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml
new file mode 100644
index 0000000000..32488998a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/listview/sections/main.cpp b/examples/declarative/modelviews/listview/sections/main.cpp
new file mode 100644
index 0000000000..7b827c7046
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/sections.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml b/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml
new file mode 100644
index 0000000000..5220763813
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml
new file mode 100644
index 0000000000..d6808a49c3
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml b/examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml
new file mode 100644
index 0000000000..6056b90382
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml b/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml
new file mode 100644
index 0000000000..f26d775f2c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png
new file mode 100644
index 0000000000..29d1d4439a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg
new file mode 100644
index 0000000000..da5a6b10a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg
new file mode 100644
index 0000000000..d0a15be1bf
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg
new file mode 100644
index 0000000000..db445c9ac8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png
new file mode 100644
index 0000000000..df2a147d24
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png
new file mode 100644
index 0000000000..d6f233d739
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png
new file mode 100644
index 0000000000..31a35d5c20
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png
new file mode 100644
index 0000000000..fefb9c9098
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg
new file mode 100644
index 0000000000..60c439638e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png
new file mode 100644
index 0000000000..40df1134f8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg
new file mode 100644
index 0000000000..9dce332041
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml b/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml
new file mode 100644
index 0000000000..f25f0fab23
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml b/examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml
new file mode 100644
index 0000000000..bd3d3a9cd2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/highlight.qml b/examples/declarative/modelviews/listview/sections/qml/highlight.qml
new file mode 100644
index 0000000000..249c73b3a0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/highlightranges.qml b/examples/declarative/modelviews/listview/sections/qml/highlightranges.qml
new file mode 100644
index 0000000000..58d37a3787
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject b/examples/declarative/modelviews/listview/sections/qml/listview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject
+++ b/examples/declarative/modelviews/listview/sections/qml/listview.qmlproject
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections.qml b/examples/declarative/modelviews/listview/sections/qml/sections.qml
new file mode 100644
index 0000000000..32488998a2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/listview/sections/sections.desktop b/examples/declarative/modelviews/listview/sections/sections.desktop
new file mode 100644
index 0000000000..c11801e623
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=sections
+Exec=/opt/usr/bin/sections
+Icon=sections
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/listview/sections/sections.png b/examples/declarative/modelviews/listview/sections/sections.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/sections.pro b/examples/declarative/modelviews/listview/sections/sections.pro
new file mode 100644
index 0000000000..17e04f4aa5
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEA0874F7
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/sections/sections.svg b/examples/declarative/modelviews/listview/sections/sections.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/pathview-example/main.cpp b/examples/declarative/modelviews/pathview-example/main.cpp
new file mode 100644
index 0000000000..85d682d896
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/pathview-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.desktop b/examples/declarative/modelviews/pathview-example/pathviewexample.desktop
new file mode 100644
index 0000000000..30d29e3242
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/pathviewexample.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=pathview-example
+Exec=/opt/usr/bin/pathview-example
+Icon=pathview-example
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.png b/examples/declarative/modelviews/pathview-example/pathviewexample.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/pathviewexample.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.pro b/examples/declarative/modelviews/pathview-example/pathviewexample.pro
new file mode 100644
index 0000000000..60a62ad532
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/pathviewexample.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE51EA833
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/pathview-example/pathviewexample.svg b/examples/declarative/modelviews/pathview-example/pathviewexample.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/pathviewexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml b/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml
new file mode 100644
index 0000000000..267c57c869
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qml/pathview-example.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 240
+ color: "white"
+
+ ListModel {
+ id: appModel
+ ListElement { name: "Music"; icon: "pics/AudioPlayer_48.png" }
+ ListElement { name: "Movies"; icon: "pics/VideoPlayer_48.png" }
+ ListElement { name: "Camera"; icon: "pics/Camera_48.png" }
+ ListElement { name: "Calendar"; icon: "pics/DateBook_48.png" }
+ ListElement { name: "Messaging"; icon: "pics/EMail_48.png" }
+ ListElement { name: "Todo List"; icon: "pics/TodoList_48.png" }
+ ListElement { name: "Contacts"; icon: "pics/AddressBook_48.png" }
+ }
+
+ Component {
+ id: appDelegate
+ Item {
+ width: 100; height: 100
+ scale: PathView.iconScale
+
+ Image {
+ id: myIcon
+ y: 20; anchors.horizontalCenter: parent.horizontalCenter
+ source: icon
+ smooth: true
+ }
+ Text {
+ anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
+ text: name
+ smooth: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: view.currentIndex = index
+ }
+ }
+ }
+
+ Component {
+ id: appHighlight
+ Rectangle { width: 80; height: 80; color: "lightsteelblue" }
+ }
+
+ PathView {
+ Keys.onRightPressed: if (!moving) { incrementCurrentIndex(); console.log(moving) }
+ Keys.onLeftPressed: if (!moving) decrementCurrentIndex()
+ id: view
+ anchors.fill: parent
+ highlight: appHighlight
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ focus: true
+ model: appModel
+ delegate: appDelegate
+ path: Path {
+ startX: 10
+ startY: 50
+ PathAttribute { name: "iconScale"; value: 0.5 }
+ PathQuad { x: 200; y: 150; controlX: 50; controlY: 200 }
+ PathAttribute { name: "iconScale"; value: 1.0 }
+ PathQuad { x: 390; y: 50; controlX: 350; controlY: 200 }
+ PathAttribute { name: "iconScale"; value: 0.5 }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/flipable/flipable.qmlproject b/examples/declarative/modelviews/pathview-example/qml/pathview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/ui-components/flipable/flipable.qmlproject
+++ b/examples/declarative/modelviews/pathview-example/qml/pathview.qmlproject
diff --git a/examples/declarative/modelviews/pathview/pics/AddressBook_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png
index 1ab7c8eec1..1ab7c8eec1 100644
--- a/examples/declarative/modelviews/pathview/pics/AddressBook_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/AddressBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png
index f4b8689f87..f4b8689f87 100644
--- a/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/AudioPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pics/Camera_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png
index c76b524945..c76b524945 100644
--- a/examples/declarative/modelviews/pathview/pics/Camera_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/Camera_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pics/DateBook_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png
index 58f5787fb8..58f5787fb8 100644
--- a/examples/declarative/modelviews/pathview/pics/DateBook_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/DateBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pics/EMail_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png
index d6d84a61be..d6d84a61be 100644
--- a/examples/declarative/modelviews/pathview/pics/EMail_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/EMail_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pics/TodoList_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png
index 0988448d9b..0988448d9b 100644
--- a/examples/declarative/modelviews/pathview/pics/TodoList_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/TodoList_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png
index 52638c50a7..52638c50a7 100644
--- a/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png
+++ b/examples/declarative/modelviews/pathview-example/qml/pics/VideoPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..0d8225202e
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package pathviewexample
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:48:31 +0100
diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..ab74121717
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+pathviewexample (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:48:31 +0100
diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..c931a891f2
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: pathviewexample
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: pathviewexample
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..f848d27ec1
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:48:31 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..c604e5dc1f
--- /dev/null
+++ b/examples/declarative/modelviews/pathview-example/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/pathviewexample.sgml > pathviewexample.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/pathviewexample.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/pathviewexample install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/modelviews/visualitemmodel/main.cpp b/examples/declarative/modelviews/visualitemmodel/main.cpp
new file mode 100644
index 0000000000..1b265025e6
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/visualitemmodel.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml
new file mode 100644
index 0000000000..15f2f1152c
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates placing items in a view using
+// a VisualItemModel
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightgray"
+ width: 240
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+
+ Rectangle {
+ width: view.width; height: view.height
+ color: "#FFFEF0"
+ Text { text: "Page 1"; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ width: view.width; height: view.height
+ color: "#F0FFF7"
+ Text { text: "Page 2"; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ width: view.width; height: view.height
+ color: "#F4F0FF"
+ Text { text: "Page 3"; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ anchors { fill: parent; bottomMargin: 30 }
+ model: itemModel
+ preferredHighlightBegin: 0; preferredHighlightEnd: 0
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ orientation: ListView.Horizontal
+ snapMode: ListView.SnapOneItem; flickDeceleration: 2000
+ }
+
+ Rectangle {
+ width: 240; height: 30
+ anchors { top: view.bottom; bottom: parent.bottom }
+ color: "gray"
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 20
+
+ Repeater {
+ model: itemModel.count
+
+ Rectangle {
+ width: 5; height: 5
+ radius: 3
+ color: view.currentIndex == index ? "blue" : "white"
+
+ MouseArea {
+ width: 20; height: 20
+ anchors.centerIn: parent
+ onClicked: view.currentIndex = index
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/progressbar/progressbar.qmlproject b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/ui-components/progressbar/progressbar.qmlproject
+++ b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel.qmlproject
diff --git a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop
new file mode 100644
index 0000000000..ae40ec030f
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=visualitemmodel
+Exec=/opt/usr/bin/visualitemmodel
+Icon=visualitemmodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png
Binary files differ
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro
new file mode 100644
index 0000000000..cf61323bd3
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE722A922
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.desktop b/examples/declarative/modelviews/webview/alerts/alerts.desktop
new file mode 100644
index 0000000000..80af9d2ca8
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=alerts
+Exec=/opt/usr/bin/alerts
+Icon=alerts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.png b/examples/declarative/modelviews/webview/alerts/alerts.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.pro b/examples/declarative/modelviews/webview/alerts/alerts.pro
new file mode 100644
index 0000000000..335c3a3f2b
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE14997C0
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.svg b/examples/declarative/modelviews/webview/alerts/alerts.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/alerts/main.cpp b/examples/declarative/modelviews/webview/alerts/main.cpp
new file mode 100644
index 0000000000..e57f541d71
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/alerts.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/alerts.html b/examples/declarative/modelviews/webview/alerts/qml/alerts.html
index 82caddf7fb..82caddf7fb 100644
--- a/examples/declarative/modelviews/webview/alerts.html
+++ b/examples/declarative/modelviews/webview/alerts/qml/alerts.html
diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts.qml
new file mode 100644
index 0000000000..4aa4a3bc75
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/alerts.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 150
+ url: "alerts.html"
+
+ onAlert: popup.show(message)
+
+ Rectangle {
+ id: popup
+
+ color: "red"
+ border.color: "black"; border.width: 2
+ radius: 4
+
+ y: parent.height // off "screen"
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: label.width + 5
+ height: label.height + 5
+
+ opacity: 0
+
+ function show(text) {
+ label.text = text
+ popup.state = "visible"
+ timer.start()
+ }
+ states: State {
+ name: "visible"
+ PropertyChanges { target: popup; opacity: 1 }
+ PropertyChanges { target: popup; y: (webView.height-popup.height)/2 }
+ }
+
+ transitions: [
+ Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } },
+ Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } }
+ ]
+
+ Timer {
+ id: timer
+ interval: 1000
+
+ onTriggered: popup.state = ""
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ width: webView.width *0.75
+
+ color: "white"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ smooth: true
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/alerts/qml/autosize.qml b/examples/declarative/modelviews/webview/alerts/qml/autosize.qml
new file mode 100644
index 0000000000..7e10403f8f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/autosize.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ id: rect
+ width: 200
+ height: layout.height
+
+ Column {
+ id: layout
+ spacing: 2
+
+ WebView {
+ html: "No width defined."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml
new file mode 100644
index 0000000000..9a865795e0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/Map.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Item {
+ id: page
+
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ property alias status: js.status
+
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ pressGrabTime: 0
+ javaScriptWindowObjects: QtObject {
+ id: js
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ property string status: "Loading"
+
+ onAddressChanged: {
+ if (map.url != "" && map.progress == 1)
+ map.evaluateJavaScript("goToAddress()")
+ }
+ }
+
+ onLoadFinished: { evaluateJavaScript("goToAddress()"); }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/content/Mapping/map.html b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html
index a98da5430f..a98da5430f 100755..100644
--- a/examples/declarative/modelviews/webview/content/Mapping/map.html
+++ b/examples/declarative/modelviews/webview/alerts/qml/content/Mapping/map.html
diff --git a/examples/declarative/modelviews/webview/content/pics/cancel.png b/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png
index ecc95331f2..ecc95331f2 100644
--- a/examples/declarative/modelviews/webview/content/pics/cancel.png
+++ b/examples/declarative/modelviews/webview/alerts/qml/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/content/pics/ok.png b/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png
index 5795f04fbf..5795f04fbf 100644
--- a/examples/declarative/modelviews/webview/content/pics/ok.png
+++ b/examples/declarative/modelviews/webview/alerts/qml/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml b/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml
new file mode 100644
index 0000000000..aed0ddd025
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/googlemaps.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import QtQuick 1.0
+import QtWebKit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml
new file mode 100644
index 0000000000..afc1fa93d3
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/inlinehtml.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Inline HTML with loose formatting can be
+// set on the html property.
+WebView {
+ html:"\
+ <body>
+ <table border=1>
+ <tr><th><th>One<th>Two<th>Three
+ <tr><th>1<td>X<td>1<td>X
+ <tr><th>2<td>0<td>X<td>0
+ <tr><th>3<td>X<td>1<td>X
+ </table>"
+}
diff --git a/examples/declarative/modelviews/webview/newwindows.html b/examples/declarative/modelviews/webview/alerts/qml/newwindows.html
index f169599387..f169599387 100644
--- a/examples/declarative/modelviews/webview/newwindows.html
+++ b/examples/declarative/modelviews/webview/alerts/qml/newwindows.html
diff --git a/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml b/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml
new file mode 100644
index 0000000000..52f7a0b4dd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/newwindows.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Demonstrates opening new WebViews from HTML
+//
+// Note that to open windows from JavaScript, you will need to
+// allow it on WebView with settings.javascriptCanOpenWindows: true
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ columns: 3
+ id: pages
+ height: 300; width: 600
+
+ Component {
+ id: webViewPage
+ Rectangle {
+ width: webView.width
+ height: webView.height
+ border.color: "gray"
+
+ WebView {
+ id: webView
+ newWindowComponent: webViewPage
+ newWindowParent: pages
+ url: "newwindows.html"
+ }
+ }
+ }
+
+ Loader { sourceComponent: webViewPage }
+}
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject b/examples/declarative/modelviews/webview/alerts/qml/webview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject
+++ b/examples/declarative/modelviews/webview/alerts/qml/webview.qmlproject
diff --git a/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.desktop b/examples/declarative/modelviews/webview/autosize/autosize.desktop
new file mode 100644
index 0000000000..29a81c56c6
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=autosize
+Exec=/opt/usr/bin/autosize
+Icon=autosize
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.png b/examples/declarative/modelviews/webview/autosize/autosize.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.pro b/examples/declarative/modelviews/webview/autosize/autosize.pro
new file mode 100644
index 0000000000..a17f822bba
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEE6AB317
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.svg b/examples/declarative/modelviews/webview/autosize/autosize.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/autosize/main.cpp b/examples/declarative/modelviews/webview/autosize/main.cpp
new file mode 100644
index 0000000000..9a7f6ec170
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/autosize.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/alerts.html b/examples/declarative/modelviews/webview/autosize/qml/alerts.html
new file mode 100644
index 0000000000..82caddf7fb
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/alerts.html
@@ -0,0 +1,5 @@
+<html>
+<body onclick="alert('This is an alert')">
+<p>This is a web page. It fires an alert when clicked.
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/autosize/qml/alerts.qml b/examples/declarative/modelviews/webview/autosize/qml/alerts.qml
new file mode 100644
index 0000000000..4aa4a3bc75
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/alerts.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 150
+ url: "alerts.html"
+
+ onAlert: popup.show(message)
+
+ Rectangle {
+ id: popup
+
+ color: "red"
+ border.color: "black"; border.width: 2
+ radius: 4
+
+ y: parent.height // off "screen"
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: label.width + 5
+ height: label.height + 5
+
+ opacity: 0
+
+ function show(text) {
+ label.text = text
+ popup.state = "visible"
+ timer.start()
+ }
+ states: State {
+ name: "visible"
+ PropertyChanges { target: popup; opacity: 1 }
+ PropertyChanges { target: popup; y: (webView.height-popup.height)/2 }
+ }
+
+ transitions: [
+ Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } },
+ Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } }
+ ]
+
+ Timer {
+ id: timer
+ interval: 1000
+
+ onTriggered: popup.state = ""
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ width: webView.width *0.75
+
+ color: "white"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ smooth: true
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/autosize.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize.qml
new file mode 100644
index 0000000000..7e10403f8f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/autosize.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ id: rect
+ width: 200
+ height: layout.height
+
+ Column {
+ id: layout
+ spacing: 2
+
+ WebView {
+ html: "No width defined."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml
new file mode 100644
index 0000000000..9a865795e0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/Map.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Item {
+ id: page
+
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ property alias status: js.status
+
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ pressGrabTime: 0
+ javaScriptWindowObjects: QtObject {
+ id: js
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ property string status: "Loading"
+
+ onAddressChanged: {
+ if (map.url != "" && map.progress == 1)
+ map.evaluateJavaScript("goToAddress()")
+ }
+ }
+
+ onLoadFinished: { evaluateJavaScript("goToAddress()"); }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html
new file mode 100644
index 0000000000..a98da5430f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/content/Mapping/map.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var geocoder
+ var map
+ function goToLatLng(latlng,bounds) {
+ if (map) {
+ map.setCenter(latlng)
+ map.fitBounds(bounds)
+ } else {
+ var myOptions = {
+ zoom: 8,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ }
+ }
+ function initialize() {
+ geocoder = new google.maps.Geocoder();
+ if (window.qml.address) {
+ goToAddress()
+ } else {
+ goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
+ }
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
+ window.qml.lat = initialLocation.lat;
+ window.qml.lng = initialLocation.lng;
+ goToLatLng(initialLocation);
+ });
+ }
+ }
+ function goToAddress() {
+ if (geocoder) {
+ var req = {
+ address: window.qml.address,
+ }
+ if (map)
+ req.bounds = map.getBounds()
+ window.qml.status = "Loading";
+ geocoder.geocode(req, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ window.qml.status = "Ready";
+ goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
+ } else {
+ window.qml.status = "Error";
+ }
+ });
+ }
+ }
+</script>
+</head>
+<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
+ <div id="map_canvas" style="width:100%; height:100%"></div>
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png
new file mode 100644
index 0000000000..ecc95331f2
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png
new file mode 100644
index 0000000000..5795f04fbf
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml b/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml
new file mode 100644
index 0000000000..aed0ddd025
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/googlemaps.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import QtQuick 1.0
+import QtWebKit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml
new file mode 100644
index 0000000000..afc1fa93d3
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/inlinehtml.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Inline HTML with loose formatting can be
+// set on the html property.
+WebView {
+ html:"\
+ <body>
+ <table border=1>
+ <tr><th><th>One<th>Two<th>Three
+ <tr><th>1<td>X<td>1<td>X
+ <tr><th>2<td>0<td>X<td>0
+ <tr><th>3<td>X<td>1<td>X
+ </table>"
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/newwindows.html b/examples/declarative/modelviews/webview/autosize/qml/newwindows.html
new file mode 100644
index 0000000000..f169599387
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/newwindows.html
@@ -0,0 +1,3 @@
+<h1>Multiple windows...</h1>
+
+<a target="_blank" href="newwindows.html">Popup!</a>
diff --git a/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml b/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml
new file mode 100644
index 0000000000..52f7a0b4dd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/newwindows.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Demonstrates opening new WebViews from HTML
+//
+// Note that to open windows from JavaScript, you will need to
+// allow it on WebView with settings.javascriptCanOpenWindows: true
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ columns: 3
+ id: pages
+ height: 300; width: 600
+
+ Component {
+ id: webViewPage
+ Rectangle {
+ width: webView.width
+ height: webView.height
+ border.color: "gray"
+
+ WebView {
+ id: webView
+ newWindowComponent: webViewPage
+ newWindowParent: pages
+ url: "newwindows.html"
+ }
+ }
+ }
+
+ Loader { sourceComponent: webViewPage }
+}
diff --git a/examples/declarative/ui-components/ui-components.qmlproject b/examples/declarative/modelviews/webview/autosize/qml/webview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/ui-components/ui-components.qmlproject
+++ b/examples/declarative/modelviews/webview/autosize/qml/webview.qmlproject
diff --git a/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..ba73287d29
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package autosize
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:21:56 +0100
diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..2939e3b558
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+autosize (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:21:56 +0100
diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..22a510cdb6
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: autosize
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: autosize
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..afff162db4
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:21:56 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..5fa637ce6d
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/autosize.sgml > autosize.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/autosize.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/autosize install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop b/examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop
new file mode 100644
index 0000000000..99d9a79f50
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=googlemaps
+Exec=/opt/usr/bin/googlemaps
+Icon=googlemaps
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.png b/examples/declarative/modelviews/webview/googlemaps/googlemaps.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro
new file mode 100644
index 0000000000..2a4c5f2e67
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEF02570C
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg b/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/googlemaps/main.cpp b/examples/declarative/modelviews/webview/googlemaps/main.cpp
new file mode 100644
index 0000000000..9e4da077aa
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/googlemaps.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html
new file mode 100644
index 0000000000..82caddf7fb
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.html
@@ -0,0 +1,5 @@
+<html>
+<body onclick="alert('This is an alert')">
+<p>This is a web page. It fires an alert when clicked.
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml
new file mode 100644
index 0000000000..4aa4a3bc75
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/alerts.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 150
+ url: "alerts.html"
+
+ onAlert: popup.show(message)
+
+ Rectangle {
+ id: popup
+
+ color: "red"
+ border.color: "black"; border.width: 2
+ radius: 4
+
+ y: parent.height // off "screen"
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: label.width + 5
+ height: label.height + 5
+
+ opacity: 0
+
+ function show(text) {
+ label.text = text
+ popup.state = "visible"
+ timer.start()
+ }
+ states: State {
+ name: "visible"
+ PropertyChanges { target: popup; opacity: 1 }
+ PropertyChanges { target: popup; y: (webView.height-popup.height)/2 }
+ }
+
+ transitions: [
+ Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } },
+ Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } }
+ ]
+
+ Timer {
+ id: timer
+ interval: 1000
+
+ onTriggered: popup.state = ""
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ width: webView.width *0.75
+
+ color: "white"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ smooth: true
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml b/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml
new file mode 100644
index 0000000000..7e10403f8f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/autosize.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ id: rect
+ width: 200
+ height: layout.height
+
+ Column {
+ id: layout
+ spacing: 2
+
+ WebView {
+ html: "No width defined."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml
new file mode 100644
index 0000000000..9a865795e0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/Map.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Item {
+ id: page
+
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ property alias status: js.status
+
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ pressGrabTime: 0
+ javaScriptWindowObjects: QtObject {
+ id: js
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ property string status: "Loading"
+
+ onAddressChanged: {
+ if (map.url != "" && map.progress == 1)
+ map.evaluateJavaScript("goToAddress()")
+ }
+ }
+
+ onLoadFinished: { evaluateJavaScript("goToAddress()"); }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html
new file mode 100644
index 0000000000..a98da5430f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/content/Mapping/map.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var geocoder
+ var map
+ function goToLatLng(latlng,bounds) {
+ if (map) {
+ map.setCenter(latlng)
+ map.fitBounds(bounds)
+ } else {
+ var myOptions = {
+ zoom: 8,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ }
+ }
+ function initialize() {
+ geocoder = new google.maps.Geocoder();
+ if (window.qml.address) {
+ goToAddress()
+ } else {
+ goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
+ }
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
+ window.qml.lat = initialLocation.lat;
+ window.qml.lng = initialLocation.lng;
+ goToLatLng(initialLocation);
+ });
+ }
+ }
+ function goToAddress() {
+ if (geocoder) {
+ var req = {
+ address: window.qml.address,
+ }
+ if (map)
+ req.bounds = map.getBounds()
+ window.qml.status = "Loading";
+ geocoder.geocode(req, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ window.qml.status = "Ready";
+ goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
+ } else {
+ window.qml.status = "Error";
+ }
+ });
+ }
+ }
+</script>
+</head>
+<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
+ <div id="map_canvas" style="width:100%; height:100%"></div>
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png
new file mode 100644
index 0000000000..ecc95331f2
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png
new file mode 100644
index 0000000000..5795f04fbf
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml
new file mode 100644
index 0000000000..aed0ddd025
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import QtQuick 1.0
+import QtWebKit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml
new file mode 100644
index 0000000000..afc1fa93d3
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/inlinehtml.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Inline HTML with loose formatting can be
+// set on the html property.
+WebView {
+ html:"\
+ <body>
+ <table border=1>
+ <tr><th><th>One<th>Two<th>Three
+ <tr><th>1<td>X<td>1<td>X
+ <tr><th>2<td>0<td>X<td>0
+ <tr><th>3<td>X<td>1<td>X
+ </table>"
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html
new file mode 100644
index 0000000000..f169599387
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.html
@@ -0,0 +1,3 @@
+<h1>Multiple windows...</h1>
+
+<a target="_blank" href="newwindows.html">Popup!</a>
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml
new file mode 100644
index 0000000000..52f7a0b4dd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/newwindows.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Demonstrates opening new WebViews from HTML
+//
+// Note that to open windows from JavaScript, you will need to
+// allow it on WebView with settings.javascriptCanOpenWindows: true
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ columns: 3
+ id: pages
+ height: 300; width: 600
+
+ Component {
+ id: webViewPage
+ Rectangle {
+ width: webView.width
+ height: webView.height
+ border.color: "gray"
+
+ WebView {
+ id: webView
+ newWindowComponent: webViewPage
+ newWindowParent: pages
+ url: "newwindows.html"
+ }
+ }
+ }
+
+ Loader { sourceComponent: webViewPage }
+}
diff --git a/examples/declarative/xml/xml.qmlproject b/examples/declarative/modelviews/webview/googlemaps/qml/webview.qmlproject
index d4909f8685..d4909f8685 100644
--- a/examples/declarative/xml/xml.qmlproject
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/webview.qmlproject
diff --git a/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..8bc7f9e30d
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package googlemaps
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:19:23 +0100
diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..e3e11d92dd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+googlemaps (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:19:23 +0100
diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..e046e7c063
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: googlemaps
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: googlemaps
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..d800cefd9c
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:19:23 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..de6c89aab2
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/googlemaps.sgml > googlemaps.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/googlemaps.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/googlemaps install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop
new file mode 100644
index 0000000000..98e594929c
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=inlinehtml
+Exec=/opt/usr/bin/inlinehtml
+Icon=inlinehtml
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro
new file mode 100644
index 0000000000..86cdd1e325
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEF18EEF4
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/inlinehtml/main.cpp b/examples/declarative/modelviews/webview/inlinehtml/main.cpp
new file mode 100644
index 0000000000..bb57ec67e6
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/inlinehtml.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html
new file mode 100644
index 0000000000..82caddf7fb
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.html
@@ -0,0 +1,5 @@
+<html>
+<body onclick="alert('This is an alert')">
+<p>This is a web page. It fires an alert when clicked.
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml
new file mode 100644
index 0000000000..4aa4a3bc75
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/alerts.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 150
+ url: "alerts.html"
+
+ onAlert: popup.show(message)
+
+ Rectangle {
+ id: popup
+
+ color: "red"
+ border.color: "black"; border.width: 2
+ radius: 4
+
+ y: parent.height // off "screen"
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: label.width + 5
+ height: label.height + 5
+
+ opacity: 0
+
+ function show(text) {
+ label.text = text
+ popup.state = "visible"
+ timer.start()
+ }
+ states: State {
+ name: "visible"
+ PropertyChanges { target: popup; opacity: 1 }
+ PropertyChanges { target: popup; y: (webView.height-popup.height)/2 }
+ }
+
+ transitions: [
+ Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } },
+ Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } }
+ ]
+
+ Timer {
+ id: timer
+ interval: 1000
+
+ onTriggered: popup.state = ""
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ width: webView.width *0.75
+
+ color: "white"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ smooth: true
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml
new file mode 100644
index 0000000000..7e10403f8f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/autosize.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ id: rect
+ width: 200
+ height: layout.height
+
+ Column {
+ id: layout
+ spacing: 2
+
+ WebView {
+ html: "No width defined."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml
new file mode 100644
index 0000000000..9a865795e0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/Map.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Item {
+ id: page
+
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ property alias status: js.status
+
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ pressGrabTime: 0
+ javaScriptWindowObjects: QtObject {
+ id: js
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ property string status: "Loading"
+
+ onAddressChanged: {
+ if (map.url != "" && map.progress == 1)
+ map.evaluateJavaScript("goToAddress()")
+ }
+ }
+
+ onLoadFinished: { evaluateJavaScript("goToAddress()"); }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html
new file mode 100644
index 0000000000..a98da5430f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/content/Mapping/map.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var geocoder
+ var map
+ function goToLatLng(latlng,bounds) {
+ if (map) {
+ map.setCenter(latlng)
+ map.fitBounds(bounds)
+ } else {
+ var myOptions = {
+ zoom: 8,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ }
+ }
+ function initialize() {
+ geocoder = new google.maps.Geocoder();
+ if (window.qml.address) {
+ goToAddress()
+ } else {
+ goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
+ }
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
+ window.qml.lat = initialLocation.lat;
+ window.qml.lng = initialLocation.lng;
+ goToLatLng(initialLocation);
+ });
+ }
+ }
+ function goToAddress() {
+ if (geocoder) {
+ var req = {
+ address: window.qml.address,
+ }
+ if (map)
+ req.bounds = map.getBounds()
+ window.qml.status = "Loading";
+ geocoder.geocode(req, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ window.qml.status = "Ready";
+ goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
+ } else {
+ window.qml.status = "Error";
+ }
+ });
+ }
+ }
+</script>
+</head>
+<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
+ <div id="map_canvas" style="width:100%; height:100%"></div>
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png
new file mode 100644
index 0000000000..ecc95331f2
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png
new file mode 100644
index 0000000000..5795f04fbf
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml
new file mode 100644
index 0000000000..aed0ddd025
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/googlemaps.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import QtQuick 1.0
+import QtWebKit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml
new file mode 100644
index 0000000000..afc1fa93d3
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Inline HTML with loose formatting can be
+// set on the html property.
+WebView {
+ html:"\
+ <body>
+ <table border=1>
+ <tr><th><th>One<th>Two<th>Three
+ <tr><th>1<td>X<td>1<td>X
+ <tr><th>2<td>0<td>X<td>0
+ <tr><th>3<td>X<td>1<td>X
+ </table>"
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html
new file mode 100644
index 0000000000..f169599387
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.html
@@ -0,0 +1,3 @@
+<h1>Multiple windows...</h1>
+
+<a target="_blank" href="newwindows.html">Popup!</a>
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml
new file mode 100644
index 0000000000..52f7a0b4dd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/newwindows.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Demonstrates opening new WebViews from HTML
+//
+// Note that to open windows from JavaScript, you will need to
+// allow it on WebView with settings.javascriptCanOpenWindows: true
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ columns: 3
+ id: pages
+ height: 300; width: 600
+
+ Component {
+ id: webViewPage
+ Rectangle {
+ width: webView.width
+ height: webView.height
+ border.color: "gray"
+
+ WebView {
+ id: webView
+ newWindowComponent: webViewPage
+ newWindowParent: pages
+ url: "newwindows.html"
+ }
+ }
+ }
+
+ Loader { sourceComponent: webViewPage }
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject b/examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/webview.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..c0dfce0cdb
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package inlinehtml
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:20:40 +0100
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..68a99304bd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+inlinehtml (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:20:40 +0100
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..dbb1638edc
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: inlinehtml
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: inlinehtml
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..67b61f74a1
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:20:40 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..39509f9e78
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/inlinehtml.sgml > inlinehtml.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/inlinehtml.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/inlinehtml install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/modelviews/webview/newwindows/main.cpp b/examples/declarative/modelviews/webview/newwindows/main.cpp
new file mode 100644
index 0000000000..6be8235a0c
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/newwindows.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.desktop b/examples/declarative/modelviews/webview/newwindows/newwindows.desktop
new file mode 100644
index 0000000000..ab2655c596
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=newwindows
+Exec=/opt/usr/bin/newwindows
+Icon=newwindows
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.png b/examples/declarative/modelviews/webview/newwindows/newwindows.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.pro b/examples/declarative/modelviews/webview/newwindows/newwindows.pro
new file mode 100644
index 0000000000..0ade74b799
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEE16E439
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.svg b/examples/declarative/modelviews/webview/newwindows/newwindows.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/alerts.html b/examples/declarative/modelviews/webview/newwindows/qml/alerts.html
new file mode 100644
index 0000000000..82caddf7fb
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/alerts.html
@@ -0,0 +1,5 @@
+<html>
+<body onclick="alert('This is an alert')">
+<p>This is a web page. It fires an alert when clicked.
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/alerts.qml b/examples/declarative/modelviews/webview/newwindows/qml/alerts.qml
new file mode 100644
index 0000000000..4aa4a3bc75
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/alerts.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 150
+ url: "alerts.html"
+
+ onAlert: popup.show(message)
+
+ Rectangle {
+ id: popup
+
+ color: "red"
+ border.color: "black"; border.width: 2
+ radius: 4
+
+ y: parent.height // off "screen"
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: label.width + 5
+ height: label.height + 5
+
+ opacity: 0
+
+ function show(text) {
+ label.text = text
+ popup.state = "visible"
+ timer.start()
+ }
+ states: State {
+ name: "visible"
+ PropertyChanges { target: popup; opacity: 1 }
+ PropertyChanges { target: popup; y: (webView.height-popup.height)/2 }
+ }
+
+ transitions: [
+ Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } },
+ Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } }
+ ]
+
+ Timer {
+ id: timer
+ interval: 1000
+
+ onTriggered: popup.state = ""
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ width: webView.width *0.75
+
+ color: "white"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ smooth: true
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/autosize.qml b/examples/declarative/modelviews/webview/newwindows/qml/autosize.qml
new file mode 100644
index 0000000000..7e10403f8f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/autosize.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ id: rect
+ width: 200
+ height: layout.height
+
+ Column {
+ id: layout
+ spacing: 2
+
+ WebView {
+ html: "No width defined."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml
new file mode 100644
index 0000000000..9a865795e0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/Map.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Item {
+ id: page
+
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ property alias status: js.status
+
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ pressGrabTime: 0
+ javaScriptWindowObjects: QtObject {
+ id: js
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ property string status: "Loading"
+
+ onAddressChanged: {
+ if (map.url != "" && map.progress == 1)
+ map.evaluateJavaScript("goToAddress()")
+ }
+ }
+
+ onLoadFinished: { evaluateJavaScript("goToAddress()"); }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html b/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html
new file mode 100644
index 0000000000..a98da5430f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var geocoder
+ var map
+ function goToLatLng(latlng,bounds) {
+ if (map) {
+ map.setCenter(latlng)
+ map.fitBounds(bounds)
+ } else {
+ var myOptions = {
+ zoom: 8,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ }
+ }
+ function initialize() {
+ geocoder = new google.maps.Geocoder();
+ if (window.qml.address) {
+ goToAddress()
+ } else {
+ goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
+ }
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
+ window.qml.lat = initialLocation.lat;
+ window.qml.lng = initialLocation.lng;
+ goToLatLng(initialLocation);
+ });
+ }
+ }
+ function goToAddress() {
+ if (geocoder) {
+ var req = {
+ address: window.qml.address,
+ }
+ if (map)
+ req.bounds = map.getBounds()
+ window.qml.status = "Loading";
+ geocoder.geocode(req, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ window.qml.status = "Ready";
+ goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
+ } else {
+ window.qml.status = "Error";
+ }
+ });
+ }
+ }
+</script>
+</head>
+<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
+ <div id="map_canvas" style="width:100%; height:100%"></div>
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png b/examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png
new file mode 100644
index 0000000000..ecc95331f2
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png b/examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png
new file mode 100644
index 0000000000..5795f04fbf
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml b/examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml
new file mode 100644
index 0000000000..aed0ddd025
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/googlemaps.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import QtQuick 1.0
+import QtWebKit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml b/examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml
new file mode 100644
index 0000000000..afc1fa93d3
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/inlinehtml.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Inline HTML with loose formatting can be
+// set on the html property.
+WebView {
+ html:"\
+ <body>
+ <table border=1>
+ <tr><th><th>One<th>Two<th>Three
+ <tr><th>1<td>X<td>1<td>X
+ <tr><th>2<td>0<td>X<td>0
+ <tr><th>3<td>X<td>1<td>X
+ </table>"
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/newwindows.html b/examples/declarative/modelviews/webview/newwindows/qml/newwindows.html
new file mode 100644
index 0000000000..f169599387
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows.html
@@ -0,0 +1,3 @@
+<h1>Multiple windows...</h1>
+
+<a target="_blank" href="newwindows.html">Popup!</a>
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml
new file mode 100644
index 0000000000..52f7a0b4dd
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Demonstrates opening new WebViews from HTML
+//
+// Note that to open windows from JavaScript, you will need to
+// allow it on WebView with settings.javascriptCanOpenWindows: true
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ columns: 3
+ id: pages
+ height: 300; width: 600
+
+ Component {
+ id: webViewPage
+ Rectangle {
+ width: webView.width
+ height: webView.height
+ border.color: "gray"
+
+ WebView {
+ id: webView
+ newWindowComponent: webViewPage
+ newWindowParent: pages
+ url: "newwindows.html"
+ }
+ }
+ }
+
+ Loader { sourceComponent: webViewPage }
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject b/examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/webview.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/positioners/main.cpp b/examples/declarative/positioners/main.cpp
new file mode 100644
index 0000000000..fe93a52c06
--- /dev/null
+++ b/examples/declarative/positioners/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/positioners.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/positioners/positioners.desktop b/examples/declarative/positioners/positioners.desktop
new file mode 100644
index 0000000000..16b8efcf3a
--- /dev/null
+++ b/examples/declarative/positioners/positioners.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=positioners
+Exec=/opt/usr/bin/positioners
+Icon=positioners
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/positioners/positioners.png b/examples/declarative/positioners/positioners.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/positioners/positioners.png
Binary files differ
diff --git a/examples/declarative/positioners/positioners.pro b/examples/declarative/positioners/positioners.pro
new file mode 100644
index 0000000000..38daa89929
--- /dev/null
+++ b/examples/declarative/positioners/positioners.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE6D726D3
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/positioners/positioners.svg b/examples/declarative/positioners/positioners.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/positioners/positioners.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/positioners/qml/Button.qml b/examples/declarative/positioners/qml/Button.qml
new file mode 100644
index 0000000000..32e59933c8
--- /dev/null
+++ b/examples/declarative/positioners/qml/Button.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+
+ property string text
+ property string icon
+ signal clicked
+
+ border.color: "black"; color: "steelblue"; radius: 5
+ width: pix.width + textelement.width + 13
+ height: pix.height + 10
+
+ Image { id: pix; x: 5; y:5; source: parent.icon }
+
+ Text {
+ id: textelement
+ text: page.text; color: "white"
+ x: pix.width + pix.x + 3
+ anchors.verticalCenter: pix.verticalCenter
+ }
+
+ MouseArea {
+ id: mr
+ anchors.fill: parent
+ onClicked: { parent.focus = true; page.clicked() }
+ }
+
+ states: State {
+ name: "pressed"; when: mr.pressed
+ PropertyChanges { target: textelement; x: 5 }
+ PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 }
+ }
+}
diff --git a/examples/declarative/positioners/add.png b/examples/declarative/positioners/qml/add.png
index 1ee45423e3..1ee45423e3 100644
--- a/examples/declarative/positioners/add.png
+++ b/examples/declarative/positioners/qml/add.png
Binary files differ
diff --git a/examples/declarative/positioners/del.png b/examples/declarative/positioners/qml/del.png
index 8d2eaed523..8d2eaed523 100644
--- a/examples/declarative/positioners/del.png
+++ b/examples/declarative/positioners/qml/del.png
Binary files differ
diff --git a/examples/declarative/positioners/qml/positioners.qml b/examples/declarative/positioners/qml/positioners.qml
new file mode 100644
index 0000000000..6ae265e01b
--- /dev/null
+++ b/examples/declarative/positioners/qml/positioners.qml
@@ -0,0 +1,253 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 420; height: 420
+
+ Column {
+ id: layout1
+ y: 0
+ move: Transition {
+ NumberAnimation { properties: "y"; easing.type: Easing.OutBounce }
+ }
+ add: Transition {
+ NumberAnimation { properties: "y"; easing.type: Easing.OutQuad }
+ }
+
+ Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueV1
+ width: 100; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 100; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueV2
+ width: 100; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 100; height: 50; border.color: "black"; radius: 15 }
+ }
+
+ Row {
+ id: layout2
+ y: 300
+ move: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.OutBounce }
+ }
+ add: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.OutQuad }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueH1
+ width: 50; height: 100
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueH2
+ width: 50; height: 100
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ }
+
+ Button {
+ x: 135; y: 90
+ text: "Remove"
+ icon: "del.png"
+
+ onClicked: {
+ blueH2.opacity = 0
+ blueH1.opacity = 0
+ blueV1.opacity = 0
+ blueV2.opacity = 0
+ blueG1.opacity = 0
+ blueG2.opacity = 0
+ blueG3.opacity = 0
+ blueF1.opacity = 0
+ blueF2.opacity = 0
+ blueF3.opacity = 0
+ }
+ }
+
+ Button {
+ x: 145; y: 140
+ text: "Add"
+ icon: "add.png"
+
+ onClicked: {
+ blueH2.opacity = 1
+ blueH1.opacity = 1
+ blueV1.opacity = 1
+ blueV2.opacity = 1
+ blueG1.opacity = 1
+ blueG2.opacity = 1
+ blueG3.opacity = 1
+ blueF1.opacity = 1
+ blueF2.opacity = 1
+ blueF3.opacity = 1
+ }
+ }
+
+ Grid {
+ x: 260; y: 0
+ columns: 3
+
+ move: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ add: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueG1
+ width: 50; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueG2
+ width: 50; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueG3
+ width: 50; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
+ Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 }
+ Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 }
+ }
+
+ Flow {
+ id: layout4
+ x: 260; y: 250; width: 150
+
+ move: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ add: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueF1
+ width: 60; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 30; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueF2
+ width: 60; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueF3
+ width: 40; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "red"; width: 80; height: 50; border.color: "black"; radius: 15 }
+ }
+
+}
diff --git a/examples/declarative/positioners/positioners.qmlproject b/examples/declarative/positioners/qml/positioners.qmlproject
index e5262175c5..e5262175c5 100644
--- a/examples/declarative/positioners/positioners.qmlproject
+++ b/examples/declarative/positioners/qml/positioners.qmlproject
diff --git a/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/positioners/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
index 3044430cd7..fa343b94bb 100644
--- a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
@@ -226,7 +226,17 @@ Rectangle {
Component {
id: viewDelegate
Item {
- width: (listView.effectiveLayoutDirection == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50
+ function effectiveLayoutDirection() {
+ if (LayoutMirroring.enabled)
+ if (listView.layoutDirection == Qt.LeftToRight)
+ return Qt.RightToLeft;
+ else
+ return Qt.LeftToRight;
+ else
+ return listView.layoutDirection;
+ }
+
+ width: (effectiveLayoutDirection() == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50
Rectangle {
width: 40; height: 40
color: Qt.rgba(0.5+(48 - index)*Math.random()/48,
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.desktop b/examples/declarative/text/fonts/availableFonts/availableFonts.desktop
new file mode 100644
index 0000000000..708a8cfe7b
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=availableFonts
+Exec=/opt/usr/bin/availableFonts
+Icon=availableFonts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.png b/examples/declarative/text/fonts/availableFonts/availableFonts.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.png
Binary files differ
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.pro b/examples/declarative/text/fonts/availableFonts/availableFonts.pro
new file mode 100644
index 0000000000..75753e0823
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE696D9F7
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.svg b/examples/declarative/text/fonts/availableFonts/availableFonts.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/availableFonts/main.cpp b/examples/declarative/text/fonts/availableFonts/main.cpp
new file mode 100644
index 0000000000..2ae3bd64f4
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/availableFonts.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/availableFonts.qml b/examples/declarative/text/fonts/availableFonts/qml/availableFonts.qml
new file mode 100644
index 0000000000..4966a415c2
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/banner.qml b/examples/declarative/text/fonts/availableFonts/qml/banner.qml
new file mode 100644
index 0000000000..d722468917
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/fonts.qml b/examples/declarative/text/fonts/availableFonts/qml/fonts.qml
new file mode 100644
index 0000000000..ae48f2424d
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/fonts.qmlproject b/examples/declarative/text/fonts/availableFonts/qml/fonts.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/fonts.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/text/fonts/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/availableFonts/qml/fonts/tarzeau_ocr_a.ttf
index cf93f9651f..cf93f9651f 100644
--- a/examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf
+++ b/examples/declarative/text/fonts/availableFonts/qml/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/availableFonts/qml/hello.qml b/examples/declarative/text/fonts/availableFonts/qml/hello.qml
new file mode 100644
index 0000000000..3aaf0fe704
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/text/fonts/banner/banner.desktop b/examples/declarative/text/fonts/banner/banner.desktop
new file mode 100644
index 0000000000..3cc66c528d
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=banner
+Exec=/opt/usr/bin/banner
+Icon=banner
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/text/fonts/banner/banner.png b/examples/declarative/text/fonts/banner/banner.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.png
Binary files differ
diff --git a/examples/declarative/text/fonts/banner/banner.pro b/examples/declarative/text/fonts/banner/banner.pro
new file mode 100644
index 0000000000..8f4279c1b5
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEBAA8CBE
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/banner/banner.svg b/examples/declarative/text/fonts/banner/banner.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/banner/main.cpp b/examples/declarative/text/fonts/banner/main.cpp
new file mode 100644
index 0000000000..a61e2724e5
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/banner.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/banner/qml/availableFonts.qml b/examples/declarative/text/fonts/banner/qml/availableFonts.qml
new file mode 100644
index 0000000000..4966a415c2
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qml/banner.qml b/examples/declarative/text/fonts/banner/qml/banner.qml
new file mode 100644
index 0000000000..d722468917
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qml/fonts.qml b/examples/declarative/text/fonts/banner/qml/fonts.qml
new file mode 100644
index 0000000000..ae48f2424d
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qml/fonts.qmlproject b/examples/declarative/text/fonts/banner/qml/fonts.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/fonts.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/text/fonts/banner/qml/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/banner/qml/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 0000000000..cf93f9651f
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/banner/qml/hello.qml b/examples/declarative/text/fonts/banner/qml/hello.qml
new file mode 100644
index 0000000000..3aaf0fe704
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/text/fonts/fonts/fonts.desktop b/examples/declarative/text/fonts/fonts/fonts.desktop
new file mode 100644
index 0000000000..ffb31e918d
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=fonts
+Exec=/opt/usr/bin/fonts
+Icon=fonts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/text/fonts/fonts/fonts.png b/examples/declarative/text/fonts/fonts/fonts.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.png
Binary files differ
diff --git a/examples/declarative/text/fonts/fonts/fonts.pro b/examples/declarative/text/fonts/fonts/fonts.pro
new file mode 100644
index 0000000000..a7342f0741
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE4CA52B6
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/fonts/fonts.svg b/examples/declarative/text/fonts/fonts/fonts.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/fonts/main.cpp b/examples/declarative/text/fonts/fonts/main.cpp
new file mode 100644
index 0000000000..4b70cac690
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/fonts.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/availableFonts.qml b/examples/declarative/text/fonts/fonts/qml/availableFonts.qml
new file mode 100644
index 0000000000..4966a415c2
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/banner.qml b/examples/declarative/text/fonts/fonts/qml/banner.qml
new file mode 100644
index 0000000000..d722468917
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts.qml b/examples/declarative/text/fonts/fonts/qml/fonts.qml
new file mode 100644
index 0000000000..ae48f2424d
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts.qmlproject b/examples/declarative/text/fonts/fonts/qml/fonts.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts.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/text/fonts/fonts/qml/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/fonts/qml/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 0000000000..cf93f9651f
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/fonts/qml/hello.qml b/examples/declarative/text/fonts/fonts/qml/hello.qml
new file mode 100644
index 0000000000..3aaf0fe704
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/text/fonts/hello/hello.desktop b/examples/declarative/text/fonts/hello/hello.desktop
new file mode 100644
index 0000000000..ad55aade26
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=hello
+Exec=/opt/usr/bin/hello
+Icon=hello
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/text/fonts/hello/hello.png b/examples/declarative/text/fonts/hello/hello.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.png
Binary files differ
diff --git a/examples/declarative/text/fonts/hello/hello.pro b/examples/declarative/text/fonts/hello/hello.pro
new file mode 100644
index 0000000000..a0b04be171
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE4A6D856
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/hello/hello.svg b/examples/declarative/text/fonts/hello/hello.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/hello/main.cpp b/examples/declarative/text/fonts/hello/main.cpp
new file mode 100644
index 0000000000..ad9494a62e
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/hello.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/hello/qml/availableFonts.qml b/examples/declarative/text/fonts/hello/qml/availableFonts.qml
new file mode 100644
index 0000000000..4966a415c2
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qml/banner.qml b/examples/declarative/text/fonts/hello/qml/banner.qml
new file mode 100644
index 0000000000..d722468917
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qml/fonts.qml b/examples/declarative/text/fonts/hello/qml/fonts.qml
new file mode 100644
index 0000000000..ae48f2424d
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qml/fonts.qmlproject b/examples/declarative/text/fonts/hello/qml/fonts.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/fonts.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/text/fonts/hello/qml/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/hello/qml/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 0000000000..cf93f9651f
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/hello/qml/hello.qml b/examples/declarative/text/fonts/hello/qml/hello.qml
new file mode 100644
index 0000000000..3aaf0fe704
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/text/textselection/main.cpp b/examples/declarative/text/textselection/main.cpp
new file mode 100644
index 0000000000..94227ff2af
--- /dev/null
+++ b/examples/declarative/text/textselection/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/textselection.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/textselection/pics/endHandle.png b/examples/declarative/text/textselection/qml/pics/endHandle.png
index 1a4bc5d7a0..1a4bc5d7a0 100644
--- a/examples/declarative/text/textselection/pics/endHandle.png
+++ b/examples/declarative/text/textselection/qml/pics/endHandle.png
Binary files differ
diff --git a/examples/declarative/text/textselection/pics/endHandle.sci b/examples/declarative/text/textselection/qml/pics/endHandle.sci
index 4f51f24278..4f51f24278 100644
--- a/examples/declarative/text/textselection/pics/endHandle.sci
+++ b/examples/declarative/text/textselection/qml/pics/endHandle.sci
diff --git a/examples/declarative/text/textselection/pics/startHandle.png b/examples/declarative/text/textselection/qml/pics/startHandle.png
index deedcd5c91..deedcd5c91 100644
--- a/examples/declarative/text/textselection/pics/startHandle.png
+++ b/examples/declarative/text/textselection/qml/pics/startHandle.png
Binary files differ
diff --git a/examples/declarative/text/textselection/pics/startHandle.sci b/examples/declarative/text/textselection/qml/pics/startHandle.sci
index f9eae204c1..f9eae204c1 100644
--- a/examples/declarative/text/textselection/pics/startHandle.sci
+++ b/examples/declarative/text/textselection/qml/pics/startHandle.sci
diff --git a/examples/declarative/text/textselection/qml/textselection.qml b/examples/declarative/text/textselection/qml/textselection.qml
new file mode 100644
index 0000000000..f343be5c21
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection.qml
@@ -0,0 +1,290 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ id: editor
+ color: "lightGrey"
+ width: 640; height: 480
+
+ Rectangle {
+ color: "white"
+ anchors.fill: parent
+ anchors.margins: 20
+
+ BorderImage {
+ id: startHandle
+ source: "pics/startHandle.sci"
+ opacity: 0.0
+ width: 10
+ x: edit.positionToRectangle(edit.selectionStart).x - flick.contentX-width
+ y: edit.positionToRectangle(edit.selectionStart).y - flick.contentY
+ height: edit.positionToRectangle(edit.selectionStart).height
+ }
+
+ BorderImage {
+ id: endHandle
+ source: "pics/endHandle.sci"
+ opacity: 0.0
+ width: 10
+ x: edit.positionToRectangle(edit.selectionEnd).x - flick.contentX
+ y: edit.positionToRectangle(edit.selectionEnd).y - flick.contentY
+ height: edit.positionToRectangle(edit.selectionEnd).height
+ }
+
+ Flickable {
+ id: flick
+
+ anchors.fill: parent
+ contentWidth: edit.paintedWidth
+ contentHeight: edit.paintedHeight
+ interactive: true
+ clip: true
+
+ function ensureVisible(r) {
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit {
+ id: edit
+ width: flick.width
+ height: flick.height
+ focus: true
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
+
+ text: "<h1>Text Selection</h1>"
+ +"<p>This example is a whacky text selection mechanisms, showing how these can be implemented in the TextEdit element, to cater for whatever style is appropriate for the target platform."
+ +"<p><b>Press-and-hold</b> to select a word, then drag the selection handles."
+ +"<p><b>Drag outside the selection</b> to scroll the text."
+ +"<p><b>Click inside the selection</b> to cut/copy/paste/cancel selection."
+ +"<p>It's too whacky to let you paste if there is no current selection."
+
+ MouseArea {
+ property string drag: ""
+ property int pressPos
+
+ x: -startHandle.width
+ y: 0
+ width: parent.width+startHandle.width+endHandle.width
+ height: parent.height
+
+ onPressAndHold: {
+ if (editor.state == "") {
+ edit.cursorPosition = edit.positionAt(mouse.x+x,mouse.y+y);
+ edit.selectWord();
+ editor.state = "selection"
+ }
+ }
+
+ onClicked: {
+ if (editor.state == "") {
+ edit.cursorPosition = edit.positionAt(mouse.x+x,mouse.y+y);
+ if (!edit.focus)
+ edit.focus = true;
+ edit.openSoftwareInputPanel();
+ }
+ }
+
+ function hitHandle(h,x,y) {
+ return x>=h.x+flick.contentX && x<h.x+flick.contentX+h.width && y>=h.y+flick.contentY && y<h.y+flick.contentY+h.height
+ }
+
+ onPressed: {
+ if (editor.state == "selection") {
+ if (hitHandle(startHandle,mouse.x+x,mouse.y+y)) {
+ drag = "start"
+ flick.interactive = false
+ } else if (hitHandle(endHandle,mouse.x+x,mouse.y+y)) {
+ drag = "end"
+ flick.interactive = false
+ } else {
+ var pos = edit.positionAt(mouse.x+x,mouse.y+y);
+ if (pos >= edit.selectionStart && pos <= edit.selectionEnd) {
+ drag = "selection"
+ flick.interactive = false
+ } else {
+ drag = ""
+ flick.interactive = true
+ }
+ }
+ }
+ }
+
+ onReleased: {
+ if (editor.state == "selection") {
+ if (drag == "selection") {
+ editor.state = "menu"
+ }
+ drag = ""
+ }
+ flick.interactive = true
+ }
+
+ onPositionChanged: {
+ if (editor.state == "selection" && drag != "") {
+ if (drag == "start") {
+ var pos = edit.positionAt(mouse.x+x+startHandle.width/2,mouse.y+y);
+ var e = edit.selectionEnd;
+ if (e < pos)
+ e = pos;
+ edit.select(pos,e);
+ } else if (drag == "end") {
+ var pos = edit.positionAt(mouse.x+x-endHandle.width/2,mouse.y+y);
+ var s = edit.selectionStart;
+ if (s > pos)
+ s = pos;
+ edit.select(s,pos);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ id: menu
+ opacity: 0.0
+ width: 100
+ height: 120
+ anchors.centerIn: parent
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ radius: 15
+ color: "#806080FF"
+ anchors.fill: parent
+ }
+
+ Column {
+ anchors.centerIn: parent
+ spacing: 8
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Cut" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { edit.cut(); editor.state = "" }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Copy" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { edit.copy(); editor.state = "selection" }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Paste" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { edit.paste(); edit.cursorPosition = edit.selectionEnd; editor.state = "" }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Deselect" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ edit.cursorPosition = edit.selectionEnd;
+ edit.select(edit.cursorPosition, edit.cursorPosition);
+ editor.state = ""
+ }
+ }
+ }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "selection"
+ PropertyChanges { target: startHandle; opacity: 1.0 }
+ PropertyChanges { target: endHandle; opacity: 1.0 }
+ },
+ State {
+ name: "menu"
+ PropertyChanges { target: startHandle; opacity: 0.5 }
+ PropertyChanges { target: endHandle; opacity: 0.5 }
+ PropertyChanges { target: menu; opacity: 1.0 }
+ }
+ ]
+}
diff --git a/examples/declarative/text/textselection/qml/textselection.qmlproject b/examples/declarative/text/textselection/qml/textselection.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection.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/text/textselection/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/text/textselection/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/text/textselection/textselection.desktop b/examples/declarative/text/textselection/textselection.desktop
new file mode 100644
index 0000000000..87e2ac0a29
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=textselection
+Exec=/opt/usr/bin/textselection
+Icon=textselection
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/text/textselection/textselection.png b/examples/declarative/text/textselection/textselection.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.png
Binary files differ
diff --git a/examples/declarative/text/textselection/textselection.pro b/examples/declarative/text/textselection/textselection.pro
new file mode 100644
index 0000000000..17543a13e7
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEFBED80D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/textselection/textselection.svg b/examples/declarative/text/textselection/textselection.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.desktop b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.desktop
new file mode 100644
index 0000000000..aa5062e673
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=experimental-gestures
+Exec=/opt/usr/bin/experimental-gestures
+Icon=experimental-gestures
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro
new file mode 100644
index 0000000000..8f989402c5
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE3FF6816
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp b/examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp
new file mode 100644
index 0000000000..08268613a8
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/experimental-gestures.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures.qml b/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures.qml
new file mode 100644
index 0000000000..6a4cb3d066
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.gestures 1.0
+
+// Only works on platforms with Touch support.
+
+Rectangle {
+ id: rect
+ width: 320
+ height: 180
+
+ Text {
+ anchors.centerIn: parent
+ text: "Tap / TapAndHold / Pan / Pinch / Swipe\nOnly works on platforms with Touch support."
+ horizontalAlignment: Text.Center
+ }
+
+ GestureArea {
+ anchors.fill: parent
+ focus: true
+
+ // Only some of the many gesture properties are shown. See Gesture documentation.
+
+ onTap:
+ console.log("tap pos = (",gesture.position.x,",",gesture.position.y,")")
+ onTapAndHold:
+ console.log("tap and hold pos = (",gesture.position.x,",",gesture.position.y,")")
+ onPan:
+ console.log("pan delta = (",gesture.delta.x,",",gesture.delta.y,") acceleration = ",gesture.acceleration)
+ onPinch:
+ console.log("pinch center = (",gesture.centerPoint.x,",",gesture.centerPoint.y,") rotation =",gesture.rotationAngle," scale =",gesture.scaleFactor)
+ onSwipe:
+ console.log("swipe angle=",gesture.swipeAngle)
+ onGesture:
+ console.log("gesture hot spot = (",gesture.hotSpot.x,",",gesture.hotSpot.y,")")
+ }
+}
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/gestures.qmlproject b/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/gestures.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/gestures.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/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp b/examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp
new file mode 100644
index 0000000000..db7fd5ab2d
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/mousearea-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.desktop b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.desktop
new file mode 100644
index 0000000000..2306ece95f
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=mousearea-example
+Exec=/opt/usr/bin/mousearea-example
+Icon=mousearea-example
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro
new file mode 100644
index 0000000000..2d20e3d8b5
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xECA7EEBE
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example.qml b/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example.qml
new file mode 100644
index 0000000000..8dacc05eba
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: box
+ width: 350; height: 250
+
+ Rectangle {
+ id: redSquare
+ width: 80; height: 80
+ anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10
+ color: "red"
+
+ Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+
+ onEntered: info.text = 'Entered'
+ onExited: info.text = 'Exited (pressed=' + pressed + ')'
+
+ onPressed: {
+ info.text = 'Pressed (button=' + (mouse.button == Qt.RightButton ? 'right' : 'left')
+ + ' shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')'
+ var posInBox = redSquare.mapToItem(box, mouse.x, mouse.y)
+ posInfo.text = + mouse.x + ',' + mouse.y + ' in square'
+ + ' (' + posInBox.x + ',' + posInBox.y + ' in window)'
+ }
+
+ onReleased: {
+ info.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')'
+ posInfo.text = ''
+ }
+
+ onPressAndHold: info.text = 'Press and hold'
+ onClicked: info.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')'
+ onDoubleClicked: info.text = 'Double clicked'
+ }
+ }
+
+ Rectangle {
+ id: blueSquare
+ width: 80; height: 80
+ x: box.width - width - 10; y: 10 // making this item draggable, so don't use anchors
+ color: "blue"
+
+ Text { text: "Drag"; font.pixelSize: 16; color: "white"; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: blueSquare
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: box.width - parent.width
+ drag.minimumY: 0
+ drag.maximumY: box.height - parent.width
+ }
+ }
+
+ Text {
+ id: info
+ anchors.bottom: posInfo.top; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+
+ onTextChanged: console.log(text)
+ }
+
+ Text {
+ id: posInfo
+ anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+ }
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea.qmlproject b/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea.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/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/touchinteraction/touchinteraction.pro b/examples/declarative/touchinteraction/touchinteraction.pro
new file mode 100644
index 0000000000..1beaeab3c4
--- /dev/null
+++ b/examples/declarative/touchinteraction/touchinteraction.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+SUBDIRS = gestures \
+ mousearea \
+ pincharea
diff --git a/examples/declarative/toys/README b/examples/declarative/toys/README
deleted file mode 100644
index ff4d0242d7..0000000000
--- a/examples/declarative/toys/README
+++ /dev/null
@@ -1,37 +0,0 @@
-These pure QML examples demonstrate
-some of what can be easily done using just a few QML files.
-
-The example launcher provided with Qt can be used to explore each of the
-examples in this directory. They can also be viewed directly with the
-QML viewer utility, without requiring compilation.
-
-Documentation for these examples can be found via the Tutorial and Examples
-link in the main Qt documentation.
-
-
-Finding the Qt Examples and Demos launcher
-==========================================
-
-On Windows:
-
-The launcher can be accessed via the Windows Start menu. Select the menu
-entry entitled "Qt Examples and Demos" entry in the submenu containing
-the Qt tools.
-
-On Mac OS X:
-
-For the binary distribution, the qtdemo executable is installed in the
-/Developer/Applications/Qt directory. For the source distribution, it is
-installed alongside the other Qt tools on the path specified when Qt is
-configured.
-
-On Unix/Linux:
-
-The qtdemo executable is installed alongside the other Qt tools on the path
-specified when Qt is configured.
-
-On all platforms:
-
-The source code for the launcher can be found in the demos/qtdemo directory
-in the Qt package. This example is built at the same time as the Qt libraries,
-tools, examples, and demonstrations.
diff --git a/examples/declarative/toys/clocks/clocks.desktop b/examples/declarative/toys/clocks/clocks.desktop
new file mode 100644
index 0000000000..96afae607f
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=clocks
+Exec=/opt/usr/bin/clocks
+Icon=clocks
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/toys/clocks/clocks.png b/examples/declarative/toys/clocks/clocks.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/clocks.pro b/examples/declarative/toys/clocks/clocks.pro
new file mode 100644
index 0000000000..8137121171
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE96223F9
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/clocks/clocks.svg b/examples/declarative/toys/clocks/clocks.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/clocks/main.cpp b/examples/declarative/toys/clocks/main.cpp
new file mode 100644
index 0000000000..09055d1a52
--- /dev/null
+++ b/examples/declarative/toys/clocks/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/clocks.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/clocks/qml/clocks.qml b/examples/declarative/toys/clocks/qml/clocks.qml
new file mode 100644
index 0000000000..3354f11e66
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 640; height: 240
+ color: "#646464"
+
+ Row {
+ anchors.centerIn: parent
+ Clock { city: "New York"; shift: -4 }
+ Clock { city: "Mumbai"; shift: 5.5 }
+ Clock { city: "Tokyo"; shift: 9 }
+ }
+ QuitButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 10
+ }
+}
diff --git a/examples/declarative/toys/clocks/qml/clocks.qmlproject b/examples/declarative/toys/clocks/qml/clocks.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks.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/toys/clocks/qml/content/Clock.qml b/examples/declarative/toys/clocks/qml/content/Clock.qml
new file mode 100644
index 0000000000..09e8393128
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/Clock.qml
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: clock
+ width: 200; height: 230
+
+ property alias city: cityLabel.text
+ property int hours
+ property int minutes
+ property int seconds
+ property real shift
+ property bool night: false
+
+ function timeChanged() {
+ var date = new Date;
+ hours = shift ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours()
+ night = ( hours < 7 || hours > 19 )
+ minutes = shift ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes()
+ seconds = date.getUTCSeconds();
+ }
+
+ Timer {
+ interval: 100; running: true; repeat: true;
+ onTriggered: clock.timeChanged()
+ }
+
+ Image { id: background; source: "clock.png"; visible: clock.night == false }
+ Image { source: "clock-night.png"; visible: clock.night == true }
+
+
+ Image {
+ x: 92.5; y: 27
+ source: "hour.png"
+ smooth: true
+ transform: Rotation {
+ id: hourRotation
+ origin.x: 7.5; origin.y: 73;
+ angle: (clock.hours * 30) + (clock.minutes * 0.5)
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 93.5; y: 17
+ source: "minute.png"
+ smooth: true
+ transform: Rotation {
+ id: minuteRotation
+ origin.x: 6.5; origin.y: 83;
+ angle: clock.minutes * 6
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 97.5; y: 20
+ source: "second.png"
+ smooth: true
+ transform: Rotation {
+ id: secondRotation
+ origin.x: 2.5; origin.y: 80;
+ angle: clock.seconds * 6
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ anchors.centerIn: background; source: "center.png"
+ }
+
+ Text {
+ id: cityLabel
+ y: 200; anchors.horizontalCenter: parent.horizontalCenter
+ color: "white"
+ font.bold: true; font.pixelSize: 14
+ style: Text.Raised; styleColor: "black"
+ }
+}
diff --git a/examples/declarative/toys/clocks/qml/content/QuitButton.qml b/examples/declarative/toys/clocks/qml/content/QuitButton.qml
new file mode 100644
index 0000000000..cbbf916a4b
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/declarative/toys/clocks/qml/content/background.png b/examples/declarative/toys/clocks/qml/content/background.png
new file mode 100644
index 0000000000..a885950862
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/background.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/content/center.png b/examples/declarative/toys/clocks/qml/content/center.png
new file mode 100644
index 0000000000..7fbd802a44
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/center.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/content/clock-night.png b/examples/declarative/toys/clocks/qml/content/clock-night.png
new file mode 100644
index 0000000000..cc7151a397
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/clock-night.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/content/clock.png b/examples/declarative/toys/clocks/qml/content/clock.png
new file mode 100644
index 0000000000..462edacc0e
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/clock.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/content/hour.png b/examples/declarative/toys/clocks/qml/content/hour.png
new file mode 100644
index 0000000000..f8061a1235
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/hour.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/content/minute.png b/examples/declarative/toys/clocks/qml/content/minute.png
new file mode 100644
index 0000000000..1297ec7c2b
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/minute.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/content/quit.png b/examples/declarative/toys/clocks/qml/content/quit.png
index b822057d4e..b822057d4e 100644
--- a/examples/declarative/ui-components/dialcontrol/content/quit.png
+++ b/examples/declarative/toys/clocks/qml/content/quit.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/content/second.png b/examples/declarative/toys/clocks/qml/content/second.png
new file mode 100644
index 0000000000..4aa9fb5e8e
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/content/second.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/toys/clocks/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/toys/corkboards/corkboards.desktop b/examples/declarative/toys/corkboards/corkboards.desktop
new file mode 100644
index 0000000000..fcd20027a1
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=corkboards
+Exec=/opt/usr/bin/corkboards
+Icon=corkboards
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/toys/corkboards/corkboards.png b/examples/declarative/toys/corkboards/corkboards.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.png
Binary files differ
diff --git a/examples/declarative/toys/corkboards/corkboards.pro b/examples/declarative/toys/corkboards/corkboards.pro
new file mode 100644
index 0000000000..9ea89f0271
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAF97D84
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/corkboards/corkboards.svg b/examples/declarative/toys/corkboards/corkboards.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/corkboards/main.cpp b/examples/declarative/toys/corkboards/main.cpp
new file mode 100644
index 0000000000..984ca0f599
--- /dev/null
+++ b/examples/declarative/toys/corkboards/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/corkboards.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/corkboards/qml/Day.qml b/examples/declarative/toys/corkboards/qml/Day.qml
new file mode 100644
index 0000000000..6afa12ec00
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/Day.qml
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Component {
+ Item {
+ property variant stickies
+
+ id: page
+ width: ListView.view.width+40; height: ListView.view.height
+
+
+ Image {
+ source: "cork.jpg"
+ width: page.ListView.view.width
+ height: page.ListView.view.height
+ fillMode: Image.PreserveAspectCrop
+ clip: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: page.focus = false;
+ }
+
+ Text {
+ text: name; x: 15; y: 8; height: 40; width: 370
+ font.pixelSize: 18; font.bold: true; color: "white"
+ style: Text.Outline; styleColor: "black"
+ }
+
+ Repeater {
+ model: notes
+ Item {
+ id: stickyPage
+
+ property int randomX: Math.random() * (page.ListView.view.width-0.5*stickyImage.width) +100
+ property int randomY: Math.random() * (page.ListView.view.height-0.5*stickyImage.height) +50
+
+ x: randomX; y: randomY
+
+ rotation: -flickable.horizontalVelocity / 100;
+ Behavior on rotation {
+ SpringAnimation { spring: 2.0; damping: 0.15 }
+ }
+
+ Item {
+ id: sticky
+ scale: 0.7
+
+ Image {
+ id: stickyImage
+ x: 8 + -width * 0.6 / 2; y: -20
+ source: "note-yellow.png"
+ scale: 0.6; transformOrigin: Item.TopLeft
+ smooth: true
+ }
+
+ TextEdit {
+ id: myText
+ x: -104; y: 36; width: 215; height: 200
+ smooth: true
+ font.pixelSize: 24
+ readOnly: false
+ rotation: -8
+ text: noteText
+ }
+
+ Item {
+ x: stickyImage.x; y: -20
+ width: stickyImage.width * stickyImage.scale
+ height: stickyImage.height * stickyImage.scale
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ drag.target: stickyPage
+ drag.axis: Drag.XandYAxis
+ drag.minimumY: 0
+ drag.maximumY: page.height - 80
+ drag.minimumX: 100
+ drag.maximumX: page.width - 140
+ onClicked: { myText.focus = true; myText.openSoftwareInputPanel(); }
+ }
+ }
+ }
+
+ Image {
+ x: -width / 2; y: -height * 0.5 / 2
+ source: "tack.png"
+ scale: 0.7; transformOrigin: Item.TopLeft
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouse.pressed
+ PropertyChanges { target: sticky; rotation: 8; scale: 1 }
+ PropertyChanges { target: page; z: 8 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "rotation,scale"; duration: 200 }
+ }
+ }
+ }
+ }
+}
+
+
+
+
+
+
+
+
diff --git a/examples/declarative/toys/corkboards/cork.jpg b/examples/declarative/toys/corkboards/qml/cork.jpg
index 160bc002bf..160bc002bf 100644
--- a/examples/declarative/toys/corkboards/cork.jpg
+++ b/examples/declarative/toys/corkboards/qml/cork.jpg
Binary files differ
diff --git a/examples/declarative/toys/corkboards/qml/corkboards.qml b/examples/declarative/toys/corkboards/qml/corkboards.qml
new file mode 100644
index 0000000000..14bc5f0b01
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards.qml
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 800; height: 480
+ color: "#464646"
+
+ ListModel {
+ id: list
+
+ ListElement {
+ name: "Sunday"
+ notes: [
+ ListElement { noteText: "Lunch" },
+ ListElement { noteText: "Birthday Party" }
+ ]
+ }
+
+ ListElement {
+ name: "Monday"
+ notes: [
+ ListElement { noteText: "Pickup kids from\nschool\n4.30pm" },
+ ListElement { noteText: "Checkout Qt" }, ListElement { noteText: "Read email" }
+ ]
+ }
+
+ ListElement {
+ name: "Tuesday"
+ notes: [
+ ListElement { noteText: "Walk dog" },
+ ListElement { noteText: "Buy newspaper" }
+ ]
+ }
+
+ ListElement {
+ name: "Wednesday"
+ notes: [ ListElement { noteText: "Cook dinner" } ]
+ }
+
+ ListElement {
+ name: "Thursday"
+ notes: [
+ ListElement { noteText: "Meeting\n5.30pm" },
+ ListElement { noteText: "Weed garden" }
+ ]
+ }
+
+ ListElement {
+ name: "Friday"
+ notes: [
+ ListElement { noteText: "More work" },
+ ListElement { noteText: "Grocery shopping" }
+ ]
+ }
+
+ ListElement {
+ name: "Saturday"
+ notes: [
+ ListElement { noteText: "Drink" },
+ ListElement { noteText: "Download Qt\nPlay with QML" }
+ ]
+ }
+ }
+
+ ListView {
+ id: flickable
+
+ anchors.fill: parent
+ focus: true
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ orientation: ListView.Horizontal
+ snapMode: ListView.SnapOneItem
+ model: list
+ delegate: Day { }
+ }
+}
diff --git a/examples/declarative/toys/corkboards/qml/corkboards.qmlproject b/examples/declarative/toys/corkboards/qml/corkboards.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards.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/toys/corkboards/note-yellow.png b/examples/declarative/toys/corkboards/qml/note-yellow.png
index 8ddecc8b03..8ddecc8b03 100644
--- a/examples/declarative/toys/corkboards/note-yellow.png
+++ b/examples/declarative/toys/corkboards/qml/note-yellow.png
Binary files differ
diff --git a/examples/declarative/toys/corkboards/tack.png b/examples/declarative/toys/corkboards/qml/tack.png
index cef2d1cd23..cef2d1cd23 100644
--- a/examples/declarative/toys/corkboards/tack.png
+++ b/examples/declarative/toys/corkboards/qml/tack.png
Binary files differ
diff --git a/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.desktop b/examples/declarative/toys/dynamicscene/dynamicscene.desktop
new file mode 100644
index 0000000000..c5170c641e
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=dynamicscene
+Exec=/opt/usr/bin/dynamicscene
+Icon=dynamicscene
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.png b/examples/declarative/toys/dynamicscene/dynamicscene.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.pro b/examples/declarative/toys/dynamicscene/dynamicscene.pro
new file mode 100644
index 0000000000..1359c5536c
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEE509F2D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.svg b/examples/declarative/toys/dynamicscene/dynamicscene.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/dynamicscene/main.cpp b/examples/declarative/toys/dynamicscene/main.cpp
new file mode 100644
index 0000000000..5dfbb60066
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/dynamicscene.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene.qml
new file mode 100644
index 0000000000..5f14e1df76
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene.qml
@@ -0,0 +1,223 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+import "qml"
+
+Item {
+ id: window
+
+ property int activeSuns: 0
+
+ //This is a desktop-sized example
+ width: 800; height: 480
+
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: window.focus = false;
+ }
+
+ //This is the message box that pops up when there's an error
+ Rectangle {
+ id: dialog
+
+ opacity: 0
+ anchors.centerIn: parent
+ width: dialogText.width + 6; height: dialogText.height + 6
+ border.color: 'black'
+ color: 'lightsteelblue'
+ z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones.
+
+ function show(str){
+ dialogText.text = str;
+ dialogAnim.start();
+ }
+
+ Text {
+ id: dialogText
+ x: 3; y: 3
+ font.pixelSize: 14
+ }
+
+ SequentialAnimation {
+ id: dialogAnim
+ NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 }
+ PauseAnimation { duration: 5000 }
+ NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 }
+ }
+ }
+
+ // sky
+ Rectangle {
+ id: sky
+ anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" }
+ GradientStop { id: gradientStopB; position: 1.0; color: "#437284" }
+ }
+ }
+
+ // stars (when there's no sun)
+ Particles {
+ id: stars
+ x: 0; y: 0; width: parent.width; height: parent.height / 2
+ source: "images/star.png"
+ angleDeviation: 360
+ velocity: 0; velocityDeviation: 0
+ count: parent.width / 10
+ fadeInDuration: 2800
+ opacity: 1
+ }
+
+ // ground
+ Rectangle {
+ id: ground
+ z: 2 // just above the sun so that the sun can set behind it
+ anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "ForestGreen" }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ // right-hand panel
+ Rectangle {
+ id: toolbox
+
+ width: 380
+ color: activePalette.window
+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
+
+ Column {
+ anchors.centerIn: parent
+ spacing: 8
+
+ Text { text: "Drag an item into the scene." }
+
+ Rectangle {
+ width: palette.width + 10; height: palette.height + 10
+ border.color: "black"
+
+ Row {
+ id: palette
+ anchors.centerIn: parent
+ spacing: 8
+
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "Sun.qml"
+ image: "../images/sun.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "GenericSceneItem.qml"
+ image: "../images/moon.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "../images/tree_s.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "../images/rabbit_brown.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "../images/rabbit_bw.png"
+ }
+ }
+ }
+
+ Text { text: "Active Suns: " + activeSuns }
+
+ Rectangle { width: parent.width; height: 1; color: "black" }
+
+ Text { text: "Arbitrary QML:" }
+
+ Rectangle {
+ width: 360; height: 240
+
+ TextEdit {
+ id: qmlText
+ anchors.fill: parent; anchors.margins: 5
+ readOnly: false
+ font.pixelSize: 14
+ wrapMode: TextEdit.WordWrap
+
+ text: "import QtQuick 1.0\nImage {\n id: smile\n x: 360 * Math.random()\n y: 180 * Math.random() \n source: 'images/face-smile.png'\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n Component.onCompleted: smile.destroy(1500);\n}"
+ }
+ }
+
+ Button {
+ text: "Create"
+ onClicked: {
+ try {
+ Qt.createQmlObject(qmlText.text, window, 'CustomObject');
+ } catch(err) {
+ dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message);
+ }
+ }
+ }
+ }
+ }
+
+ //Day state, for when a sun is added to the scene
+ states: State {
+ name: "Day"
+ when: window.activeSuns > 0
+
+ PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" }
+ PropertyChanges { target: gradientStopB; color: "SkyBlue" }
+ PropertyChanges { target: stars; opacity: 0 }
+ }
+
+ transitions: Transition {
+ PropertyAnimation { duration: 3000 }
+ ColorAnimation { duration: 3000 }
+ }
+
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene.qmlproject b/examples/declarative/toys/dynamicscene/qml/dynamicscene.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene.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/toys/dynamicscene/images/NOTE b/examples/declarative/toys/dynamicscene/qml/images/NOTE
index fcd87f9132..fcd87f9132 100644
--- a/examples/declarative/toys/dynamicscene/images/NOTE
+++ b/examples/declarative/toys/dynamicscene/qml/images/NOTE
diff --git a/examples/declarative/toys/dynamicscene/qml/images/face-smile.png b/examples/declarative/toys/dynamicscene/qml/images/face-smile.png
new file mode 100644
index 0000000000..3d66d72578
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/images/moon.png b/examples/declarative/toys/dynamicscene/qml/images/moon.png
index 1c0d6066a8..1c0d6066a8 100644
--- a/examples/declarative/toys/dynamicscene/images/moon.png
+++ b/examples/declarative/toys/dynamicscene/qml/images/moon.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/images/rabbit_brown.png b/examples/declarative/toys/dynamicscene/qml/images/rabbit_brown.png
index ebfdeed332..ebfdeed332 100644
--- a/examples/declarative/toys/dynamicscene/images/rabbit_brown.png
+++ b/examples/declarative/toys/dynamicscene/qml/images/rabbit_brown.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/images/rabbit_bw.png b/examples/declarative/toys/dynamicscene/qml/images/rabbit_bw.png
index 7bff9b92ca..7bff9b92ca 100644
--- a/examples/declarative/toys/dynamicscene/images/rabbit_bw.png
+++ b/examples/declarative/toys/dynamicscene/qml/images/rabbit_bw.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/images/star.png b/examples/declarative/toys/dynamicscene/qml/images/star.png
new file mode 100644
index 0000000000..27ef924267
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/images/star.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/images/sun.png b/examples/declarative/toys/dynamicscene/qml/images/sun.png
new file mode 100644
index 0000000000..7713ca5ce7
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/images/sun.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/images/tree_s.png b/examples/declarative/toys/dynamicscene/qml/images/tree_s.png
index 6eac35a729..6eac35a729 100644
--- a/examples/declarative/toys/dynamicscene/images/tree_s.png
+++ b/examples/declarative/toys/dynamicscene/qml/images/tree_s.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/qml/Button.qml b/examples/declarative/toys/dynamicscene/qml/qml/Button.qml
new file mode 100644
index 0000000000..8da799e054
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/qml/Button.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property variant text
+ signal clicked
+
+ height: text.height + 10; width: text.width + 20
+ border.width: 1
+ radius: 4
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: !mouseArea.pressed ? activePalette.light : activePalette.button
+ }
+ GradientStop {
+ position: 1.0
+ color: !mouseArea.pressed ? activePalette.button : activePalette.dark
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+
+ Text {
+ id: text
+ anchors.centerIn:parent
+ font.pointSize: 10
+ text: parent.text
+ color: activePalette.buttonText
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/qml/GenericSceneItem.qml b/examples/declarative/toys/dynamicscene/qml/qml/GenericSceneItem.qml
new file mode 100644
index 0000000000..739141293d
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/qml/GenericSceneItem.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ property bool created: false
+ property string image
+
+ source: image
+
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/qml/PaletteItem.qml b/examples/declarative/toys/dynamicscene/qml/qml/PaletteItem.qml
new file mode 100644
index 0000000000..cf5395fd5f
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/qml/PaletteItem.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "itemCreation.js" as Code
+
+Image {
+ id: paletteItem
+
+ property string componentFile
+ property string image
+
+ source: image
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: Code.startDrag(mouse);
+ onPositionChanged: Code.continueDrag(mouse);
+ onReleased: Code.endDrag(mouse);
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/qml/PerspectiveItem.qml b/examples/declarative/toys/dynamicscene/qml/qml/PerspectiveItem.qml
new file mode 100644
index 0000000000..6536df3636
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/qml/PerspectiveItem.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: rootItem
+
+ property bool created: false
+ property string image
+
+ property double scaledBottom: y + (height + height*scale) / 2
+ property bool onLand: scaledBottom > window.height / 2
+
+ source: image
+ opacity: onLand ? 1 : 0.25
+ scale: Math.max((y + height - 250) * 0.01, 0.3)
+ smooth: true
+
+ onCreatedChanged: {
+ if (created && !onLand)
+ rootItem.destroy();
+ else
+ z = scaledBottom;
+ }
+
+ onYChanged: z = scaledBottom;
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/qml/Sun.qml b/examples/declarative/toys/dynamicscene/qml/qml/Sun.qml
new file mode 100644
index 0000000000..5b28b39834
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/qml/Sun.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: sun
+
+ property bool created: false
+ property string image: "../images/sun.png"
+
+ source: image
+
+ // once item is created, start moving offscreen
+ NumberAnimation on y {
+ to: window.height / 2
+ running: created
+ onRunningChanged: {
+ if (running)
+ duration = (window.height - sun.y) * 10;
+ else
+ state = "OffScreen"
+ }
+ }
+
+ states: State {
+ name: "OffScreen"
+ StateChangeScript {
+ script: { sun.created = false; sun.destroy() }
+ }
+ }
+
+ onCreatedChanged: {
+ if (created) {
+ sun.z = 1; // above the sky but below the ground layer
+ window.activeSuns++;
+ } else {
+ window.activeSuns--;
+ }
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/itemCreation.js b/examples/declarative/toys/dynamicscene/qml/qml/itemCreation.js
index 4ee74c28c1..4ee74c28c1 100644
--- a/examples/declarative/toys/dynamicscene/qml/itemCreation.js
+++ b/examples/declarative/toys/dynamicscene/qml/qml/itemCreation.js
diff --git a/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/toys/tic-tac-toe/main.cpp b/examples/declarative/toys/tic-tac-toe/main.cpp
new file mode 100644
index 0000000000..5804d67961
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/tic-tac-toe.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qml/content/Button.qml b/examples/declarative/toys/tic-tac-toe/qml/content/Button.qml
new file mode 100644
index 0000000000..403d587833
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/content/Button.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text
+ property bool pressed: false
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 6
+ border { width: 1; color: Qt.darker(container.color) }
+ radius: 8
+ color: "lightgray"
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: container.pressed ? "darkgray" : "white"
+ }
+ GradientStop {
+ position: 1.0
+ color: container.color
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+
+ Text {
+ id: buttonLabel
+ anchors.centerIn: container
+ text: container.text
+ font.pixelSize: 14
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qml/content/TicTac.qml b/examples/declarative/toys/tic-tac-toe/qml/content/TicTac.qml
new file mode 100644
index 0000000000..7e507364a2
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/content/TicTac.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ signal clicked
+
+ states: [
+ State { name: "X"; PropertyChanges { target: image; source: "pics/x.png" } },
+ State { name: "O"; PropertyChanges { target: image; source: "pics/o.png" } }
+ ]
+
+ Image {
+ id: image
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/content/pics/board.png b/examples/declarative/toys/tic-tac-toe/qml/content/pics/board.png
index 7e5b7ba27c..7e5b7ba27c 100644
--- a/examples/declarative/toys/tic-tac-toe/content/pics/board.png
+++ b/examples/declarative/toys/tic-tac-toe/qml/content/pics/board.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/content/pics/o.png b/examples/declarative/toys/tic-tac-toe/qml/content/pics/o.png
index abc7ee020b..abc7ee020b 100644
--- a/examples/declarative/toys/tic-tac-toe/content/pics/o.png
+++ b/examples/declarative/toys/tic-tac-toe/qml/content/pics/o.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/content/pics/x.png b/examples/declarative/toys/tic-tac-toe/qml/content/pics/x.png
index ddc65c83b8..ddc65c83b8 100644
--- a/examples/declarative/toys/tic-tac-toe/content/pics/x.png
+++ b/examples/declarative/toys/tic-tac-toe/qml/content/pics/x.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js b/examples/declarative/toys/tic-tac-toe/qml/content/tic-tac-toe.js
index 5a166b750f..5a166b750f 100644
--- a/examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js
+++ b/examples/declarative/toys/tic-tac-toe/qml/content/tic-tac-toe.js
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qml b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qml
new file mode 100644
index 0000000000..c60f2dfeaa
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qml
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+import "content/tic-tac-toe.js" as Logic
+
+Rectangle {
+ id: game
+
+ property bool running: true
+ property real difficulty: 1.0 //chance it will actually think
+
+ width: display.width; height: display.height + 10
+
+ Image {
+ id: boardImage
+ source: "content/pics/board.png"
+ }
+
+
+ Column {
+ id: display
+
+ Grid {
+ id: board
+ width: boardImage.width; height: boardImage.height
+ columns: 3
+
+ Repeater {
+ model: 9
+
+ TicTac {
+ width: board.width/3
+ height: board.height/3
+
+ onClicked: {
+ if (game.running && Logic.canPlayAtPos(index)) {
+ if (!Logic.makeMove(index, "X"))
+ Logic.computerTurn();
+ }
+ }
+ }
+ }
+ }
+
+ Row {
+ spacing: 4
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Button {
+ text: "Hard"
+ pressed: game.difficulty == 1.0
+ onClicked: { game.difficulty = 1.0 }
+ }
+ Button {
+ text: "Moderate"
+ pressed: game.difficulty == 0.8
+ onClicked: { game.difficulty = 0.8 }
+ }
+ Button {
+ text: "Easy"
+ pressed: game.difficulty == 0.2
+ onClicked: { game.difficulty = 0.2 }
+ }
+ }
+ }
+
+
+ Text {
+ id: messageDisplay
+ anchors.centerIn: parent
+ color: "blue"
+ style: Text.Outline; styleColor: "white"
+ font.pixelSize: 50; font.bold: true
+ visible: false
+
+ Timer {
+ running: messageDisplay.visible
+ onTriggered: {
+ messageDisplay.visible = false;
+ Logic.restartGame();
+ }
+ }
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qmlproject b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/toys/tic-tac-toe/tic-tac-toe.pro b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.pro
new file mode 100644
index 0000000000..2e1fbd39fb
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEFDDF868
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.desktop b/examples/declarative/toys/tic-tac-toe/tictactoe.desktop
new file mode 100644
index 0000000000..e66569c497
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=tic-tac-toe
+Exec=/opt/usr/bin/tic-tac-toe
+Icon=tic-tac-toe
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.png b/examples/declarative/toys/tic-tac-toe/tictactoe.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.pro b/examples/declarative/toys/tic-tac-toe/tictactoe.pro
new file mode 100644
index 0000000000..2e1fbd39fb
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEFDDF868
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.svg b/examples/declarative/toys/tic-tac-toe/tictactoe.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/tvtennis/main.cpp b/examples/declarative/toys/tvtennis/main.cpp
new file mode 100644
index 0000000000..e5329b6e82
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/tvtennis.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/tvtennis/qml/tvtennis.qml b/examples/declarative/toys/tvtennis/qml/tvtennis.qml
new file mode 100644
index 0000000000..805666d5c7
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/qml/tvtennis.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 640; height: 480
+ color: "Black"
+
+ // Make a ball to bounce
+ Rectangle {
+ id: ball
+
+ // Add a property for the target y coordinate
+ property variant direction : "right"
+
+ x: 20; width: 20; height: 20; z: 1
+ color: "Lime"
+
+ // Move the ball to the right and back to the left repeatedly
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation { to: page.width - 40; duration: 2000 }
+ PropertyAction { target: ball; property: "direction"; value: "left" }
+ NumberAnimation { to: 20; duration: 2000 }
+ PropertyAction { target: ball; property: "direction"; value: "right" }
+ }
+
+ // Make y move with a velocity of 200
+ Behavior on y { SpringAnimation{ velocity: 200; }
+ }
+
+ Component.onCompleted: y = page.height-10; // start the ball motion
+
+ // Detect the ball hitting the top or bottom of the view and bounce it
+ onYChanged: {
+ if (y <= 0) {
+ y = page.height - 20;
+ } else if (y >= page.height - 20) {
+ y = 0;
+ }
+ }
+ }
+
+ // Place bats to the left and right of the view, following the y
+ // coordinates of the ball.
+ Rectangle {
+ id: leftBat
+ color: "Lime"
+ x: 2; width: 20; height: 90
+ y: ball.direction == 'left' ? ball.y - 45 : page.height/2 -45;
+ Behavior on y { SpringAnimation{ velocity: 300 } }
+ }
+ Rectangle {
+ id: rightBat
+ color: "Lime"
+ x: page.width - 22; width: 20; height: 90
+ y: ball.direction == 'right' ? ball.y - 45 : page.height/2 -45;
+ Behavior on y { SpringAnimation{ velocity: 300 } }
+ }
+
+ // The rest, to make it look realistic, if neither ever scores...
+ Rectangle { color: "Lime"; x: page.width/2-80; y: 0; width: 40; height: 60 }
+ Rectangle { color: "Black"; x: page.width/2-70; y: 10; width: 20; height: 40 }
+ Rectangle { color: "Lime"; x: page.width/2+40; y: 0; width: 40; height: 60 }
+ Rectangle { color: "Black"; x: page.width/2+50; y: 10; width: 20; height: 40 }
+ Repeater {
+ model: page.height / 20
+ Rectangle { color: "Lime"; x: page.width/2-5; y: index * 20; width: 10; height: 10 }
+ }
+}
diff --git a/examples/declarative/toys/tvtennis/qml/tvtennis.qmlproject b/examples/declarative/toys/tvtennis/qml/tvtennis.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/qml/tvtennis.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/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/toys/tvtennis/tvtennis.desktop b/examples/declarative/toys/tvtennis/tvtennis.desktop
new file mode 100644
index 0000000000..e9ca1b9a13
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=tvtennis
+Exec=/opt/usr/bin/tvtennis
+Icon=tvtennis
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/toys/tvtennis/tvtennis.png b/examples/declarative/toys/tvtennis/tvtennis.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.png
Binary files differ
diff --git a/examples/declarative/toys/tvtennis/tvtennis.pro b/examples/declarative/toys/tvtennis/tvtennis.pro
new file mode 100644
index 0000000000..36379216d0
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE6511DAE
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/tvtennis/tvtennis.svg b/examples/declarative/toys/tvtennis/tvtennis.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
index 1ffbf29925..e16a1f21e7 100644
--- a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
@@ -18,3 +18,4 @@ symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/ui-components/README b/examples/declarative/ui-components/README
deleted file mode 100644
index 7eecec104a..0000000000
--- a/examples/declarative/ui-components/README
+++ /dev/null
@@ -1,39 +0,0 @@
-With Qt Declarative, it is easy to implement the UI components that you need
-in exactly the way that you want. These examples demonstrate this by creating
-a selection of user interface components where the look and feel has been
-completely defined in a QML file.
-
-The example launcher provided with Qt can be used to explore each of the
-examples in this directory. But most can also be viewed directly with the
-QML viewer utility, without requiring compilation.
-
-Documentation for these examples can be found via the Tutorials and Examples
-link in the main Qt documentation.
-
-
-Finding the Qt Examples and Demos launcher
-==========================================
-
-On Windows:
-
-The launcher can be accessed via the Windows Start menu. Select the menu
-entry entitled "Qt Examples and Demos" entry in the submenu containing
-the Qt tools.
-
-On Mac OS X:
-
-For the binary distribution, the qtdemo executable is installed in the
-/Developer/Applications/Qt directory. For the source distribution, it is
-installed alongside the other Qt tools on the path specified when Qt is
-configured.
-
-On Unix/Linux:
-
-The qtdemo executable is installed alongside the other Qt tools on the path
-specified when Qt is configured.
-
-On all platforms:
-
-The source code for the launcher can be found in the demos/qtdemo directory
-in the Qt package. This example is built at the same time as the Qt libraries,
-tools, examples, and demonstrations.
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.desktop b/examples/declarative/ui-components/dialcontrol/dialcontrol.desktop
new file mode 100644
index 0000000000..d12a374c09
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=dialcontrol
+Exec=/opt/usr/bin/dialcontrol
+Icon=dialcontrol
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.png b/examples/declarative/ui-components/dialcontrol/dialcontrol.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.pro b/examples/declarative/ui-components/dialcontrol/dialcontrol.pro
new file mode 100644
index 0000000000..bdf55ccdce
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEB1C54E8
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.svg b/examples/declarative/ui-components/dialcontrol/dialcontrol.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/dialcontrol/main.cpp b/examples/declarative/ui-components/dialcontrol/main.cpp
new file mode 100644
index 0000000000..8b7bb6abf3
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/dialcontrol.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qml/content/Dial.qml b/examples/declarative/ui-components/dialcontrol/qml/content/Dial.qml
new file mode 100644
index 0000000000..2f1d27ab95
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/Dial.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: root
+ property real value : 0
+
+ width: 210; height: 210
+
+ Image { source: "background.png" }
+
+//! [needle_shadow]
+ Image {
+ x: 96
+ y: 35
+ source: "needle_shadow.png"
+ transform: Rotation {
+ origin.x: 9; origin.y: 67
+ angle: needleRotation.angle
+ }
+ }
+//! [needle_shadow]
+//! [needle]
+ Image {
+ id: needle
+ x: 98; y: 33
+ smooth: true
+ source: "needle.png"
+ transform: Rotation {
+ id: needleRotation
+ origin.x: 5; origin.y: 65
+ //! [needle angle]
+ angle: Math.min(Math.max(-130, root.value*2.6 - 130), 133)
+ Behavior on angle {
+ SpringAnimation {
+ spring: 1.4
+ damping: .15
+ }
+ }
+ //! [needle angle]
+ }
+ }
+//! [needle]
+//! [overlay]
+ Image { x: 21; y: 18; source: "overlay.png" }
+//! [overlay]
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qml/content/QuitButton.qml b/examples/declarative/ui-components/dialcontrol/qml/content/QuitButton.qml
new file mode 100644
index 0000000000..cbbf916a4b
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/declarative/ui-components/dialcontrol/content/background.png b/examples/declarative/ui-components/dialcontrol/qml/content/background.png
index 75d555d7ab..75d555d7ab 100644
--- a/examples/declarative/ui-components/dialcontrol/content/background.png
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/content/needle.png b/examples/declarative/ui-components/dialcontrol/qml/content/needle.png
index 2d19f75039..2d19f75039 100644
--- a/examples/declarative/ui-components/dialcontrol/content/needle.png
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/needle.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/content/needle_shadow.png b/examples/declarative/ui-components/dialcontrol/qml/content/needle_shadow.png
index 8d8a928cc5..8d8a928cc5 100644
--- a/examples/declarative/ui-components/dialcontrol/content/needle_shadow.png
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/needle_shadow.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/content/overlay.png b/examples/declarative/ui-components/dialcontrol/qml/content/overlay.png
index 3860a7b590..3860a7b590 100644
--- a/examples/declarative/ui-components/dialcontrol/content/overlay.png
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/overlay.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/content/quit.png b/examples/declarative/ui-components/dialcontrol/qml/content/quit.png
new file mode 100644
index 0000000000..b822057d4e
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/content/quit.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qml b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qml
new file mode 100644
index 0000000000..c66dcddbda
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import QtQuick 1.0
+import "content"
+//! [imports]
+
+//! [0]
+Rectangle {
+ color: "#545454"
+ width: 300; height: 300
+
+ // Dial with a slider to adjust it
+ Dial {
+ id: dial
+ anchors.centerIn: parent
+ value: slider.x * 100 / (container.width - 34)
+ }
+
+ Rectangle {
+ id: container
+ anchors { bottom: parent.bottom; left: parent.left
+ right: parent.right; leftMargin: 20; rightMargin: 20
+ bottomMargin: 10
+ }
+ height: 16
+
+ radius: 8
+ opacity: 0.7
+ smooth: true
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "gray" }
+ GradientStop { position: 1.0; color: "white" }
+ }
+
+ Rectangle {
+ id: slider
+ x: 1; y: 1; width: 30; height: 14
+ radius: 6
+ smooth: true
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#424242" }
+ GradientStop { position: 1.0; color: "black" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ anchors.margins: -16 // Increase mouse area a lot outside the slider
+ drag.target: parent; drag.axis: Drag.XAxis
+ drag.minimumX: 2; drag.maximumX: container.width - 32
+ }
+ }
+ }
+ QuitButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 10
+ }
+}
+//! [0]
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qmlproject b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/ui-components/flipable/flipable.desktop b/examples/declarative/ui-components/flipable/flipable.desktop
new file mode 100644
index 0000000000..640d99dfdb
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=flipable
+Exec=/opt/usr/bin/flipable
+Icon=flipable
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/ui-components/flipable/flipable.png b/examples/declarative/ui-components/flipable/flipable.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/flipable.pro b/examples/declarative/ui-components/flipable/flipable.pro
new file mode 100644
index 0000000000..c7ad200ccb
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE31D80B6
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/flipable/flipable.svg b/examples/declarative/ui-components/flipable/flipable.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/flipable/main.cpp b/examples/declarative/ui-components/flipable/main.cpp
new file mode 100644
index 0000000000..feb8121241
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/flipable.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/flipable/content/5_heart.png b/examples/declarative/ui-components/flipable/qml/content/5_heart.png
index fb59d81453..fb59d81453 100644
--- a/examples/declarative/ui-components/flipable/content/5_heart.png
+++ b/examples/declarative/ui-components/flipable/qml/content/5_heart.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/content/9_club.png b/examples/declarative/ui-components/flipable/qml/content/9_club.png
index 2545001904..2545001904 100644
--- a/examples/declarative/ui-components/flipable/content/9_club.png
+++ b/examples/declarative/ui-components/flipable/qml/content/9_club.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/qml/content/Card.qml b/examples/declarative/ui-components/flipable/qml/content/Card.qml
new file mode 100644
index 0000000000..32c4ed124c
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/content/Card.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Flipable {
+ id: container
+
+ property alias image: frontImage.source
+ property bool flipped: true
+ property int xAxis: 0
+ property int yAxis: 0
+ property int angle: 0
+
+ width: front.width; height: front.height
+
+ front: Image { id: frontImage; smooth: true }
+ back: Image { source: "back.png"; smooth: true }
+
+ state: "back"
+
+ MouseArea { anchors.fill: parent; onClicked: container.flipped = !container.flipped }
+
+ transform: Rotation {
+ id: rotation; origin.x: container.width / 2; origin.y: container.height / 2
+ axis.x: container.xAxis; axis.y: container.yAxis; axis.z: 0
+ }
+
+ states: State {
+ name: "back"; when: container.flipped
+ PropertyChanges { target: rotation; angle: container.angle }
+ }
+
+ transitions: Transition {
+ ParallelAnimation {
+ NumberAnimation { target: rotation; properties: "angle"; duration: 600 }
+ SequentialAnimation {
+ NumberAnimation { target: container; property: "scale"; to: 0.75; duration: 300 }
+ NumberAnimation { target: container; property: "scale"; to: 1.0; duration: 300 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/flipable/content/back.png b/examples/declarative/ui-components/flipable/qml/content/back.png
index f715d7487e..f715d7487e 100644
--- a/examples/declarative/ui-components/flipable/content/back.png
+++ b/examples/declarative/ui-components/flipable/qml/content/back.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/qml/flipable.qml b/examples/declarative/ui-components/flipable/qml/flipable.qml
new file mode 100644
index 0000000000..51867f9dac
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/flipable.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "darkgreen"
+
+ Row {
+ anchors.centerIn: parent; spacing: 30
+ Card { image: "content/9_club.png"; angle: 180; yAxis: 1 }
+ Card { image: "content/5_heart.png"; angle: 540; xAxis: 1 }
+ }
+}
diff --git a/examples/declarative/ui-components/flipable/qml/flipable.qmlproject b/examples/declarative/ui-components/flipable/qml/flipable.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/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/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/ui-components/main/main.cpp b/examples/declarative/ui-components/main/main.cpp
new file mode 100644
index 0000000000..d60f16d2d2
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/main/main.desktop b/examples/declarative/ui-components/main/main.desktop
new file mode 100644
index 0000000000..157fa32764
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=main
+Exec=/opt/usr/bin/main
+Icon=main
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/ui-components/main/main.png b/examples/declarative/ui-components/main/main.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/main.pro b/examples/declarative/ui-components/main/main.pro
new file mode 100644
index 0000000000..cf172ab073
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE647B679
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/main/main.svg b/examples/declarative/ui-components/main/main.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/main/qml/ScrollBar.qml b/examples/declarative/ui-components/main/qml/ScrollBar.qml
new file mode 100644
index 0000000000..faa501a593
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/ScrollBar.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: scrollBar
+
+ // The properties that define the scrollbar's state.
+ // position and pageSize are in the range 0.0 - 1.0. They are relative to the
+ // height of the page, i.e. a pageSize of 0.5 means that you can see 50%
+ // of the height of the view.
+ // orientation can be either Qt.Vertical or Qt.Horizontal
+ property real position
+ property real pageSize
+ property variant orientation : Qt.Vertical
+
+ // A light, semi-transparent background
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "white"
+ opacity: 0.3
+ }
+
+ // Size the bar to the required size, depending upon the orientation.
+ Rectangle {
+ x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)
+ y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1
+ width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))
+ height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "black"
+ opacity: 0.7
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/SearchBox.qml b/examples/declarative/ui-components/main/qml/SearchBox.qml
new file mode 100644
index 0000000000..f54954ae00
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/SearchBox.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id: focusScope
+ width: 250; height: 28
+
+ BorderImage {
+ source: "images/lineedit-bg.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ BorderImage {
+ source: "images/lineedit-bg-focus.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ visible: parent.activeFocus ? true : false
+ }
+
+ Text {
+ id: typeSomething
+ anchors.fill: parent; anchors.leftMargin: 8
+ verticalAlignment: Text.AlignVCenter
+ text: "Type something..."
+ color: "gray"
+ font.italic: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { focusScope.focus = true; textInput.openSoftwareInputPanel(); }
+ }
+
+ TextInput {
+ id: textInput
+ anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter }
+ focus: true
+ selectByMouse: true
+ }
+
+ Image {
+ id: clear
+ anchors { right: parent.right; rightMargin: 8; verticalCenter: parent.verticalCenter }
+ source: "images/clear.png"
+ opacity: 0
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { textInput.text = ''; focusScope.focus = true; textInput.openSoftwareInputPanel(); }
+ }
+ }
+
+ states: State {
+ name: "hasText"; when: textInput.text != ''
+ PropertyChanges { target: typeSomething; opacity: 0 }
+ PropertyChanges { target: clear; opacity: 1 }
+ }
+
+ transitions: [
+ Transition {
+ from: ""; to: "hasText"
+ NumberAnimation { exclude: typeSomething; properties: "opacity" }
+ },
+ Transition {
+ from: "hasText"; to: ""
+ NumberAnimation { properties: "opacity" }
+ }
+ ]
+}
diff --git a/examples/declarative/ui-components/main/qml/TabWidget.qml b/examples/declarative/ui-components/main/qml/TabWidget.qml
new file mode 100644
index 0000000000..f066fd2eb9
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/TabWidget.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: tabWidget
+
+ // Setting the default property to stack.children means any child items
+ // of the TabWidget are actually added to the 'stack' item's children.
+ // See the "Extending Types from QML" documentation for details on default
+ // properties.
+ default property alias content: stack.children
+
+ property int current: 0
+
+ onCurrentChanged: setOpacities()
+ Component.onCompleted: setOpacities()
+
+ function setOpacities() {
+ for (var i = 0; i < stack.children.length; ++i) {
+ stack.children[i].opacity = (i == current ? 1 : 0)
+ }
+ }
+
+ Row {
+ id: header
+
+ Repeater {
+ model: stack.children.length
+ delegate: Rectangle {
+ width: tabWidget.width / stack.children.length; height: 36
+
+ Rectangle {
+ width: parent.width; height: 1
+ anchors { bottom: parent.bottom; bottomMargin: 1 }
+ color: "#acb2c2"
+ }
+ BorderImage {
+ anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
+ border { left: 7; right: 7 }
+ source: "tab.png"
+ visible: tabWidget.current == index
+ }
+ Text {
+ horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
+ anchors.fill: parent
+ text: stack.children[index].title
+ elide: Text.ElideRight
+ font.bold: tabWidget.current == index
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tabWidget.current = index
+ }
+ }
+ }
+ }
+
+ Item {
+ id: stack
+ width: tabWidget.width
+ anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/content/ProgressBar.qml b/examples/declarative/ui-components/main/qml/content/ProgressBar.qml
new file mode 100644
index 0000000000..e92342adcf
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/content/ProgressBar.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: progressbar
+
+ property int minimum: 0
+ property int maximum: 100
+ property int value: 0
+ property alias color: gradient1.color
+ property alias secondColor: gradient2.color
+
+ width: 250; height: 23
+ clip: true
+
+ BorderImage {
+ source: "background.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ Rectangle {
+ id: highlight
+
+ property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)
+
+ width: highlight.widthDest
+ Behavior on width { SmoothedAnimation { velocity: 1200 } }
+
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
+ radius: 1
+ gradient: Gradient {
+ GradientStop { id: gradient1; position: 0.0 }
+ GradientStop { id: gradient2; position: 1.0 }
+ }
+
+ }
+ Text {
+ anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter }
+ color: "white"
+ font.bold: true
+ text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%'
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/content/Spinner.qml b/examples/declarative/ui-components/main/qml/content/Spinner.qml
new file mode 100644
index 0000000000..853c787ea4
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/content/Spinner.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ 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/progressbar/content/background.png b/examples/declarative/ui-components/main/qml/content/background.png
index 9044226f85..9044226f85 100644
--- a/examples/declarative/ui-components/progressbar/content/background.png
+++ b/examples/declarative/ui-components/main/qml/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/spinner/content/spinner-bg.png b/examples/declarative/ui-components/main/qml/content/spinner-bg.png
index b3556f1f9f..b3556f1f9f 100644
--- a/examples/declarative/ui-components/spinner/content/spinner-bg.png
+++ b/examples/declarative/ui-components/main/qml/content/spinner-bg.png
Binary files differ
diff --git a/examples/declarative/ui-components/spinner/content/spinner-select.png b/examples/declarative/ui-components/main/qml/content/spinner-select.png
index 95a17a1fe2..95a17a1fe2 100644
--- a/examples/declarative/ui-components/spinner/content/spinner-select.png
+++ b/examples/declarative/ui-components/main/qml/content/spinner-select.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/images/clear.png b/examples/declarative/ui-components/main/qml/images/clear.png
index 91eb270695..91eb270695 100644
--- a/examples/declarative/ui-components/searchbox/images/clear.png
+++ b/examples/declarative/ui-components/main/qml/images/clear.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png b/examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png
index bbfac38d2d..bbfac38d2d 100644
--- a/examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png
+++ b/examples/declarative/ui-components/main/qml/images/lineedit-bg-focus.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/images/lineedit-bg.png b/examples/declarative/ui-components/main/qml/images/lineedit-bg.png
index 9044226f85..9044226f85 100644
--- a/examples/declarative/ui-components/searchbox/images/lineedit-bg.png
+++ b/examples/declarative/ui-components/main/qml/images/lineedit-bg.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main.qml b/examples/declarative/ui-components/main/qml/main.qml
new file mode 100644
index 0000000000..842ef1a0a6
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+TabWidget {
+ id: tabs
+ width: 640; height: 480
+
+ Rectangle {
+ property string title: "Red"
+ anchors.fill: parent
+ color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#ff7f7f"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Roses are red"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ Rectangle {
+ property string title: "Green"
+ anchors.fill: parent
+ color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#7fff7f"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Flower stems are green"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ Rectangle {
+ property string title: "Blue"
+ anchors.fill: parent; color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#7f7fff"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Violets are blue"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg b/examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg
new file mode 100644
index 0000000000..d255543942
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/progressbar.qmlproject b/examples/declarative/ui-components/main/qml/progressbar.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/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/ui-components/main/qml/scrollbar.qmlproject b/examples/declarative/ui-components/main/qml/scrollbar.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/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/ui-components/main/qml/searchbox.qmlproject b/examples/declarative/ui-components/main/qml/searchbox.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/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/ui-components/main/qml/spinner.qmlproject b/examples/declarative/ui-components/main/qml/spinner.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/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/ui-components/tabwidget/tab.png b/examples/declarative/ui-components/main/qml/tab.png
index ad8021605f..ad8021605f 100644
--- a/examples/declarative/ui-components/tabwidget/tab.png
+++ b/examples/declarative/ui-components/main/qml/tab.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/tabwidget.qmlproject b/examples/declarative/ui-components/main/qml/tabwidget.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/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/main/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/ui-components/main/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/ui-components/progressbar/main.cpp b/examples/declarative/ui-components/progressbar/main.cpp
new file mode 100644
index 0000000000..be38af0784
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/progressbar/progressbar.desktop b/examples/declarative/ui-components/progressbar/progressbar.desktop
new file mode 100644
index 0000000000..3fb6f218f7
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=progressbar
+Exec=/opt/usr/bin/progressbar
+Icon=progressbar
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/ui-components/progressbar/progressbar.png b/examples/declarative/ui-components/progressbar/progressbar.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.png
Binary files differ
diff --git a/examples/declarative/ui-components/progressbar/progressbar.pro b/examples/declarative/ui-components/progressbar/progressbar.pro
new file mode 100644
index 0000000000..aae34b0dfc
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAA2206D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/progressbar/progressbar.svg b/examples/declarative/ui-components/progressbar/progressbar.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/progressbar/qml/content/ProgressBar.qml b/examples/declarative/ui-components/progressbar/qml/content/ProgressBar.qml
new file mode 100644
index 0000000000..e92342adcf
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/content/ProgressBar.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: progressbar
+
+ property int minimum: 0
+ property int maximum: 100
+ property int value: 0
+ property alias color: gradient1.color
+ property alias secondColor: gradient2.color
+
+ width: 250; height: 23
+ clip: true
+
+ BorderImage {
+ source: "background.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ Rectangle {
+ id: highlight
+
+ property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)
+
+ width: highlight.widthDest
+ Behavior on width { SmoothedAnimation { velocity: 1200 } }
+
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
+ radius: 1
+ gradient: Gradient {
+ GradientStop { id: gradient1; position: 0.0 }
+ GradientStop { id: gradient2; position: 1.0 }
+ }
+
+ }
+ Text {
+ anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter }
+ color: "white"
+ font.bold: true
+ text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%'
+ }
+}
diff --git a/examples/declarative/ui-components/progressbar/qml/content/background.png b/examples/declarative/ui-components/progressbar/qml/content/background.png
new file mode 100644
index 0000000000..9044226f85
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/progressbar/qml/main.qml b/examples/declarative/ui-components/progressbar/qml/main.qml
new file mode 100644
index 0000000000..a805a7eb88
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/main.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: main
+
+ width: 600; height: 405
+ color: "#edecec"
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: column.height + 20
+
+ Column {
+ id: column
+ x: 10; y: 10
+ spacing: 10
+
+ Repeater {
+ model: 25
+
+ ProgressBar {
+ property int r: Math.floor(Math.random() * 5000 + 1000)
+ width: main.width - 20
+
+ NumberAnimation on value { duration: r; from: 0; to: 100; loops: Animation.Infinite }
+ ColorAnimation on color { duration: r; from: "lightsteelblue"; to: "thistle"; loops: Animation.Infinite }
+ ColorAnimation on secondColor { duration: r; from: "steelblue"; to: "#CD96CD"; loops: Animation.Infinite }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/progressbar/qml/progressbar.qmlproject b/examples/declarative/ui-components/progressbar/qml/progressbar.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/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/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg b/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg
deleted file mode 100644
index 618d808ccf..0000000000
--- a/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/ui-components/slideswitch/main.cpp b/examples/declarative/ui-components/slideswitch/main.cpp
new file mode 100644
index 0000000000..ca3ffe9ef4
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/slideswitch.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/slideswitch/qml/content/Switch.qml b/examples/declarative/ui-components/slideswitch/qml/content/Switch.qml
new file mode 100644
index 0000000000..06d7a2bf40
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/content/Switch.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: toggleswitch
+ width: background.width; height: background.height
+
+//![1]
+ property bool on: false
+//![1]
+
+//![2]
+ function toggle() {
+ if (toggleswitch.state == "on")
+ toggleswitch.state = "off";
+ else
+ toggleswitch.state = "on";
+ }
+//![2]
+
+//![3]
+ function releaseSwitch() {
+ if (knob.x == 1) {
+ if (toggleswitch.state == "off") return;
+ }
+ if (knob.x == 78) {
+ if (toggleswitch.state == "on") return;
+ }
+ toggle();
+ }
+//![3]
+
+//![4]
+ Image {
+ id: background
+ source: "background.svg"
+ MouseArea { anchors.fill: parent; onClicked: toggle() }
+ }
+//![4]
+
+//![5]
+ Image {
+ id: knob
+ x: 1; y: 2
+ source: "knob.svg"
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78
+ onClicked: toggle()
+ onReleased: releaseSwitch()
+ }
+ }
+//![5]
+
+//![6]
+ states: [
+ State {
+ name: "on"
+ PropertyChanges { target: knob; x: 78 }
+ PropertyChanges { target: toggleswitch; on: true }
+ },
+ State {
+ name: "off"
+ PropertyChanges { target: knob; x: 1 }
+ PropertyChanges { target: toggleswitch; on: false }
+ }
+ ]
+//![6]
+
+//![7]
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 }
+ }
+//![7]
+}
+//![0]
diff --git a/examples/declarative/ui-components/slideswitch/content/background.svg b/examples/declarative/ui-components/slideswitch/qml/content/background.svg
index f920d3e47a..f920d3e47a 100644
--- a/examples/declarative/ui-components/slideswitch/content/background.svg
+++ b/examples/declarative/ui-components/slideswitch/qml/content/background.svg
diff --git a/examples/declarative/ui-components/slideswitch/content/knob.svg b/examples/declarative/ui-components/slideswitch/qml/content/knob.svg
index fb6933718e..fb6933718e 100644
--- a/examples/declarative/ui-components/slideswitch/content/knob.svg
+++ b/examples/declarative/ui-components/slideswitch/qml/content/knob.svg
diff --git a/examples/declarative/ui-components/slideswitch/qml/slideswitch.qml b/examples/declarative/ui-components/slideswitch/qml/slideswitch.qml
new file mode 100644
index 0000000000..0472f9f722
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/slideswitch.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ color: "white"
+ width: 400; height: 250
+
+//![0]
+ Switch { anchors.centerIn: parent; on: false }
+//![0]
+}
diff --git a/examples/declarative/ui-components/slideswitch/qml/slideswitch.qmlproject b/examples/declarative/ui-components/slideswitch/qml/slideswitch.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/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/slideswitch/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/README b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/README
new file mode 100644
index 0000000000..f2b87fba9f
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/README
@@ -0,0 +1,6 @@
+The Debian Package slideswitch
+----------------------------
+
+Comments regarding the Package
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:31:28 +0100
diff --git a/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/changelog b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/changelog
new file mode 100644
index 0000000000..46d83ac476
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/changelog
@@ -0,0 +1,5 @@
+slideswitch (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Daniel Molkentin <danimo@unknown> Thu, 18 Nov 2010 17:31:28 +0100
diff --git a/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/compat b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/compat
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/compat
@@ -0,0 +1 @@
+7
diff --git a/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/control b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/control
new file mode 100644
index 0000000000..f6eb57d03c
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/control
@@ -0,0 +1,13 @@
+Source: slideswitch
+Section: user/hidden
+Priority: optional
+Maintainer: Daniel Molkentin <danimo@unknown>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: slideswitch
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/copyright b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/copyright
new file mode 100644
index 0000000000..06785f00cb
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/copyright
@@ -0,0 +1,40 @@
+This package was debianized by Daniel Molkentin <danimo@unknown> on
+Thu, 18 Nov 2010 17:31:28 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+ <put author's name and email here>
+ <likewise for another author>
+
+Copyright:
+
+ <Copyright (C) YYYY Name OfAuthor>
+ <likewise for another author>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2010, Daniel Molkentin <danimo@unknown> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/rules b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/rules
new file mode 100755
index 0000000000..0205aef4dd
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qtc_packaging/debian_fremantle/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/slideswitch.sgml > slideswitch.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/slideswitch.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/slideswitch install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.desktop b/examples/declarative/ui-components/slideswitch/slideswitch.desktop
new file mode 100644
index 0000000000..9f46a0bc67
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=slideswitch
+Exec=/opt/usr/bin/slideswitch
+Icon=slideswitch
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.png b/examples/declarative/ui-components/slideswitch/slideswitch.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.png
Binary files differ
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.pro b/examples/declarative/ui-components/slideswitch/slideswitch.pro
new file mode 100644
index 0000000000..230281be6f
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAB2005A
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.svg b/examples/declarative/ui-components/slideswitch/slideswitch.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/xml/xmlhttprequest-example/main.cpp b/examples/declarative/xml/xmlhttprequest-example/main.cpp
new file mode 100644
index 0000000000..fd768daa36
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/qml/xmlhttprequest-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/xml/xmlhttprequest/data.xml b/examples/declarative/xml/xmlhttprequest-example/qml/data.xml
index 8b7f1e116d..8b7f1e116d 100644
--- a/examples/declarative/xml/xmlhttprequest/data.xml
+++ b/examples/declarative/xml/xmlhttprequest-example/qml/data.xml
diff --git a/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example.qml b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example.qml
new file mode 100644
index 0000000000..78f93b5a45
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 350; height: 400
+
+ function showRequestInfo(text) {
+ log.text = log.text + "\n" + text
+ console.log(text)
+ }
+
+ Text { id: log; anchors.fill: parent; anchors.margins: 10 }
+
+ Rectangle {
+ id: button
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom; anchors.margins: 10
+ width: buttonText.width + 10; height: buttonText.height + 10
+ border.width: mouseArea.pressed ? 2 : 1
+ radius : 5; smooth: true
+
+ Text { id: buttonText; anchors.centerIn: parent; text: "Request data.xml" }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ log.text = ""
+ console.log("\n")
+
+ var doc = new XMLHttpRequest();
+ doc.onreadystatechange = function() {
+ if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+
+ } else if (doc.readyState == XMLHttpRequest.DONE) {
+ var a = doc.responseXML.documentElement;
+ for (var ii = 0; ii < a.childNodes.length; ++ii) {
+ showRequestInfo(a.childNodes[ii].nodeName);
+ }
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+ }
+ }
+
+ doc.open("GET", "data.xml");
+ doc.send();
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest.qmlproject b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qml/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/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..411a04c139
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x28c7 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != ScreenOrientationAuto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+ Q_UNUSED(error)
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case ScreenOrientationAuto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.h b/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..f5b24b0199
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5a59 version 0x2000a
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(ScreenOrientation orientation);
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..1c0c7edb39
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,154 @@
+# checksum 0x3dc8 version 0x2000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else:isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Disabling QML debugging:")
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.desktop b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.desktop
new file mode 100644
index 0000000000..c5065cf678
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=xmlhttprequest-example
+Exec=/opt/usr/bin/xmlhttprequest-example
+Icon=xmlhttprequest-example
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png
Binary files differ
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro
new file mode 100644
index 0000000000..687c8ca457
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE83495FC
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/designer/calculatorbuilder/calculatorbuilder.desktop b/examples/designer/calculatorbuilder/calculatorbuilder.desktop
new file mode 100644
index 0000000000..9c7abeddb5
--- /dev/null
+++ b/examples/designer/calculatorbuilder/calculatorbuilder.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Calculator Builder
+Exec=/opt/usr/bin/calculatorbuilder
+Icon=calculatorbuilder
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/designer/calculatorbuilder/calculatorbuilder.pro b/examples/designer/calculatorbuilder/calculatorbuilder.pro
index cd8ac2cfd0..bcbb28d28e 100644
--- a/examples/designer/calculatorbuilder/calculatorbuilder.pro
+++ b/examples/designer/calculatorbuilder/calculatorbuilder.pro
@@ -14,3 +14,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorbuilder
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/designer/calculatorform/calculatorform.desktop b/examples/designer/calculatorform/calculatorform.desktop
new file mode 100644
index 0000000000..5368b7081b
--- /dev/null
+++ b/examples/designer/calculatorform/calculatorform.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Calculator Form
+Exec=/opt/usr/bin/calculatorform
+Icon=calculatorform
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/designer/calculatorform/calculatorform.pro b/examples/designer/calculatorform/calculatorform.pro
index 87e9eb9ef1..fccdb47085 100644
--- a/examples/designer/calculatorform/calculatorform.pro
+++ b/examples/designer/calculatorform/calculatorform.pro
@@ -13,3 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/designer/containerextension/containerextension.desktop b/examples/designer/containerextension/containerextension.desktop
new file mode 100644
index 0000000000..7c4ef6d715
--- /dev/null
+++ b/examples/designer/containerextension/containerextension.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Container Extension
+Exec=/opt/usr/bin/containerextension
+Icon=containerextension
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/designer/containerextension/containerextension.pro b/examples/designer/containerextension/containerextension.pro
index 8183f2da2b..4991970ce9 100644
--- a/examples/designer/containerextension/containerextension.pro
+++ b/examples/designer/containerextension/containerextension.pro
@@ -26,3 +26,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/containerextension
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/designer/customwidgetplugin/customwidgetplugin.desktop b/examples/designer/customwidgetplugin/customwidgetplugin.desktop
new file mode 100644
index 0000000000..ae652c7044
--- /dev/null
+++ b/examples/designer/customwidgetplugin/customwidgetplugin.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Custom Widget Plugin
+Exec=/opt/usr/bin/customwidgetplugin
+Icon=customwidgetplugin
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/designer/customwidgetplugin/customwidgetplugin.pro b/examples/designer/customwidgetplugin/customwidgetplugin.pro
index dc9281d911..a39c1b0d66 100644
--- a/examples/designer/customwidgetplugin/customwidgetplugin.pro
+++ b/examples/designer/customwidgetplugin/customwidgetplugin.pro
@@ -21,3 +21,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/customwidgetplugin
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/designer/designer.pro b/examples/designer/designer.pro
index 8f9553ba03..1417605c7c 100644
--- a/examples/designer/designer.pro
+++ b/examples/designer/designer.pro
@@ -18,4 +18,3 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/designer/taskmenuextension/taskmenuextension.desktop b/examples/designer/taskmenuextension/taskmenuextension.desktop
new file mode 100644
index 0000000000..278d15705e
--- /dev/null
+++ b/examples/designer/taskmenuextension/taskmenuextension.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Task Menu Extension
+Exec=/opt/usr/bin/taskmenuextension
+Icon=taskmenuextension
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/designer/taskmenuextension/taskmenuextension.pro b/examples/designer/taskmenuextension/taskmenuextension.pro
index d0e76e8bf3..9f6f429383 100644
--- a/examples/designer/taskmenuextension/taskmenuextension.pro
+++ b/examples/designer/taskmenuextension/taskmenuextension.pro
@@ -25,3 +25,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/taskmenuextension
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.desktop b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.desktop
new file mode 100644
index 0000000000..986922ce25
--- /dev/null
+++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=World Time Clock Builder
+Exec=/opt/usr/bin/worldtimeclockbuilder
+Icon=worldtimeclockbuilder
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
index 369cdff407..876036a2a5 100644
--- a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
+++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
@@ -11,3 +11,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
index 44500cb40d..4da709406d 100644
--- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
+++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
@@ -21,3 +21,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockplugin
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/desktop/desktop.pro b/examples/desktop/desktop.pro
index 1c4e05b51d..a52dc4f3bb 100644
--- a/examples/desktop/desktop.pro
+++ b/examples/desktop/desktop.pro
@@ -11,3 +11,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/desktop
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/desktop/screenshot/screenshot.desktop b/examples/desktop/screenshot/screenshot.desktop
new file mode 100644
index 0000000000..236d360123
--- /dev/null
+++ b/examples/desktop/screenshot/screenshot.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Screenshot
+Exec=/opt/usr/bin/screenshot
+Icon=screenshot
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/desktop/screenshot/screenshot.pro b/examples/desktop/screenshot/screenshot.pro
index ad743a0e62..6c52c25996 100644
--- a/examples/desktop/screenshot/screenshot.pro
+++ b/examples/desktop/screenshot/screenshot.pro
@@ -9,3 +9,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/desktop/screenshot
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/desktop/systray/systray.desktop b/examples/desktop/systray/systray.desktop
new file mode 100644
index 0000000000..0490e71548
--- /dev/null
+++ b/examples/desktop/systray/systray.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=System Tray Icon
+Exec=/opt/usr/bin/systray
+Icon=systray
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/desktop/systray/systray.pro b/examples/desktop/systray/systray.pro
index 710452b325..b5199db421 100644
--- a/examples/desktop/systray/systray.pro
+++ b/examples/desktop/systray/systray.pro
@@ -22,3 +22,8 @@ wince* {
addPlugins.path = imageformats
DEPLOYMENT += addPlugins
}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/dialogs/classwizard/classwizard.desktop b/examples/dialogs/classwizard/classwizard.desktop
new file mode 100644
index 0000000000..7f7d232092
--- /dev/null
+++ b/examples/dialogs/classwizard/classwizard.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Class Wizard
+Exec=/opt/usr/bin/classwizard
+Icon=classwizard
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/classwizard/classwizard.pro b/examples/dialogs/classwizard/classwizard.pro
index 7d2e491dbb..bb7321e1bd 100644
--- a/examples/dialogs/classwizard/classwizard.pro
+++ b/examples/dialogs/classwizard/classwizard.pro
@@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/classwizard
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/dialogs/configdialog/configdialog.desktop b/examples/dialogs/configdialog/configdialog.desktop
new file mode 100644
index 0000000000..11a326813a
--- /dev/null
+++ b/examples/dialogs/configdialog/configdialog.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Config Dialog
+Exec=/opt/usr/bin/configdialog
+Icon=configdialog
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro
index 3785718f1f..165a67abea 100644
--- a/examples/dialogs/configdialog/configdialog.pro
+++ b/examples/dialogs/configdialog/configdialog.pro
@@ -14,3 +14,7 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/dialogs/dialogs.pro b/examples/dialogs/dialogs.pro
index ed41166e77..d564093f81 100644
--- a/examples/dialogs/dialogs.pro
+++ b/examples/dialogs/dialogs.pro
@@ -17,3 +17,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs
INSTALLS += sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/dialogs/extension/extension.desktop b/examples/dialogs/extension/extension.desktop
new file mode 100644
index 0000000000..374b1c8340
--- /dev/null
+++ b/examples/dialogs/extension/extension.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Extension
+Exec=/opt/usr/bin/extension
+Icon=extension
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/extension/extension.pro b/examples/dialogs/extension/extension.pro
index f064dc259f..338d8de6b8 100644
--- a/examples/dialogs/extension/extension.pro
+++ b/examples/dialogs/extension/extension.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/extension
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/dialogs/extension/finddialog.cpp b/examples/dialogs/extension/finddialog.cpp
index 313e8e4201..2ce0391d3c 100644
--- a/examples/dialogs/extension/finddialog.cpp
+++ b/examples/dialogs/extension/finddialog.cpp
@@ -63,9 +63,6 @@ FindDialog::FindDialog(QWidget *parent)
//! [0]
moreButton->setAutoDefault(false);
- buttonBox = new QDialogButtonBox(Qt::Vertical);
- buttonBox->addButton(findButton, QDialogButtonBox::ActionRole);
- buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole);
//! [1]
//! [2]
@@ -77,7 +74,42 @@ FindDialog::FindDialog(QWidget *parent)
//! [2]
//! [3]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ // Create menu
+ QMenu *menu = new QMenu(this);
+
+ // Create Find menu item
+ menu->addAction(tr("Find"));
+
+ // Create More menu item
+ QAction *moreAction = menu->addAction(tr("More"));
+ moreAction->setCheckable(true);
+
+ // Create Options CBA
+ QAction *optionAction = new QAction(tr("Options"), this);
+
+ // Set defined menu into Options button
+ optionAction->setMenu(menu);
+ optionAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ addAction(optionAction);
+
+ // Connect More menu item to setVisible slot
+ connect(moreAction, SIGNAL(triggered(bool)), extension, SLOT(setVisible(bool)));
+
+ // Create Exit CBA
+ QAction *backSoftKeyAction = new QAction(QString(tr("Exit")), this);
+ backSoftKeyAction->setSoftKeyRole(QAction::NegativeSoftKey);
+
+ // Exit button closes the application
+ connect(backSoftKeyAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ addAction(backSoftKeyAction);
+#else
+ buttonBox = new QDialogButtonBox(Qt::Vertical);
+ buttonBox->addButton(findButton, QDialogButtonBox::ActionRole);
+ buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole);
+
connect(moreButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool)));
+#endif
QVBoxLayout *extensionLayout = new QVBoxLayout;
extensionLayout->setMargin(0);
@@ -96,13 +128,18 @@ FindDialog::FindDialog(QWidget *parent)
leftLayout->addLayout(topLeftLayout);
leftLayout->addWidget(caseCheckBox);
leftLayout->addWidget(fromStartCheckBox);
- leftLayout->addStretch(1);
QGridLayout *mainLayout = new QGridLayout;
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
+#endif
mainLayout->addLayout(leftLayout, 0, 0);
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_SIMULATOR)
mainLayout->addWidget(buttonBox, 0, 1);
+#endif
mainLayout->addWidget(extension, 1, 0, 1, 2);
+ mainLayout->setRowStretch(2, 1);
+
setLayout(mainLayout);
setWindowTitle(tr("Extension"));
diff --git a/examples/dialogs/extension/main.cpp b/examples/dialogs/extension/main.cpp
index d487faab69..9937b6d0b5 100644
--- a/examples/dialogs/extension/main.cpp
+++ b/examples/dialogs/extension/main.cpp
@@ -46,5 +46,12 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
FindDialog dialog;
- return dialog.exec();
+
+#ifdef Q_OS_SYMBIAN
+ dialog.showMaximized();
+#else
+ dialog.show();
+#endif
+
+ return app.exec();
}
diff --git a/examples/dialogs/findfiles/findfiles.desktop b/examples/dialogs/findfiles/findfiles.desktop
new file mode 100644
index 0000000000..04c91cd76d
--- /dev/null
+++ b/examples/dialogs/findfiles/findfiles.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Find Files
+Exec=/opt/usr/bin/findfiles
+Icon=findfiles
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/findfiles/findfiles.pro b/examples/dialogs/findfiles/findfiles.pro
index 2d97b3d250..ec39b72690 100644
--- a/examples/dialogs/findfiles/findfiles.pro
+++ b/examples/dialogs/findfiles/findfiles.pro
@@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/findfiles
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/dialogs/findfiles/main.cpp b/examples/dialogs/findfiles/main.cpp
index f2079f511b..c5a324a452 100644
--- a/examples/dialogs/findfiles/main.cpp
+++ b/examples/dialogs/findfiles/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#ifdef Q_OS_SYMBIAN
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/dialogs/findfiles/window.cpp b/examples/dialogs/findfiles/window.cpp
index 3d6c0fd398..f700e82d5e 100644
--- a/examples/dialogs/findfiles/window.cpp
+++ b/examples/dialogs/findfiles/window.cpp
@@ -44,7 +44,7 @@
//! [0]
Window::Window(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
browseButton = createButton(tr("&Browse..."), SLOT(browse()));
findButton = createButton(tr("&Find"), SLOT(find()));
@@ -62,11 +62,8 @@ Window::Window(QWidget *parent)
//! [0]
//! [1]
- QHBoxLayout *buttonsLayout = new QHBoxLayout;
- buttonsLayout->addStretch();
- buttonsLayout->addWidget(findButton);
-
QGridLayout *mainLayout = new QGridLayout;
+ mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addWidget(fileLabel, 0, 0);
mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
mainLayout->addWidget(textLabel, 1, 0);
@@ -75,12 +72,14 @@ Window::Window(QWidget *parent)
mainLayout->addWidget(directoryComboBox, 2, 1);
mainLayout->addWidget(browseButton, 2, 2);
mainLayout->addWidget(filesTable, 3, 0, 1, 3);
- mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 3);
- mainLayout->addLayout(buttonsLayout, 5, 0, 1, 3);
+ mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2);
+ mainLayout->addWidget(findButton, 4, 2);
setLayout(mainLayout);
setWindowTitle(tr("Find Files"));
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
resize(700, 300);
+#endif
}
//! [1]
@@ -194,7 +193,12 @@ void Window::showFiles(const QStringList &files)
filesTable->setItem(row, 1, sizeItem);
}
filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()) +
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ (" (Select file to open it)"));
+#else
(" (Double click on a file to open it)"));
+#endif
+ filesFoundLabel->setWordWrap(true);
}
//! [8]
@@ -214,6 +218,9 @@ QComboBox *Window::createComboBox(const QString &text)
comboBox->setEditable(true);
comboBox->addItem(text);
comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ comboBox->setMinimumContentsLength(3);
+#endif
return comboBox;
}
//! [10]
@@ -225,7 +232,7 @@ void Window::createFilesTable()
filesTable->setSelectionBehavior(QAbstractItemView::SelectRows);
QStringList labels;
- labels << tr("File Name") << tr("Size");
+ labels << tr("Filename") << tr("Size");
filesTable->setHorizontalHeaderLabels(labels);
filesTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
filesTable->verticalHeader()->hide();
diff --git a/examples/dialogs/findfiles/window.h b/examples/dialogs/findfiles/window.h
index 73b065233b..4dbb446e18 100644
--- a/examples/dialogs/findfiles/window.h
+++ b/examples/dialogs/findfiles/window.h
@@ -41,7 +41,7 @@
#ifndef WINDOW_H
#define WINDOW_H
-#include <QDialog>
+#include <QWidget>
#include <QDir>
QT_BEGIN_NAMESPACE
@@ -53,7 +53,7 @@ class QTableWidgetItem;
QT_END_NAMESPACE
//! [0]
-class Window : public QDialog
+class Window : public QWidget
{
Q_OBJECT
diff --git a/examples/dialogs/licensewizard/licensewizard.desktop b/examples/dialogs/licensewizard/licensewizard.desktop
new file mode 100644
index 0000000000..423d81e9b3
--- /dev/null
+++ b/examples/dialogs/licensewizard/licensewizard.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=License Wizard
+Exec=/opt/usr/bin/licensewizard
+Icon=licensewizard
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/licensewizard/licensewizard.pro b/examples/dialogs/licensewizard/licensewizard.pro
index b76ae149d9..4babe3690f 100644
--- a/examples/dialogs/licensewizard/licensewizard.pro
+++ b/examples/dialogs/licensewizard/licensewizard.pro
@@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/licensewizard
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/dialogs/sipdialog/sipdialog.desktop b/examples/dialogs/sipdialog/sipdialog.desktop
new file mode 100644
index 0000000000..b9c9955339
--- /dev/null
+++ b/examples/dialogs/sipdialog/sipdialog.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=SIP Dialog
+Exec=/opt/usr/bin/sipdialog
+Icon=sipdialog
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro
index 01ef411b66..1530d47a3f 100644
--- a/examples/dialogs/sipdialog/sipdialog.pro
+++ b/examples/dialogs/sipdialog/sipdialog.pro
@@ -11,4 +11,7 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
-
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/dialogs/standarddialogs/dialog.cpp b/examples/dialogs/standarddialogs/dialog.cpp
index 0b7728ece4..a59b3c5ef7 100644
--- a/examples/dialogs/standarddialogs/dialog.cpp
+++ b/examples/dialogs/standarddialogs/dialog.cpp
@@ -49,7 +49,7 @@
"will activate the detected escape button (if any).")
Dialog::Dialog(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
errorMessageDialog = new QErrorMessage(this);
@@ -149,6 +149,7 @@ Dialog::Dialog(QWidget *parent)
native = new QCheckBox(this);
native->setText("Use native file dialog.");
native->setChecked(true);
+
QGridLayout *layout = new QGridLayout;
layout->setColumnStretch(1, 1);
layout->setColumnMinimumWidth(1, 250);
@@ -183,7 +184,19 @@ Dialog::Dialog(QWidget *parent)
layout->addWidget(errorButton, 14, 0);
layout->addWidget(errorLabel, 14, 1);
layout->addWidget(native, 15, 0);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QWidget *widget = new QWidget;
+ widget->setLayout(layout);
+
+ QScrollArea *scrollArea = new QScrollArea(this);
+ scrollArea->setWidget(widget);
+
+ QHBoxLayout *mainLayout = new QHBoxLayout;
+ mainLayout->addWidget(scrollArea);
+ setLayout(mainLayout);
+#else
setLayout(layout);
+#endif
setWindowTitle(tr("Standard Dialogs"));
}
diff --git a/examples/dialogs/standarddialogs/dialog.h b/examples/dialogs/standarddialogs/dialog.h
index 9af17d130b..506fc00f90 100644
--- a/examples/dialogs/standarddialogs/dialog.h
+++ b/examples/dialogs/standarddialogs/dialog.h
@@ -41,7 +41,7 @@
#ifndef DIALOG_H
#define DIALOG_H
-#include <QDialog>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QCheckBox;
@@ -49,7 +49,7 @@ class QLabel;
class QErrorMessage;
QT_END_NAMESPACE
-class Dialog : public QDialog
+class Dialog : public QWidget
{
Q_OBJECT
diff --git a/examples/dialogs/standarddialogs/main.cpp b/examples/dialogs/standarddialogs/main.cpp
index 2aec376dab..5dbf2cf910 100644
--- a/examples/dialogs/standarddialogs/main.cpp
+++ b/examples/dialogs/standarddialogs/main.cpp
@@ -56,5 +56,11 @@ int main(int argc, char *argv[])
app.installTranslator(translator);
Dialog dialog;
- return dialog.exec();
+#ifdef Q_OS_SYMBIAN
+ dialog.showMaximized();
+#else
+ dialog.show();
+#endif
+
+ return app.exec();
}
diff --git a/examples/dialogs/standarddialogs/standarddialogs.desktop b/examples/dialogs/standarddialogs/standarddialogs.desktop
new file mode 100644
index 0000000000..f74830317a
--- /dev/null
+++ b/examples/dialogs/standarddialogs/standarddialogs.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Standard Dialogs
+Exec=/opt/usr/bin/standarddialogs
+Icon=standarddialogs
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro
index 86ae1d18c4..51c35bb6ae 100644
--- a/examples/dialogs/standarddialogs/standarddialogs.pro
+++ b/examples/dialogs/standarddialogs/standarddialogs.pro
@@ -11,3 +11,4 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/dialogs/tabdialog/main.cpp b/examples/dialogs/tabdialog/main.cpp
index 87265c3986..6c83aa0b80 100644
--- a/examples/dialogs/tabdialog/main.cpp
+++ b/examples/dialogs/tabdialog/main.cpp
@@ -53,5 +53,11 @@ int main(int argc, char *argv[])
fileName = ".";
TabDialog tabdialog(fileName);
- return tabdialog.exec();
+#ifdef Q_OS_SYMBIAN
+ tabdialog.showMaximized();
+#else
+ tabdialog.show();
+#endif
+
+ return app.exec();
}
diff --git a/examples/dialogs/tabdialog/tabdialog.cpp b/examples/dialogs/tabdialog/tabdialog.cpp
index 62c921c84b..5d4d345a0c 100644
--- a/examples/dialogs/tabdialog/tabdialog.cpp
+++ b/examples/dialogs/tabdialog/tabdialog.cpp
@@ -65,6 +65,7 @@ TabDialog::TabDialog(const QString &fileName, QWidget *parent)
//! [4]
QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addWidget(tabWidget);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
diff --git a/examples/dialogs/tabdialog/tabdialog.desktop b/examples/dialogs/tabdialog/tabdialog.desktop
new file mode 100644
index 0000000000..651f7d4068
--- /dev/null
+++ b/examples/dialogs/tabdialog/tabdialog.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Tab Dialog
+Exec=/opt/usr/bin/tabdialog
+Icon=tabdialog
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro
index d716b64e0c..a89c94d039 100644
--- a/examples/dialogs/tabdialog/tabdialog.pro
+++ b/examples/dialogs/tabdialog/tabdialog.pro
@@ -10,3 +10,6 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/dialogs/trivialwizard/trivialwizard.cpp b/examples/dialogs/trivialwizard/trivialwizard.cpp
index 2a5c0ae5db..3dbc039b62 100644
--- a/examples/dialogs/trivialwizard/trivialwizard.cpp
+++ b/examples/dialogs/trivialwizard/trivialwizard.cpp
@@ -128,7 +128,11 @@ int main(int argc, char *argv[])
wizard.addPage(createConclusionPage());
wizard.setWindowTitle("Trivial Wizard");
+#ifdef Q_OS_SYMBIAN
+ wizard.showMaximized();
+#else
wizard.show();
+#endif
return app.exec();
}
diff --git a/examples/dialogs/trivialwizard/trivialwizard.desktop b/examples/dialogs/trivialwizard/trivialwizard.desktop
new file mode 100644
index 0000000000..fad568ecc8
--- /dev/null
+++ b/examples/dialogs/trivialwizard/trivialwizard.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Trivial Wizard
+Exec=/opt/usr/bin/trivialwizard
+Icon=trivialwizard
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/dialogs/trivialwizard/trivialwizard.pro b/examples/dialogs/trivialwizard/trivialwizard.pro
index f17fe3712d..50ecd44128 100644
--- a/examples/dialogs/trivialwizard/trivialwizard.pro
+++ b/examples/dialogs/trivialwizard/trivialwizard.pro
@@ -7,3 +7,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/trivialwizard
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/draganddrop/delayedencoding/delayedencoding.desktop b/examples/draganddrop/delayedencoding/delayedencoding.desktop
new file mode 100644
index 0000000000..629c497b6b
--- /dev/null
+++ b/examples/draganddrop/delayedencoding/delayedencoding.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Delayed Encoding
+Exec=/opt/usr/bin/delayedencoding
+Icon=delayedencoding
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/draganddrop/delayedencoding/delayedencoding.pro b/examples/draganddrop/delayedencoding/delayedencoding.pro
index 7315ac59a7..b1ebc14c17 100644
--- a/examples/draganddrop/delayedencoding/delayedencoding.pro
+++ b/examples/draganddrop/delayedencoding/delayedencoding.pro
@@ -13,4 +13,11 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/delayedencoding
INSTALLS += target sources
-symbian:TARGET.UID3 = 0xA000C614 \ No newline at end of file
+symbian {
+ TARGET.UID3 = 0xA000C614
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/draganddrop/delayedencoding/main.cpp b/examples/draganddrop/delayedencoding/main.cpp
index a8d8e534b8..b1fa160a47 100644
--- a/examples/draganddrop/delayedencoding/main.cpp
+++ b/examples/draganddrop/delayedencoding/main.cpp
@@ -45,7 +45,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
SourceWidget window;
+#ifdef Q_OS_SYMBIAN
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/draganddrop/delayedencoding/sourcewidget.cpp b/examples/draganddrop/delayedencoding/sourcewidget.cpp
index 96205020ce..0fbeb11e00 100644
--- a/examples/draganddrop/delayedencoding/sourcewidget.cpp
+++ b/examples/draganddrop/delayedencoding/sourcewidget.cpp
@@ -60,6 +60,7 @@ SourceWidget::SourceWidget(QWidget *parent)
QLabel *instructTopLabel = new QLabel(tr("This is an SVG drawing:"));
QLabel *instructBottomLabel = new QLabel(
tr("Drag the icon to copy the drawing as a PNG file:"));
+ instructBottomLabel->setWordWrap(true);
QPushButton *dragIcon = new QPushButton(tr("Export"));
dragIcon->setIcon(QIcon(":/images/drag.png"));
diff --git a/examples/draganddrop/draggableicons/draggableicons.desktop b/examples/draganddrop/draggableicons/draggableicons.desktop
new file mode 100644
index 0000000000..d14f758ce6
--- /dev/null
+++ b/examples/draganddrop/draggableicons/draggableicons.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Draggable Icons
+Exec=/opt/usr/bin/draggableicons
+Icon=draggableicons
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro
index 9def1bce9c..81ca20fda0 100644
--- a/examples/draganddrop/draggableicons/draggableicons.pro
+++ b/examples/draganddrop/draggableicons/draggableicons.pro
@@ -13,3 +13,4 @@ symbian {
TARGET.UID3 = 0xA000C615
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/draganddrop/draggableicons/dragwidget.cpp b/examples/draganddrop/draggableicons/dragwidget.cpp
index c8c3b134fc..46bfff9330 100644
--- a/examples/draganddrop/draggableicons/dragwidget.cpp
+++ b/examples/draganddrop/draggableicons/dragwidget.cpp
@@ -46,25 +46,28 @@
DragWidget::DragWidget(QWidget *parent)
: QFrame(parent)
{
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+#else
setMinimumSize(200, 200);
+#endif
setFrameStyle(QFrame::Sunken | QFrame::StyledPanel);
setAcceptDrops(true);
QLabel *boatIcon = new QLabel(this);
boatIcon->setPixmap(QPixmap(":/images/boat.png"));
- boatIcon->move(20, 20);
+ boatIcon->move(10, 10);
boatIcon->show();
boatIcon->setAttribute(Qt::WA_DeleteOnClose);
QLabel *carIcon = new QLabel(this);
carIcon->setPixmap(QPixmap(":/images/car.png"));
- carIcon->move(120, 20);
+ carIcon->move(100, 10);
carIcon->show();
carIcon->setAttribute(Qt::WA_DeleteOnClose);
QLabel *houseIcon = new QLabel(this);
houseIcon->setPixmap(QPixmap(":/images/house.png"));
- houseIcon->move(20, 120);
+ houseIcon->move(10, 80);
houseIcon->show();
houseIcon->setAttribute(Qt::WA_DeleteOnClose);
}
diff --git a/examples/draganddrop/draggableicons/main.cpp b/examples/draganddrop/draggableicons/main.cpp
index 7a80b92a8a..a6ade67651 100644
--- a/examples/draganddrop/draggableicons/main.cpp
+++ b/examples/draganddrop/draggableicons/main.cpp
@@ -55,7 +55,11 @@ int main(int argc, char *argv[])
mainWidget.setLayout(horizontalLayout);
mainWidget.setWindowTitle(QObject::tr("Draggable Icons"));
+#ifdef Q_OS_SYMBIAN
+ mainWidget.showMaximized();
+#else
mainWidget.show();
+#endif
return app.exec();
}
diff --git a/examples/draganddrop/draggabletext/draggabletext.desktop b/examples/draganddrop/draggabletext/draggabletext.desktop
new file mode 100644
index 0000000000..ceda807604
--- /dev/null
+++ b/examples/draganddrop/draggabletext/draggabletext.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Draggable Text
+Exec=/opt/usr/bin/draggabletext
+Icon=draggabletext
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro
index 7c2cfbbd62..583c938177 100644
--- a/examples/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/draganddrop/draggabletext/draggabletext.pro
@@ -15,3 +15,5 @@ symbian {
TARGET.UID3 = 0xA000CF64
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/draganddrop/draggabletext/dragwidget.cpp b/examples/draganddrop/draggabletext/dragwidget.cpp
index df61c39476..060d41de2d 100644
--- a/examples/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/draganddrop/draggabletext/dragwidget.cpp
@@ -62,16 +62,18 @@ DragWidget::DragWidget(QWidget *parent)
wordLabel->show();
wordLabel->setAttribute(Qt::WA_DeleteOnClose);
x += wordLabel->width() + 2;
- if (x >= 195) {
+ if (x >= 245) {
x = 5;
y += wordLabel->height() + 2;
}
}
}
+ /*
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
+ */
setAcceptDrops(true);
setMinimumSize(400, qMax(200, y));
diff --git a/examples/draganddrop/draggabletext/main.cpp b/examples/draganddrop/draggabletext/main.cpp
index 4d0a121337..0ae794b280 100644
--- a/examples/draganddrop/draggabletext/main.cpp
+++ b/examples/draganddrop/draggabletext/main.cpp
@@ -47,6 +47,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
DragWidget window;
+#ifdef Q_OS_SYMBIAN
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/draganddrop/dropsite/dropsite.desktop b/examples/draganddrop/dropsite/dropsite.desktop
new file mode 100644
index 0000000000..70a192f2b1
--- /dev/null
+++ b/examples/draganddrop/dropsite/dropsite.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Drop Site
+Exec=/opt/usr/bin/dropsite
+Icon=dropsite
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/draganddrop/dropsite/dropsite.pro b/examples/draganddrop/dropsite/dropsite.pro
index 5f81b09c87..2bde25e3f0 100644
--- a/examples/draganddrop/dropsite/dropsite.pro
+++ b/examples/draganddrop/dropsite/dropsite.pro
@@ -11,3 +11,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/dropsite
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/draganddrop/fridgemagnets/dragwidget.cpp b/examples/draganddrop/fridgemagnets/dragwidget.cpp
index aeab3ade12..19abfb6976 100644
--- a/examples/draganddrop/fridgemagnets/dragwidget.cpp
+++ b/examples/draganddrop/fridgemagnets/dragwidget.cpp
@@ -65,7 +65,11 @@ DragWidget::DragWidget(QWidget *parent)
wordLabel->show();
wordLabel->setAttribute(Qt::WA_DeleteOnClose);
x += wordLabel->width() + 2;
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ if (x >= 345) {
+#else
if (x >= 245) {
+#endif
x = 5;
y += wordLabel->height() + 2;
}
diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.desktop b/examples/draganddrop/fridgemagnets/fridgemagnets.desktop
new file mode 100644
index 0000000000..a240590c6b
--- /dev/null
+++ b/examples/draganddrop/fridgemagnets/fridgemagnets.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Fridge Magnets
+Exec=/opt/usr/bin/fridgemagnets
+Icon=fridgemagnets
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/draganddrop/fridgemagnets/fridgemagnets.pro
index ea40a74eb8..f2da3bc079 100644
--- a/examples/draganddrop/fridgemagnets/fridgemagnets.pro
+++ b/examples/draganddrop/fridgemagnets/fridgemagnets.pro
@@ -16,4 +16,4 @@ symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
-
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp
index 1166abbcaa..011440b9dd 100644
--- a/examples/draganddrop/fridgemagnets/main.cpp
+++ b/examples/draganddrop/fridgemagnets/main.cpp
@@ -51,10 +51,16 @@ int main(int argc, char *argv[])
#endif
DragWidget window;
+#ifdef Q_OS_SYMBIAN
+ bool smallScreen = true;
+#else
bool smallScreen = QApplication::arguments().contains("-small-screen");
+#endif
+
if (smallScreen)
window.showFullScreen();
else
window.show();
+
return app.exec();
}
diff --git a/examples/draganddrop/puzzle/main.cpp b/examples/draganddrop/puzzle/main.cpp
index 60341948ab..b432ddc40e 100644
--- a/examples/draganddrop/puzzle/main.cpp
+++ b/examples/draganddrop/puzzle/main.cpp
@@ -49,6 +49,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
window.openImage(":/images/example.jpg");
+#ifdef Q_OS_SYMBIAN
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/draganddrop/puzzle/mainwindow.cpp b/examples/draganddrop/puzzle/mainwindow.cpp
index ea7cff12ce..09fcaf7c59 100644
--- a/examples/draganddrop/puzzle/mainwindow.cpp
+++ b/examples/draganddrop/puzzle/mainwindow.cpp
@@ -90,14 +90,15 @@ void MainWindow::setupPuzzle()
{
int size = qMin(puzzleImage.width(), puzzleImage.height());
puzzleImage = puzzleImage.copy((puzzleImage.width() - size)/2,
- (puzzleImage.height() - size)/2, size, size).scaled(400,
- 400, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ (puzzleImage.height() - size)/2, size, size).scaled(puzzleWidget->width(),
+ puzzleWidget->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
piecesList->clear();
for (int y = 0; y < 5; ++y) {
for (int x = 0; x < 5; ++x) {
- QPixmap pieceImage = puzzleImage.copy(x*80, y*80, 80, 80);
+ int pieceSize = puzzleWidget->pieceSize();
+ QPixmap pieceImage = puzzleImage.copy(x * pieceSize, y * pieceSize, pieceSize, pieceSize);
piecesList->addPiece(pieceImage, QPoint(x, y));
}
}
@@ -137,9 +138,14 @@ void MainWindow::setupWidgets()
{
QFrame *frame = new QFrame;
QHBoxLayout *frameLayout = new QHBoxLayout(frame);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ puzzleWidget = new PuzzleWidget(260);
+#else
+ puzzleWidget = new PuzzleWidget(400);
+#endif
+
+ piecesList = new PiecesList(puzzleWidget->pieceSize(), this);
- piecesList = new PiecesList;
- puzzleWidget = new PuzzleWidget;
connect(puzzleWidget, SIGNAL(puzzleCompleted()),
this, SLOT(setCompleted()), Qt::QueuedConnection);
diff --git a/examples/draganddrop/puzzle/pieceslist.cpp b/examples/draganddrop/puzzle/pieceslist.cpp
index db27e7ad13..5eb4984146 100644
--- a/examples/draganddrop/puzzle/pieceslist.cpp
+++ b/examples/draganddrop/puzzle/pieceslist.cpp
@@ -42,12 +42,12 @@
#include "pieceslist.h"
-PiecesList::PiecesList(QWidget *parent)
- : QListWidget(parent)
+PiecesList::PiecesList(int pieceSize, QWidget *parent)
+ : QListWidget(parent), m_PieceSize(pieceSize)
{
setDragEnabled(true);
setViewMode(QListView::IconMode);
- setIconSize(QSize(60, 60));
+ setIconSize(QSize(m_PieceSize, m_PieceSize));
setSpacing(10);
setAcceptDrops(true);
setDropIndicatorShown(true);
diff --git a/examples/draganddrop/puzzle/pieceslist.h b/examples/draganddrop/puzzle/pieceslist.h
index 2068dceb17..967ade0c73 100644
--- a/examples/draganddrop/puzzle/pieceslist.h
+++ b/examples/draganddrop/puzzle/pieceslist.h
@@ -48,7 +48,7 @@ class PiecesList : public QListWidget
Q_OBJECT
public:
- PiecesList(QWidget *parent = 0);
+ PiecesList(int pieceSize, QWidget *parent = 0);
void addPiece(QPixmap pixmap, QPoint location);
protected:
@@ -56,6 +56,8 @@ protected:
void dragMoveEvent(QDragMoveEvent *event);
void dropEvent(QDropEvent *event);
void startDrag(Qt::DropActions supportedActions);
+
+ int m_PieceSize;
};
#endif
diff --git a/examples/draganddrop/puzzle/puzzle.desktop b/examples/draganddrop/puzzle/puzzle.desktop
new file mode 100644
index 0000000000..f6765e1e01
--- /dev/null
+++ b/examples/draganddrop/puzzle/puzzle.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Drag and Drop Puzzle
+Exec=/opt/usr/bin/puzzle
+Icon=puzzle
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro
index c0400d87f7..ee4a5700b1 100644
--- a/examples/draganddrop/puzzle/puzzle.pro
+++ b/examples/draganddrop/puzzle/puzzle.pro
@@ -27,3 +27,4 @@ wince*: {
addFile.path = .
DEPLOYMENT += addFile
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/draganddrop/puzzle/puzzlewidget.cpp b/examples/draganddrop/puzzle/puzzlewidget.cpp
index 355c6d55cd..e83f248112 100644
--- a/examples/draganddrop/puzzle/puzzlewidget.cpp
+++ b/examples/draganddrop/puzzle/puzzlewidget.cpp
@@ -42,12 +42,12 @@
#include "puzzlewidget.h"
-PuzzleWidget::PuzzleWidget(QWidget *parent)
- : QWidget(parent)
+PuzzleWidget::PuzzleWidget(int imageSize, QWidget *parent)
+ : QWidget(parent), m_ImageSize(imageSize)
{
setAcceptDrops(true);
- setMinimumSize(400, 400);
- setMaximumSize(400, 400);
+ setMinimumSize(m_ImageSize, m_ImageSize);
+ setMaximumSize(m_ImageSize, m_ImageSize);
}
void PuzzleWidget::clear()
@@ -116,7 +116,7 @@ void PuzzleWidget::dropEvent(QDropEvent *event)
event->setDropAction(Qt::MoveAction);
event->accept();
- if (location == QPoint(square.x()/80, square.y()/80)) {
+ if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) {
inPlace++;
if (inPlace == 25)
emit puzzleCompleted();
@@ -151,7 +151,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
piecePixmaps.removeAt(found);
pieceRects.removeAt(found);
- if (location == QPoint(square.x()/80, square.y()/80))
+ if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize()))
inPlace--;
update(square);
@@ -175,7 +175,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
pieceRects.insert(found, square);
update(targetSquare(event->pos()));
- if (location == QPoint(square.x()/80, square.y()/80))
+ if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize()))
inPlace++;
}
}
@@ -200,5 +200,15 @@ void PuzzleWidget::paintEvent(QPaintEvent *event)
const QRect PuzzleWidget::targetSquare(const QPoint &position) const
{
- return QRect(position.x()/80 * 80, position.y()/80 * 80, 80, 80);
+ return QRect(position.x()/pieceSize() * pieceSize(), position.y()/pieceSize() * pieceSize(), pieceSize(), pieceSize());
+}
+
+int PuzzleWidget::pieceSize() const
+{
+ return m_ImageSize / 5;
+}
+
+int PuzzleWidget::imageSize() const
+{
+ return m_ImageSize;
}
diff --git a/examples/draganddrop/puzzle/puzzlewidget.h b/examples/draganddrop/puzzle/puzzlewidget.h
index e0356b48fd..2cc789c292 100644
--- a/examples/draganddrop/puzzle/puzzlewidget.h
+++ b/examples/draganddrop/puzzle/puzzlewidget.h
@@ -57,9 +57,12 @@ class PuzzleWidget : public QWidget
Q_OBJECT
public:
- PuzzleWidget(QWidget *parent = 0);
+ PuzzleWidget(int imageSize, QWidget *parent = 0);
void clear();
+ int pieceSize() const;
+ int imageSize() const;
+
signals:
void puzzleCompleted();
@@ -80,6 +83,7 @@ private:
QList<QPoint> pieceLocations;
QRect highlightedRect;
int inPlace;
+ int m_ImageSize;
};
#endif
diff --git a/examples/effects/blurpicker/blurpicker.cpp b/examples/effects/blurpicker/blurpicker.cpp
index 26e53aafae..362ec43931 100644
--- a/examples/effects/blurpicker/blurpicker.cpp
+++ b/examples/effects/blurpicker/blurpicker.cpp
@@ -131,8 +131,34 @@ void BlurPicker::keyPressEvent(QKeyEvent *event)
break;
}
if (m_animation.state() == QAbstractAnimation::Stopped && delta) {
- m_animation.setEndValue(m_index + delta);
- m_animation.start();
- event->accept();
+ m_animation.setEndValue(m_index + delta);
+ m_animation.start();
+ event->accept();
+ }
+}
+
+void BlurPicker::resizeEvent(QResizeEvent */*event*/)
+{
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ fitInView(sceneRect(), Qt::KeepAspectRatio);
+#endif
+}
+
+void BlurPicker::mousePressEvent(QMouseEvent *event)
+{
+ int delta = 0;
+ if(event->x() > (width() / 2))
+ {
+ delta = 1;
+ }
+ else
+ {
+ delta = -1;
+ }
+
+ if (m_animation.state() == QAbstractAnimation::Stopped && delta) {
+ m_animation.setEndValue(m_index + delta);
+ m_animation.start();
+ event->accept();
}
}
diff --git a/examples/effects/blurpicker/blurpicker.desktop b/examples/effects/blurpicker/blurpicker.desktop
new file mode 100644
index 0000000000..0863ef7ba8
--- /dev/null
+++ b/examples/effects/blurpicker/blurpicker.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Blur Picker Effect
+Exec=/opt/usr/bin/blurpicker
+Icon=blurpicker
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/effects/blurpicker/blurpicker.h b/examples/effects/blurpicker/blurpicker.h
index fa5743c70a..af367b96c2 100644
--- a/examples/effects/blurpicker/blurpicker.h
+++ b/examples/effects/blurpicker/blurpicker.h
@@ -60,6 +60,8 @@ public:
protected:
void keyPressEvent(QKeyEvent *event);
+ void resizeEvent(QResizeEvent *event);
+ void mousePressEvent(QMouseEvent *event);
private:
void setupScene();
diff --git a/examples/effects/blurpicker/blurpicker.pro b/examples/effects/blurpicker/blurpicker.pro
index 76537a9783..f3868c0c6e 100644
--- a/examples/effects/blurpicker/blurpicker.pro
+++ b/examples/effects/blurpicker/blurpicker.pro
@@ -7,3 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/effects/blurpicker
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blurpicker.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/effects/blurpicker
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/effects/blurpicker/main.cpp b/examples/effects/blurpicker/main.cpp
index e95b7e0239..5138fccfcf 100644
--- a/examples/effects/blurpicker/main.cpp
+++ b/examples/effects/blurpicker/main.cpp
@@ -47,8 +47,13 @@ int main(int argc, char **argv)
BlurPicker blurPicker;
blurPicker.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Application Picker"));
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ blurPicker.showMaximized();
+#else
blurPicker.setFixedSize(400, 300);
blurPicker.show();
+#endif
return app.exec();
}
diff --git a/examples/effects/fademessage/fademessage.cpp b/examples/effects/fademessage/fademessage.cpp
index 88f9f89f1b..158f0491bc 100644
--- a/examples/effects/fademessage/fademessage.cpp
+++ b/examples/effects/fademessage/fademessage.cpp
@@ -56,7 +56,6 @@ FadeMessage::FadeMessage(QWidget *parent): QGraphicsView(parent)
m_animation->setStartValue(0);
m_animation->setEndValue(1);
-
setRenderHint(QPainter::Antialiasing, true);
setFrameStyle(QFrame::NoFrame);
}
@@ -75,7 +74,7 @@ void FadeMessage::togglePopup()
void FadeMessage::setupScene()
{
- QGraphicsRectItem *parent = m_scene.addRect(0, 0, 400, 600);
+ QGraphicsRectItem *parent = m_scene.addRect(0, 0, 800, 600);
parent->setPen(Qt::NoPen);
parent->setZValue(0);
@@ -85,7 +84,7 @@ void FadeMessage::setupScene()
for (int i = 1; i < 5; ++i)
for (int j = 2; j < 5; ++j) {
- QGraphicsRectItem *item = m_scene.addRect(i * 50, j * 50, 38, 38);
+ QGraphicsRectItem *item = m_scene.addRect(i * 50, (j - 1) * 50, 38, 38);
item->setParentItem(parent);
item->setZValue(1);
int hue = 12 * (i * 5 + j);
@@ -124,6 +123,10 @@ void FadeMessage::setupScene()
press->setText(tr("Press me"));
connect(press, SIGNAL(clicked()), SLOT(togglePopup()));
m_scene.addWidget(press);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ press->move(200, 210);
+#else
press->move(300, 500);
+#endif
}
-
diff --git a/examples/effects/fademessage/fademessage.desktop b/examples/effects/fademessage/fademessage.desktop
new file mode 100644
index 0000000000..aa22ad7912
--- /dev/null
+++ b/examples/effects/fademessage/fademessage.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Fade Message Effect
+Exec=/opt/usr/bin/fademessage
+Icon=fademessage
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/effects/fademessage/fademessage.pro b/examples/effects/fademessage/fademessage.pro
index cb1fda790b..439477de73 100644
--- a/examples/effects/fademessage/fademessage.pro
+++ b/examples/effects/fademessage/fademessage.pro
@@ -12,5 +12,7 @@ sources.files = $$SOURCES \
fademessage.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/effects/fademessage
-DEPLOYMENT_PLUGIN += qjpeg
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/effects/fademessage/main.cpp b/examples/effects/fademessage/main.cpp
index 83d6d8eab8..8c72a458b0 100644
--- a/examples/effects/fademessage/main.cpp
+++ b/examples/effects/fademessage/main.cpp
@@ -48,8 +48,12 @@ int main(int argc, char **argv)
FadeMessage widget;
widget.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Popup Message with Effect"));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ widget.showMaximized();
+#else
widget.setFixedSize(400, 600);
widget.show();
+#endif
return app.exec();
}
diff --git a/examples/effects/lighting/lighting.cpp b/examples/effects/lighting/lighting.cpp
index a988ffbcb3..bd23a2d21a 100644
--- a/examples/effects/lighting/lighting.cpp
+++ b/examples/effects/lighting/lighting.cpp
@@ -134,3 +134,9 @@ void Lighting::animate()
m_scene.update();
}
+void Lighting::resizeEvent(QResizeEvent */*event*/)
+{
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ fitInView(sceneRect(), Qt::KeepAspectRatio);
+#endif
+}
diff --git a/examples/effects/lighting/lighting.desktop b/examples/effects/lighting/lighting.desktop
new file mode 100644
index 0000000000..806b3deca0
--- /dev/null
+++ b/examples/effects/lighting/lighting.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Lighting Effect
+Exec=/opt/usr/bin/lighting
+Icon=lighting
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/effects/lighting/lighting.h b/examples/effects/lighting/lighting.h
index 6a6bc56582..5099653b71 100644
--- a/examples/effects/lighting/lighting.h
+++ b/examples/effects/lighting/lighting.h
@@ -57,6 +57,9 @@ private slots:
private:
void setupScene();
+protected:
+ void resizeEvent(QResizeEvent *event);
+
private:
qreal angle;
QGraphicsScene m_scene;
diff --git a/examples/effects/lighting/lighting.pro b/examples/effects/lighting/lighting.pro
index 432d1b569a..b816673270 100644
--- a/examples/effects/lighting/lighting.pro
+++ b/examples/effects/lighting/lighting.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/effects/lighting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS lighting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/effects/lighting
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/effects/lighting/main.cpp b/examples/effects/lighting/main.cpp
index c75d84159f..fff3d73f2a 100644
--- a/examples/effects/lighting/main.cpp
+++ b/examples/effects/lighting/main.cpp
@@ -47,8 +47,13 @@ int main(int argc, char **argv)
Lighting lighting;
lighting.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Lighting and Shadows"));
+
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ lighting.showMaximized();
+#else
lighting.resize(640, 480);
lighting.show();
+#endif
return app.exec();
}
diff --git a/examples/examples.pro b/examples/examples.pro
index f233aba410..cf12dd6dc1 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -73,4 +73,3 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/gestures/imagegestures/imagegestures.desktop b/examples/gestures/imagegestures/imagegestures.desktop
new file mode 100644
index 0000000000..06068ff78d
--- /dev/null
+++ b/examples/gestures/imagegestures/imagegestures.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Image Gestures
+Exec=/opt/usr/bin/imagegestures
+Icon=imagegestures
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro
index 5365558c3a..e9d19ee0b2 100644
--- a/examples/gestures/imagegestures/imagegestures.pro
+++ b/examples/gestures/imagegestures/imagegestures.pro
@@ -19,3 +19,7 @@ symbian {
TARGET.UID3 = 0xA000D7D0
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/graphicsview/anchorlayout/anchorlayout.desktop b/examples/graphicsview/anchorlayout/anchorlayout.desktop
new file mode 100644
index 0000000000..6cf53c3f9b
--- /dev/null
+++ b/examples/graphicsview/anchorlayout/anchorlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Anchor Layout
+Exec=/opt/usr/bin/anchorlayout
+Icon=anchorlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/anchorlayout/anchorlayout.pro b/examples/graphicsview/anchorlayout/anchorlayout.pro
index fd085cc330..f56a4f9a9f 100644
--- a/examples/graphicsview/anchorlayout/anchorlayout.pro
+++ b/examples/graphicsview/anchorlayout/anchorlayout.pro
@@ -7,3 +7,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/anchorlayout
INSTALLS += target sources
TARGET = anchorlayout
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/anchorlayout/main.cpp b/examples/graphicsview/anchorlayout/main.cpp
index c31afd214d..dbe9f19880 100644
--- a/examples/graphicsview/anchorlayout/main.cpp
+++ b/examples/graphicsview/anchorlayout/main.cpp
@@ -122,7 +122,12 @@ int main(int argc, char **argv)
scene.addItem(w);
scene.setBackgroundBrush(Qt::darkGreen);
QGraphicsView view(&scene);
+
+#if defined(Q_WS_S60)
+ view.showMaximized();
+#else
view.show();
+#endif
return app.exec();
}
diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.desktop b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.desktop
new file mode 100644
index 0000000000..be1c3e4a84
--- /dev/null
+++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Basic Graphics Layouts
+Exec=/opt/usr/bin/basicgraphicslayouts
+Icon=basicgraphicslayouts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
index 9549174fa2..796d9de950 100644
--- a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
+++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
@@ -15,3 +15,5 @@ symbian {
TARGET.UID3 = 0xA000A645
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/basicgraphicslayouts/main.cpp b/examples/graphicsview/basicgraphicslayouts/main.cpp
index 57448a58d7..11da1838f3 100644
--- a/examples/graphicsview/basicgraphicslayouts/main.cpp
+++ b/examples/graphicsview/basicgraphicslayouts/main.cpp
@@ -51,8 +51,12 @@ int main(int argc, char **argv)
Window *window = new Window;
scene.addItem(window);
QGraphicsView view(&scene);
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ view.showMaximized();
+#else
view.resize(600, 600);
view.show();
+#endif
return app.exec();
}
diff --git a/examples/graphicsview/collidingmice/collidingmice.desktop b/examples/graphicsview/collidingmice/collidingmice.desktop
new file mode 100644
index 0000000000..f0064e7112
--- /dev/null
+++ b/examples/graphicsview/collidingmice/collidingmice.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Colliding Mice
+Exec=/opt/usr/bin/collidingmice
+Icon=collidingmice
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/collidingmice/collidingmice.pro b/examples/graphicsview/collidingmice/collidingmice.pro
index 207c645ee8..6205414c2e 100644
--- a/examples/graphicsview/collidingmice/collidingmice.pro
+++ b/examples/graphicsview/collidingmice/collidingmice.pro
@@ -17,3 +17,5 @@ symbian {
TARGET.UID3 = 0xA000A643
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/collidingmice/main.cpp b/examples/graphicsview/collidingmice/main.cpp
index 2970a0079f..43594029fa 100644
--- a/examples/graphicsview/collidingmice/main.cpp
+++ b/examples/graphicsview/collidingmice/main.cpp
@@ -79,8 +79,12 @@ int main(int argc, char **argv)
view.setDragMode(QGraphicsView::ScrollHandDrag);
//! [5] //! [6]
view.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Colliding Mice"));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ view.showMaximized();
+#else
view.resize(400, 300);
view.show();
+#endif
QTimer timer;
QObject::connect(&timer, SIGNAL(timeout()), &scene, SLOT(advance()));
diff --git a/examples/graphicsview/diagramscene/diagramscene.desktop b/examples/graphicsview/diagramscene/diagramscene.desktop
new file mode 100644
index 0000000000..54506ff979
--- /dev/null
+++ b/examples/graphicsview/diagramscene/diagramscene.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Diagram Scene
+Exec=/opt/usr/bin/diagramscene
+Icon=diagramscene
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/diagramscene/diagramscene.pro b/examples/graphicsview/diagramscene/diagramscene.pro
index 2021e24c1c..1782dacb6a 100644
--- a/examples/graphicsview/diagramscene/diagramscene.pro
+++ b/examples/graphicsview/diagramscene/diagramscene.pro
@@ -19,4 +19,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/diagramscene
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/diagramscene/mainwindow.cpp b/examples/graphicsview/diagramscene/mainwindow.cpp
index 87eb33e7ee..b0aee8708f 100644
--- a/examples/graphicsview/diagramscene/mainwindow.cpp
+++ b/examples/graphicsview/diagramscene/mainwindow.cpp
@@ -85,8 +85,8 @@ void MainWindow::backgroundButtonGroupClicked(QAbstractButton *button)
{
QList<QAbstractButton *> buttons = backgroundButtonGroup->buttons();
foreach (QAbstractButton *myButton, buttons) {
- if (myButton != button)
- button->setChecked(false);
+ if (myButton != button)
+ myButton->setChecked(false);
}
QString text = button->text();
if (text == tr("Blue Grid"))
diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.desktop b/examples/graphicsview/dragdroprobot/dragdroprobot.desktop
new file mode 100644
index 0000000000..c01e3a3425
--- /dev/null
+++ b/examples/graphicsview/dragdroprobot/dragdroprobot.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Drag and Drop Robot
+Exec=/opt/usr/bin/dragdroprobot
+Icon=dragdroprobot
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.pro b/examples/graphicsview/dragdroprobot/dragdroprobot.pro
index 3d100c0f0a..25b03a5875 100644
--- a/examples/graphicsview/dragdroprobot/dragdroprobot.pro
+++ b/examples/graphicsview/dragdroprobot/dragdroprobot.pro
@@ -18,3 +18,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/dragdroprobot
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/dragdroprobot/main.cpp b/examples/graphicsview/dragdroprobot/main.cpp
index 315d2b6917..c8b84ecb97 100644
--- a/examples/graphicsview/dragdroprobot/main.cpp
+++ b/examples/graphicsview/dragdroprobot/main.cpp
@@ -45,6 +45,22 @@
#include <math.h>
+class GraphicsView : public QGraphicsView
+{
+public:
+ GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene)
+ {
+ }
+
+protected:
+ virtual void resizeEvent(QResizeEvent *event)
+ {
+#if defined(Q_OS_SYMBIAN)
+ fitInView(sceneRect(), Qt::KeepAspectRatio);
+#endif
+ }
+};
+
//! [0]
int main(int argc, char **argv)
{
@@ -69,12 +85,16 @@ int main(int argc, char **argv)
scene.addItem(robot);
//! [1]
//! [2]
- QGraphicsView view(&scene);
+ GraphicsView view(&scene);
view.setRenderHint(QPainter::Antialiasing);
view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
view.setBackgroundBrush(QColor(230, 200, 167));
view.setWindowTitle("Drag and Drop Robot");
- view.show();
+#if defined(Q_OS_SYMBIAN)
+ view.showMaximized();
+#else
+ view.show();
+#endif
return app.exec();
}
diff --git a/examples/graphicsview/elasticnodes/edge.cpp b/examples/graphicsview/elasticnodes/edge.cpp
index 2b5cae5e1b..652ab737fc 100644
--- a/examples/graphicsview/elasticnodes/edge.cpp
+++ b/examples/graphicsview/elasticnodes/edge.cpp
@@ -144,6 +144,6 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
painter->setBrush(Qt::black);
painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
- painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
+ painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
}
//! [6]
diff --git a/examples/graphicsview/elasticnodes/elasticnodes.desktop b/examples/graphicsview/elasticnodes/elasticnodes.desktop
new file mode 100644
index 0000000000..64402d080f
--- /dev/null
+++ b/examples/graphicsview/elasticnodes/elasticnodes.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Elastic Nodes
+Exec=/opt/usr/bin/elasticnodes
+Icon=elasticnodes
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/elasticnodes/elasticnodes.pro b/examples/graphicsview/elasticnodes/elasticnodes.pro
index c086461696..69b5bb29d9 100644
--- a/examples/graphicsview/elasticnodes/elasticnodes.pro
+++ b/examples/graphicsview/elasticnodes/elasticnodes.pro
@@ -21,3 +21,6 @@ symbian {
TARGET.UID3 = 0xA000A642
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/elasticnodes/graphwidget.cpp b/examples/graphicsview/elasticnodes/graphwidget.cpp
index c875b6551d..f6bf05de31 100644
--- a/examples/graphicsview/elasticnodes/graphwidget.cpp
+++ b/examples/graphicsview/elasticnodes/graphwidget.cpp
@@ -132,17 +132,14 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
centerNode->moveBy(20, 0);
break;
case Qt::Key_Plus:
- scaleView(qreal(1.2));
+ zoomIn();
break;
case Qt::Key_Minus:
- scaleView(1 / qreal(1.2));
+ zoomOut();
break;
case Qt::Key_Space:
case Qt::Key_Enter:
- foreach (QGraphicsItem *item, scene()->items()) {
- if (qgraphicsitem_cast<Node *>(item))
- item->setPos(-150 + qrand() % 300, -150 + qrand() % 300);
- }
+ shuffle();
break;
default:
QGraphicsView::keyPressEvent(event);
@@ -206,6 +203,7 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect)
painter->setBrush(Qt::NoBrush);
painter->drawRect(sceneRect);
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
// Text
QRectF textRect(sceneRect.left() + 4, sceneRect.top() + 4,
sceneRect.width() - 4, sceneRect.height() - 4);
@@ -220,6 +218,7 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect)
painter->drawText(textRect.translated(2, 2), message);
painter->setPen(Qt::black);
painter->drawText(textRect, message);
+#endif
}
//! [6]
@@ -233,3 +232,21 @@ void GraphWidget::scaleView(qreal scaleFactor)
scale(scaleFactor, scaleFactor);
}
//! [7]
+
+void GraphWidget::shuffle()
+{
+ foreach (QGraphicsItem *item, scene()->items()) {
+ if (qgraphicsitem_cast<Node *>(item))
+ item->setPos(-150 + qrand() % 300, -150 + qrand() % 300);
+ }
+}
+
+void GraphWidget::zoomIn()
+{
+ scaleView(qreal(1.2));
+}
+
+void GraphWidget::zoomOut()
+{
+ scaleView(1 / qreal(1.2));
+}
diff --git a/examples/graphicsview/elasticnodes/graphwidget.h b/examples/graphicsview/elasticnodes/graphwidget.h
index 764bb3f0b9..524ef67b8a 100644
--- a/examples/graphicsview/elasticnodes/graphwidget.h
+++ b/examples/graphicsview/elasticnodes/graphwidget.h
@@ -55,6 +55,11 @@ public:
void itemMoved();
+public slots:
+ void shuffle();
+ void zoomIn();
+ void zoomOut();
+
protected:
void keyPressEvent(QKeyEvent *event);
void timerEvent(QTimerEvent *event);
diff --git a/examples/graphicsview/elasticnodes/main.cpp b/examples/graphicsview/elasticnodes/main.cpp
index ab7e7cf7c7..d653da5355 100644
--- a/examples/graphicsview/elasticnodes/main.cpp
+++ b/examples/graphicsview/elasticnodes/main.cpp
@@ -47,7 +47,18 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
- GraphWidget widget;
- widget.show();
+ GraphWidget *widget = new GraphWidget;
+
+ QMainWindow mainWindow;
+ mainWindow.setCentralWidget(widget);
+
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ mainWindow.menuBar()->addAction("Shuffle", widget, SLOT(shuffle()));
+ mainWindow.menuBar()->addAction("Zoom In", widget, SLOT(zoomIn()));
+ mainWindow.menuBar()->addAction("Zoom Out", widget, SLOT(zoomOut()));
+ mainWindow.showMaximized();
+#else
+ mainWindow.show();
+#endif
return app.exec();
}
diff --git a/examples/graphicsview/elasticnodes/node.cpp b/examples/graphicsview/elasticnodes/node.cpp
index 8d1daddc12..b345f83640 100644
--- a/examples/graphicsview/elasticnodes/node.cpp
+++ b/examples/graphicsview/elasticnodes/node.cpp
@@ -141,9 +141,16 @@ bool Node::advance()
//! [8]
QRectF Node::boundingRect() const
{
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ // Add some extra space around the circle for easier touching with finger
+ qreal adjust = 30;
+ return QRectF( -10 - adjust, -10 - adjust,
+ 20 + adjust * 2, 20 + adjust * 2);
+#else
qreal adjust = 2;
- return QRectF(-10 - adjust, -10 - adjust,
+ return QRectF( -10 - adjust, -10 - adjust,
23 + adjust, 23 + adjust);
+#endif
}
//! [8]
@@ -151,7 +158,12 @@ QRectF Node::boundingRect() const
QPainterPath Node::shape() const
{
QPainterPath path;
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ // Add some extra space around the circle for easier touching with finger
+ path.addEllipse( -40, -40, 80, 80);
+#else
path.addEllipse(-10, -10, 20, 20);
+#endif
return path;
}
//! [9]
@@ -174,6 +186,7 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
gradient.setColorAt(1, Qt::darkYellow);
}
painter->setBrush(gradient);
+
painter->setPen(QPen(Qt::black, 0));
painter->drawEllipse(-10, -10, 20, 20);
}
diff --git a/examples/graphicsview/flowlayout/flowlayout.desktop b/examples/graphicsview/flowlayout/flowlayout.desktop
new file mode 100644
index 0000000000..54ea3b0290
--- /dev/null
+++ b/examples/graphicsview/flowlayout/flowlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Flow Layout
+Exec=/opt/usr/bin/flowlayout
+Icon=flowlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/flowlayout/flowlayout.pro b/examples/graphicsview/flowlayout/flowlayout.pro
index ce3536774b..8a97d2dc79 100644
--- a/examples/graphicsview/flowlayout/flowlayout.pro
+++ b/examples/graphicsview/flowlayout/flowlayout.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
@@ -8,3 +7,7 @@ QMAKE_PROJECT_NAME = flowlayout_graphicsview
# Input
HEADERS += flowlayout.h window.h
SOURCES += flowlayout.cpp main.cpp window.cpp
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/flowlayout/main.cpp b/examples/graphicsview/flowlayout/main.cpp
index cee08d76ac..cc5eeb6175 100644
--- a/examples/graphicsview/flowlayout/main.cpp
+++ b/examples/graphicsview/flowlayout/main.cpp
@@ -49,7 +49,13 @@ int main(int argc, char **argv)
QGraphicsView *view = new QGraphicsView(&scene);
Window *w = new Window;
scene.addItem(w);
+
+#if defined(Q_OS_SYMBIAN)
+ view->showMaximized();
+#else
view->resize(400, 300);
view->show();
+#endif
+
return app.exec();
}
diff --git a/examples/graphicsview/graphicsview.pro b/examples/graphicsview/graphicsview.pro
index 8f65d51e5e..2aa68ece0f 100644
--- a/examples/graphicsview/graphicsview.pro
+++ b/examples/graphicsview/graphicsview.pro
@@ -22,4 +22,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS graphicsview.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp
index 8f4a681743..d7d2f56305 100644
--- a/examples/graphicsview/padnavigator/main.cpp
+++ b/examples/graphicsview/padnavigator/main.cpp
@@ -49,8 +49,11 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(padnavigator);
PadNavigator navigator(QSize(3, 3));
+#if defined(Q_OS_SYMBIAN)
+ navigator.showMaximized();
+#else
navigator.show();
-
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/graphicsview/padnavigator/padnavigator.desktop b/examples/graphicsview/padnavigator/padnavigator.desktop
new file mode 100644
index 0000000000..f0490730c6
--- /dev/null
+++ b/examples/graphicsview/padnavigator/padnavigator.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Pad Navigator
+Exec=/opt/usr/bin/padnavigator
+Icon=padnavigator
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro
index 93ea293d8b..cf142bc5e7 100644
--- a/examples/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/graphicsview/padnavigator/padnavigator.pro
@@ -30,3 +30,6 @@ symbian {
TARGET.UID3 = 0xA000A644
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/portedasteroids/animateditem.cpp b/examples/graphicsview/portedasteroids/animateditem.cpp
index 489ef3470c..c36c1415e3 100644
--- a/examples/graphicsview/portedasteroids/animateditem.cpp
+++ b/examples/graphicsview/portedasteroids/animateditem.cpp
@@ -40,12 +40,13 @@
#include "animateditem.h"
-#include <QtGui/qbitmap.h>
-#include <QtGui/qpainter.h>
+#include <QtGui/QBitmap>
+#include <QtGui/QPainter>
+#include <QGraphicsScene>
AnimatedPixmapItem::AnimatedPixmapItem(const QList<QPixmap> &animation,
QGraphicsScene *scene)
- : QGraphicsItem(0, scene), currentFrame(0), vx(0), vy(0)
+ : QGraphicsItem(0), currentFrame(0), vx(0), vy(0)
{
for (int i = 0; i < animation.size(); ++i) {
QPixmap pixmap = animation.at(i);
@@ -55,6 +56,8 @@ AnimatedPixmapItem::AnimatedPixmapItem(const QList<QPixmap> &animation,
frame.boundingRect = pixmap.rect();
frames << frame;
}
+
+ scene->addItem(this);
}
void AnimatedPixmapItem::setFrame(int frame)
@@ -63,6 +66,8 @@ void AnimatedPixmapItem::setFrame(int frame)
prepareGeometryChange();
currentFrame = frame % frames.size();
}
+
+ //scene->addItem(this);
}
void AnimatedPixmapItem::advance(int phase)
diff --git a/examples/graphicsview/portedasteroids/animateditem.h b/examples/graphicsview/portedasteroids/animateditem.h
index 712d70dd46..23117b423f 100644
--- a/examples/graphicsview/portedasteroids/animateditem.h
+++ b/examples/graphicsview/portedasteroids/animateditem.h
@@ -49,18 +49,12 @@ public:
AnimatedPixmapItem(const QList<QPixmap> &animation, QGraphicsScene *scene = 0);
void setFrame(int frame);
- inline int frame() const
- { return currentFrame; }
- inline int frameCount() const
- { return frames.size(); }
- inline QPixmap image(int frame) const
- { return frames.isEmpty() ? QPixmap() : frames.at(frame % frames.size()).pixmap; }
- inline void setVelocity(qreal xvel, qreal yvel)
- { vx = xvel; vy = yvel; }
- inline qreal xVelocity() const
- { return vx; }
- inline qreal yVelocity() const
- { return vy; }
+ inline int frame() const { return currentFrame; }
+ inline int frameCount() const { return frames.size(); }
+ inline QPixmap image(int frame) const { return frames.isEmpty() ? QPixmap() : frames.at(frame % frames.size()).pixmap; }
+ inline void setVelocity(qreal xvel, qreal yvel) { vx = xvel; vy = yvel; }
+ inline qreal xVelocity() const { return vx; }
+ inline qreal yVelocity() const { return vy; }
QRectF boundingRect() const;
QPainterPath shape() const;
diff --git a/examples/graphicsview/portedasteroids/ledmeter.cpp b/examples/graphicsview/portedasteroids/ledmeter.cpp
index 9653fc6de8..aefe2004b4 100644
--- a/examples/graphicsview/portedasteroids/ledmeter.cpp
+++ b/examples/graphicsview/portedasteroids/ledmeter.cpp
@@ -44,15 +44,14 @@
* Part of the KDE project
*/
-#include <qpainter.h>
-//Added by qt3to4:
+#include <QPainter>
#include <QResizeEvent>
-#include <Q3Frame>
+#include <QFrame>
+#include <QColorGroup>
#include "ledmeter.h"
-KALedMeter::KALedMeter( QWidget *parent ) : Q3Frame( parent )
+KALedMeter::KALedMeter( QWidget *parent ) : QFrame( parent )
{
- mCRanges.setAutoDelete( TRUE );
mRange = 100;
mCount = 20;
mCurrentCount = 0;
@@ -60,6 +59,13 @@ KALedMeter::KALedMeter( QWidget *parent ) : Q3Frame( parent )
setMinimumWidth( mCount * 2 + frameWidth() );
}
+KALedMeter::~KALedMeter()
+{
+ qDeleteAll(mCRanges);
+ mCRanges.clear();
+}
+
+
void KALedMeter::setRange( int r )
{
mRange = r;
@@ -106,27 +112,30 @@ void KALedMeter::addColorRange( int pc, const QColor &c )
void KALedMeter::resizeEvent( QResizeEvent *e )
{
- Q3Frame::resizeEvent( e );
+ QFrame::resizeEvent( e );
int w = ( width() - frameWidth() - 2 ) / mCount * mCount;
w += frameWidth() + 2;
setFrameRect( QRect( 0, 0, w, height() ) );
}
-void KALedMeter::drawContents( QPainter *p )
+void KALedMeter::paintEvent(QPaintEvent *event)
{
+ QFrame::paintEvent(event);
+
QRect b = contentsRect();
+ QPainter p(this);
unsigned cidx = 0;
int ncol = mCount;
- QColor col = colorGroup().foreground();
+ QColor col = palette().foreground().color();
if ( !mCRanges.isEmpty() )
{
col = mCRanges.at( cidx )->mColor;
ncol = mCRanges.at( cidx )->mValue;
}
- p->setBrush( col );
- p->setPen( col );
+ p.setBrush( col );
+ p.setPen( col );
int lw = b.width() / mCount;
int lx = b.left() + 1;
@@ -138,21 +147,22 @@ void KALedMeter::drawContents( QPainter *p )
{
col = mCRanges.at( cidx )->mColor;
ncol = mCRanges.at( cidx )->mValue;
- p->setBrush( col );
- p->setPen( col );
+ p.setBrush( col );
+ p.setPen( col );
}
}
- p->drawRect( lx, b.top() + 1, lw - 1, b.height() - 2 );
+ p.drawRect( lx, b.top() + 1, lw - 1, b.height() - 2 );
}
}
void KALedMeter::calcColorRanges()
{
int prev = 0;
- ColorRange *cr;
- for ( cr = mCRanges.first(); cr; cr = mCRanges.next() )
+
+ for(QList<ColorRange*>::iterator it = mCRanges.begin(); it != mCRanges.end(); it++)
{
+ ColorRange *cr = *it;
cr->mValue = prev + cr->mPc * mCount / 100;
prev = cr->mValue;
}
diff --git a/examples/graphicsview/portedasteroids/ledmeter.h b/examples/graphicsview/portedasteroids/ledmeter.h
index 2d4ae23c98..0e3851f6de 100644
--- a/examples/graphicsview/portedasteroids/ledmeter.h
+++ b/examples/graphicsview/portedasteroids/ledmeter.h
@@ -47,17 +47,17 @@
#ifndef __LEDMETER_H__
#define __LEDMETER_H__
-#include <q3frame.h>
-#include <q3ptrlist.h>
-//Added by qt3to4:
+#include <QFrame>
+#include <QList>
#include <QResizeEvent>
-class KALedMeter : public Q3Frame
+class KALedMeter : public QFrame
{
Q_OBJECT
public:
KALedMeter( QWidget *parent );
+ ~KALedMeter();
int range() const { return mRange; }
void setRange( int r );
@@ -74,7 +74,7 @@ public slots:
protected:
virtual void resizeEvent( QResizeEvent * );
- virtual void drawContents( QPainter * );
+ virtual void paintEvent(QPaintEvent *event);
void calcColorRanges();
protected:
@@ -89,7 +89,7 @@ protected:
int mCount;
int mCurrentCount;
int mValue;
- Q3PtrList<ColorRange> mCRanges;
+ QList<ColorRange*> mCRanges;
};
#endif
diff --git a/examples/graphicsview/portedasteroids/main.cpp b/examples/graphicsview/portedasteroids/main.cpp
index 4ed4e9f69a..e6c762316b 100644
--- a/examples/graphicsview/portedasteroids/main.cpp
+++ b/examples/graphicsview/portedasteroids/main.cpp
@@ -52,7 +52,11 @@ int main(int argc, char **argv)
KAstTopLevel topLevel;
topLevel.setWindowTitle("Ported Asteroids Game");
+#if defined(Q_OS_SYMBIAN)
+ topLevel.showFullScreen();
+#else
topLevel.show();
+#endif
app.setQuitOnLastWindowClosed(true);
return app.exec();
diff --git a/examples/graphicsview/portedasteroids/portedasteroids.desktop b/examples/graphicsview/portedasteroids/portedasteroids.desktop
new file mode 100644
index 0000000000..abd061699b
--- /dev/null
+++ b/examples/graphicsview/portedasteroids/portedasteroids.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Ported Asteroids
+Exec=/opt/usr/bin/portedasteroids
+Icon=portedasteroids
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/portedasteroids/portedasteroids.pro b/examples/graphicsview/portedasteroids/portedasteroids.pro
index b28ab5445a..98ec4fe8a1 100644
--- a/examples/graphicsview/portedasteroids/portedasteroids.pro
+++ b/examples/graphicsview/portedasteroids/portedasteroids.pro
@@ -2,13 +2,8 @@ TEMPLATE = app
INCLUDEPATH += .
# Input
-HEADERS += ledmeter.h sprites.h toplevel.h view.h
-SOURCES += ledmeter.cpp main.cpp toplevel.cpp view.cpp
-#The following line was inserted by qt3to4
-QT += qt3support
-
-HEADERS += animateditem.h
-SOURCES += animateditem.cpp
+HEADERS += ledmeter.h sprites.h toplevel.h view.h animateditem.h
+SOURCES += ledmeter.cpp main.cpp toplevel.cpp view.cpp animateditem.cpp
RESOURCES += portedasteroids.qrc
@@ -16,6 +11,10 @@ RESOURCES += portedasteroids.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedasteroids
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS portedasteroids.pro bg.png sounds sprites
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedasteroids
+
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/portedasteroids/sprites.h b/examples/graphicsview/portedasteroids/sprites.h
index e5f1dbb929..7275cba5c6 100644
--- a/examples/graphicsview/portedasteroids/sprites.h
+++ b/examples/graphicsview/portedasteroids/sprites.h
@@ -144,7 +144,7 @@ public:
{
if (cskip-- <= 0) {
setFrame( (frame()+step+frameCount())%frameCount() );
- cskip = QABS(skip);
+ cskip = qAbs(skip);
}
}
diff --git a/examples/graphicsview/portedasteroids/toplevel.cpp b/examples/graphicsview/portedasteroids/toplevel.cpp
index 367f8c6045..6aa63c388b 100644
--- a/examples/graphicsview/portedasteroids/toplevel.cpp
+++ b/examples/graphicsview/portedasteroids/toplevel.cpp
@@ -44,21 +44,20 @@
* Part of the KDE project
*/
// --- toplevel.cpp ---
-#include <q3accel.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlcdnumber.h>
-#include <qpushbutton.h>
-
-#include <qapplication.h>
-//Added by qt3to4:
-#include <Q3HBoxLayout>
+#include <QAction>
+#include <QLabel>
+#include <QLayout>
+#include <QLCDNumber>
+#include <QPushButton>
+
+#include <QApplication>
+#include <QHBoxLayout>
#include <QShowEvent>
-#include <Q3Frame>
+#include <QFrame>
#include <QPixmap>
#include <QHideEvent>
#include <QKeyEvent>
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
#include "toplevel.h"
#include "ledmeter.h"
@@ -110,18 +109,28 @@ const char *soundDefaults[] =
};
-KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
- : Q3MainWindow( parent, name, 0 )
+KAstTopLevel::KAstTopLevel( QWidget *parent)
+ : QMainWindow(parent)
{
QWidget *border = new QWidget( this );
- border->setBackgroundColor( Qt::black );
+
+ QPalette palette;
+ palette.setColor(border->backgroundRole(), Qt::black);
+ border->setPalette(palette);
+
setCentralWidget( border );
- Q3VBoxLayout *borderLayout = new Q3VBoxLayout( border );
+ QVBoxLayout *borderLayout = new QVBoxLayout( border );
borderLayout->addStretch( 1 );
QWidget *mainWin = new QWidget( border );
+#if defined(Q_WS_MAEMO_5)
+ mainWin->setFixedSize(800, 430);
+#elif defined(Q_OS_SYMBIAN)
+ mainWin->setFixedSize(640, 340);
+#else
mainWin->setFixedSize(640, 480);
+#endif
borderLayout->addWidget( mainWin, 0, Qt::AlignHCenter );
borderLayout->addStretch( 1 );
@@ -133,15 +142,18 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
connect( view, SIGNAL(rocksRemoved()), SLOT(slotRocksRemoved()) );
connect( view, SIGNAL(updateVitals()), SLOT(slotUpdateVitals()) );
- Q3VBoxLayout *vb = new Q3VBoxLayout( mainWin );
- Q3HBoxLayout *hb = new Q3HBoxLayout;
- Q3HBoxLayout *hbd = new Q3HBoxLayout;
+ QVBoxLayout *vb = new QVBoxLayout( mainWin );
+ QHBoxLayout *hb = new QHBoxLayout;
+ QHBoxLayout *hbd = new QHBoxLayout;
vb->addLayout( hb );
+#if defined(Q_OS_SYMBIAN)
+ QFont labelFont( "helvetica", 8 );
+#else
QFont labelFont( "helvetica", 24 );
- QColorGroup grp( Qt::darkGreen, Qt::black, QColor( 128, 128, 128 ),
- QColor( 64, 64, 64 ), Qt::black, Qt::darkGreen, Qt::black );
- QPalette pal( grp, grp, grp );
+#endif
+
+ QPalette pal(Qt::darkGreen, Qt::black, QColor( 128, 128, 128 ), QColor( 64, 64, 64 ), Qt::black, Qt::darkGreen, Qt::black);
mainWin->setPalette( pal );
@@ -155,7 +167,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hb->addWidget( label );
scoreLCD = new QLCDNumber( 6, mainWin );
- scoreLCD->setFrameStyle( Q3Frame::NoFrame );
+ scoreLCD->setFrameStyle( QFrame::NoFrame );
scoreLCD->setSegmentStyle( QLCDNumber::Flat );
scoreLCD->setFixedWidth( 150 );
scoreLCD->setPalette( pal );
@@ -169,7 +181,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hb->addWidget( label );
levelLCD = new QLCDNumber( 2, mainWin );
- levelLCD->setFrameStyle( Q3Frame::NoFrame );
+ levelLCD->setFrameStyle( QFrame::NoFrame );
levelLCD->setSegmentStyle( QLCDNumber::Flat );
levelLCD->setFixedWidth( 70 );
levelLCD->setPalette( pal );
@@ -183,7 +195,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hb->addWidget( label );
shipsLCD = new QLCDNumber( 1, mainWin );
- shipsLCD->setFrameStyle( Q3Frame::NoFrame );
+ shipsLCD->setFrameStyle( QFrame::NoFrame );
shipsLCD->setSegmentStyle( QLCDNumber::Flat );
shipsLCD->setFixedWidth( 40 );
shipsLCD->setPalette( pal );
@@ -196,7 +208,11 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
// -- bottom layout:
vb->addLayout( hbd );
+#if defined(Q_OS_SYMBIAN)
+ QFont smallFont( "helvetica", 6 );
+#else
QFont smallFont( "helvetica", 14 );
+#endif
hbd->addSpacing( 10 );
QString sprites_prefix = ":/trolltech/examples/graphicsview/portedasteroids/sprites/";
@@ -224,7 +240,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hbd->addWidget( label );
brakesLCD = new QLCDNumber( 1, mainWin );
- brakesLCD->setFrameStyle( Q3Frame::NoFrame );
+ brakesLCD->setFrameStyle( QFrame::NoFrame );
brakesLCD->setSegmentStyle( QLCDNumber::Flat );
brakesLCD->setPalette( pal );
brakesLCD->setFixedHeight( 20 );
@@ -240,7 +256,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hbd->addWidget( label );
shieldLCD = new QLCDNumber( 1, mainWin );
- shieldLCD->setFrameStyle( Q3Frame::NoFrame );
+ shieldLCD->setFrameStyle( QFrame::NoFrame );
shieldLCD->setSegmentStyle( QLCDNumber::Flat );
shieldLCD->setPalette( pal );
shieldLCD->setFixedHeight( 20 );
@@ -256,7 +272,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hbd->addWidget( label );
shootLCD = new QLCDNumber( 1, mainWin );
- shootLCD->setFrameStyle( Q3Frame::NoFrame );
+ shootLCD->setFrameStyle( QFrame::NoFrame );
shootLCD->setSegmentStyle( QLCDNumber::Flat );
shootLCD->setPalette( pal );
shootLCD->setFixedHeight( 20 );
@@ -271,7 +287,7 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hbd->addWidget( label );
powerMeter = new KALedMeter( mainWin );
- powerMeter->setFrameStyle( Q3Frame::Box | Q3Frame::Plain );
+ powerMeter->setFrameStyle( QFrame::Box | QFrame::Plain );
powerMeter->setRange( MAX_POWER_LEVEL );
powerMeter->addColorRange( 10, Qt::darkRed );
powerMeter->addColorRange( 20, QColor(160, 96, 0) );
@@ -295,6 +311,15 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
actions.insert( Qt::Key_L, Launch );
actions.insert( Qt::Key_N, NewGame );
+#if defined(Q_OS_SYMBIAN)
+ actions.insert( 122, Teleport );
+ actions.insert( 120, Brake );
+ actions.insert( 115, Shield );
+ actions.insert( 112, Pause );
+ actions.insert( 108, Launch );
+ actions.insert( 110, NewGame );
+#endif
+
view->showText( tr( "Press N to start playing" ), Qt::yellow );
}
@@ -431,14 +456,14 @@ void KAstTopLevel::keyReleaseEvent( QKeyEvent *event )
void KAstTopLevel::showEvent( QShowEvent *e )
{
- Q3MainWindow::showEvent( e );
+ QMainWindow::showEvent( e );
view->pause( FALSE );
view->setFocus();
}
void KAstTopLevel::hideEvent( QHideEvent *e )
{
- Q3MainWindow::hideEvent( e );
+ QMainWindow::hideEvent( e );
view->pause( TRUE );
}
diff --git a/examples/graphicsview/portedasteroids/toplevel.h b/examples/graphicsview/portedasteroids/toplevel.h
index 767580e4d2..36b3afc00d 100644
--- a/examples/graphicsview/portedasteroids/toplevel.h
+++ b/examples/graphicsview/portedasteroids/toplevel.h
@@ -47,10 +47,9 @@
#ifndef __KAST_TOPLEVEL_H__
#define __KAST_TOPLEVEL_H__
-#include <q3mainwindow.h>
-#include <q3dict.h>
-#include <qmap.h>
-//Added by qt3to4:
+#include <QMainWindow>
+#include <QMultiHash>
+#include <QMap>
#include <QShowEvent>
#include <QHideEvent>
#include <QKeyEvent>
@@ -63,11 +62,11 @@ QT_BEGIN_NAMESPACE
class QLCDNumber;
QT_END_NAMESPACE
-class KAstTopLevel : public Q3MainWindow
+class KAstTopLevel : public QMainWindow
{
Q_OBJECT
public:
- KAstTopLevel( QWidget *parent=0, const char *name=0 );
+ KAstTopLevel( QWidget *parent = 0);
virtual ~KAstTopLevel();
private:
@@ -104,7 +103,7 @@ private:
KALedMeter *powerMeter;
bool sound;
- Q3Dict<QString> soundDict;
+ //Q3Dict<QString> soundDict;
// waiting for user to press Enter to launch a ship
bool waitShip;
@@ -118,7 +117,7 @@ private:
enum Action { Launch, Thrust, RotateLeft, RotateRight, Shoot, Teleport,
Brake, Shield, Pause, NewGame };
- QMap<int,Action> actions;
+ QMap<int, Action> actions;
};
#endif
diff --git a/examples/graphicsview/portedasteroids/view.cpp b/examples/graphicsview/portedasteroids/view.cpp
index 9429111340..e4f46c89ab 100644
--- a/examples/graphicsview/portedasteroids/view.cpp
+++ b/examples/graphicsview/portedasteroids/view.cpp
@@ -48,16 +48,16 @@
#include <math.h>
#include <qapplication.h>
#include <qnamespace.h>
-#include <q3accel.h>
-#include <qmessagebox.h>
-#include <q3scrollview.h>
-#include <qdir.h>
+#include <QAction>
+#include <QMessageBox>
+#include <QScrollArea>
+#include <QDir>
#include <QGraphicsItem>
-//Added by qt3to4:
#include <QTimerEvent>
#include <QPixmap>
#include <QResizeEvent>
#include <QShowEvent>
+#include <QtDebug>
#include "view.h"
@@ -110,10 +110,10 @@ kas_animations [] =
{ 0, 0, 0 }
};
-KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name )
- : QWidget( parent, name ),
+KAsteroidsView::KAsteroidsView( QWidget *parent)
+ : QWidget( parent),
field(0, 0, 640, 440),
- view(&field,this)
+ view(&field, this)
{
view.setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
view.setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
@@ -123,11 +123,6 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name )
| QGraphicsView::DontSavePainterState
| QGraphicsView::DontAdjustForAntialiasing);
view.viewport()->setFocusProxy( this );
- rocks.setAutoDelete( TRUE );
- missiles.setAutoDelete( TRUE );
- bits.setAutoDelete( TRUE );
- powerups.setAutoDelete( TRUE );
- exhaust.setAutoDelete( TRUE );
QPixmap pm( IMG_BACKGROUND );
field.setBackgroundBrush( pm );
@@ -164,6 +159,11 @@ KAsteroidsView::KAsteroidsView( QWidget *parent, const char *name )
KAsteroidsView::~KAsteroidsView()
{
+ qDeleteAll(rocks); rocks.clear();
+ qDeleteAll(missiles); missiles.clear();
+ qDeleteAll(bits); bits.clear();
+ qDeleteAll(powerups); powerups.clear();
+ qDeleteAll(exhaust); exhaust.clear();
}
// - - -
@@ -172,11 +172,11 @@ void KAsteroidsView::reset()
{
if ( !initialized )
return;
- rocks.clear();
- missiles.clear();
- bits.clear();
- powerups.clear();
- exhaust.clear();
+ qDeleteAll(rocks); rocks.clear();
+ qDeleteAll(missiles); missiles.clear();
+ qDeleteAll(bits); bits.clear();
+ qDeleteAll(powerups); powerups.clear();
+ qDeleteAll(exhaust); exhaust.clear();
shotsFired = 0;
shotsHit = 0;
@@ -217,6 +217,11 @@ void KAsteroidsView::newGame()
void KAsteroidsView::endGame()
{
+ qDeleteAll(rocks); rocks.clear();
+ qDeleteAll(missiles); missiles.clear();
+ qDeleteAll(bits); bits.clear();
+ qDeleteAll(powerups); powerups.clear();
+ qDeleteAll(exhaust); exhaust.clear();
}
void KAsteroidsView::pause( bool p )
@@ -266,7 +271,7 @@ void KAsteroidsView::newShip()
ship->show();
shield->show();
mShieldCount = 1; // just in case the ship appears on a rock.
- shieldTimer->start( 1000, TRUE );
+ shieldTimer->start(1000);
}
void KAsteroidsView::setShield( bool s )
@@ -410,11 +415,9 @@ void KAsteroidsView::timerEvent( QTimerEvent * )
{
field.advance();
- AnimatedPixmapItem *rock;
-
// move rocks forward
- for ( rock = rocks.first(); rock; rock = rocks.next() ) {
- ((KRock *)rock)->nextFrame();
+ foreach(AnimatedPixmapItem *rock, rocks) {
+ ((KRock *)rock)->nextFrame();
wrapSprite( rock );
}
@@ -424,21 +427,24 @@ void KAsteroidsView::timerEvent( QTimerEvent * )
processMissiles();
// these are generated when a ship explodes
- for ( KBit *bit = bits.first(); bit; bit = bits.next() )
+ for(QList<KBit*>::iterator it = bits.begin(); it != bits.end(); it++)
{
- if ( bit->expired() )
+ KBit *bit = *it;
+ if( bit->expired() )
{
- bits.removeRef( bit );
+ delete bit;
+ it = bits.erase(it);
+ break;
}
else
{
- bit->growOlder();
- bit->setFrame( ( bit->frame()+1 ) % bit->frameCount() );
+ bit->growOlder();
+ bit->setFrame( ( bit->frame()+1 ) % bit->frameCount() );
}
}
- for ( KExhaust *e = exhaust.first(); e; e = exhaust.next() )
- exhaust.removeRef( e );
+ qDeleteAll(exhaust);
+ exhaust.clear();
// move / rotate ship.
// check for collision with a rock.
@@ -570,7 +576,16 @@ void KAsteroidsView::rockHit( AnimatedPixmapItem *hit )
}
else if ( hit->type() == ID_ROCK_SMALL )
emit rockHit( 2 );
- rocks.removeRef( hit );
+
+ for(QList<AnimatedPixmapItem*>::iterator it = rocks.begin(); it != rocks.end(); it++)
+ {
+ if((*it) == hit) {
+ delete *it;
+ it = rocks.erase(it);
+ break;
+ }
+ }
+
if ( rocks.count() == 0 )
emit rocksRemoved();
}
@@ -605,38 +620,43 @@ void KAsteroidsView::addExhaust( double x, double y, double dx,
void KAsteroidsView::processMissiles()
{
- KMissile *missile;
-
// if a missile has hit a rock, remove missile and break rock into smaller
// rocks or remove completely.
- Q3PtrListIterator<KMissile> it(missiles);
-
- for ( ; it.current(); ++it )
+ QList<KMissile*>::iterator itMissile = missiles.begin();
+ while(itMissile != missiles.end())
{
- missile = it.current();
- missile->growOlder();
+ (*itMissile)->growOlder();
- if ( missile->expired() )
+ if ( (*itMissile)->expired() )
{
- missiles.removeRef( missile );
- continue;
+ delete (*itMissile);
+ itMissile = missiles.erase(itMissile);
+ continue;
}
- wrapSprite( missile );
+ wrapSprite(*itMissile);
- QList<QGraphicsItem *> hits = missile->collidingItems(Qt::IntersectsItemBoundingRect);
- QList<QGraphicsItem *>::Iterator hit;
- for ( hit = hits.begin(); hit != hits.end(); ++hit )
+ bool missileErased = false;
+ QList<QGraphicsItem*> hits = (*itMissile)->collidingItems(Qt::IntersectsItemBoundingRect);
+ QList<QGraphicsItem*>::iterator itHit = hits.begin();
+
+ while (itHit != hits.end())
{
- if ( (*hit)->type() >= ID_ROCK_LARGE &&
- (*hit)->type() <= ID_ROCK_SMALL && (*hit)->collidesWithItem(missile) )
+ if ( (*itHit)->type() >= ID_ROCK_LARGE &&
+ (*itHit)->type() <= ID_ROCK_SMALL && (*itHit)->collidesWithItem(*itMissile) )
{
shotsHit++;
- rockHit( static_cast<AnimatedPixmapItem *>(*hit) );
- missiles.removeRef( missile );
+ rockHit( static_cast<AnimatedPixmapItem *>(*itHit) );
+ delete *itMissile;
+ itMissile = missiles.erase(itMissile);
+ missileErased = true;
break;
}
+ itHit++;
}
+
+ if(!missileErased)
+ itMissile++;
}
}
@@ -712,7 +732,7 @@ void KAsteroidsView::processShip()
bit->setVelocity( 1-randDouble()*2,
1-randDouble()*2 );
bit->setDeath( 60 + randInt(60) );
- bits.append( bit );
+ bits.push_back( bit );
}
ship->hide();
shield->hide();
@@ -820,15 +840,15 @@ void KAsteroidsView::processShip()
if ( shootShip )
{
- if ( !shootDelay && (int)missiles.count() < mShootCount + 2 )
+ if ( !shootDelay && (int)missiles.size() < mShootCount + 2 )
{
- KMissile *missile = new KMissile( animation[ID_MISSILE], &field );
+ KMissile *missile = new KMissile( animation[ID_MISSILE], &field );
missile->setPos( 21+ship->x()+cosangle*21,
21+ship->y()+sinangle*21 );
missile->setFrame( 0 );
missile->setVelocity( shipDx + cosangle*MISSILE_SPEED,
shipDy + sinangle*MISSILE_SPEED );
- missiles.append( missile );
+ missiles.push_back( missile );
shotsFired++;
reducePower( 1 );
@@ -857,75 +877,83 @@ void KAsteroidsView::processShip()
void KAsteroidsView::processPowerups()
{
- if ( !powerups.isEmpty() )
- {
- // if player gets the powerup remove it from the screen, if option
- // "Can destroy powerups" is enabled and a missile hits the powerup
- // destroy it
-
- KPowerup *pup;
- Q3PtrListIterator<KPowerup> it( powerups );
-
- for( ; it.current(); ++it )
- {
- pup = it.current();
- pup->growOlder();
-
- if( pup->expired() )
- {
- powerups.removeRef( pup );
- continue;
- }
-
- wrapSprite( pup );
-
- QList<QGraphicsItem *> hits = pup->collidingItems();
- QList<QGraphicsItem *>::Iterator it;
- for ( it = hits.begin(); it != hits.end(); ++it )
- {
- if ( (*it) == ship )
- {
- switch( pup->type() )
- {
- case ID_ENERGY_POWERUP:
- shipPower += 150;
- if ( shipPower > MAX_POWER_LEVEL )
- shipPower = MAX_POWER_LEVEL;
- break;
- case ID_TELEPORT_POWERUP:
- mTeleportCount++;
- break;
- case ID_BRAKE_POWERUP:
- if ( mBrakeCount < MAX_BRAKES )
- mBrakeCount++;
- break;
- case ID_SHIELD_POWERUP:
- if ( mShieldCount < MAX_SHIELDS )
- mShieldCount++;
- break;
- case ID_SHOOT_POWERUP:
- if ( mShootCount < MAX_FIREPOWER )
- mShootCount++;
- break;
- }
+ // if player gets the powerup remove it from the screen, if option
+ // "Can destroy powerups" is enabled and a missile hits the powerup
+ // destroy it
+ QList<KPowerup*>::iterator itPup = powerups.begin();
- powerups.removeRef( pup );
- vitalsChanged = TRUE;
- }
- else if ( (*it) == shield )
- {
- powerups.removeRef( pup );
- }
- else if ( (*it)->type() == ID_MISSILE )
- {
- if ( can_destroy_powerups )
- {
- powerups.removeRef( pup );
- }
- }
- }
- }
- } // -- if( powerups.isEmpty() )
+ while(itPup != powerups.end())
+ {
+ (*itPup)->growOlder();
+
+ if((*itPup)->expired())
+ {
+ delete *itPup;
+ itPup = powerups.erase(itPup);
+ continue;
+ }
+
+ wrapSprite(*itPup);
+
+ bool pupErased = false;
+
+ QList<QGraphicsItem *> hits = (*itPup)->collidingItems();
+ for(QList<QGraphicsItem *>::Iterator itHits = hits.begin(); itHits != hits.end(); itHits++)
+ {
+ if ( (*itHits) == ship )
+ {
+ switch( (*itPup)->type() )
+ {
+ case ID_ENERGY_POWERUP:
+ shipPower += 150;
+ if ( shipPower > MAX_POWER_LEVEL )
+ shipPower = MAX_POWER_LEVEL;
+ break;
+ case ID_TELEPORT_POWERUP:
+ mTeleportCount++;
+ break;
+ case ID_BRAKE_POWERUP:
+ if ( mBrakeCount < MAX_BRAKES )
+ mBrakeCount++;
+ break;
+ case ID_SHIELD_POWERUP:
+ if ( mShieldCount < MAX_SHIELDS )
+ mShieldCount++;
+ break;
+ case ID_SHOOT_POWERUP:
+ if ( mShootCount < MAX_FIREPOWER )
+ mShootCount++;
+ break;
+ }
+
+ delete *itPup;
+ itPup = powerups.erase(itPup);
+ pupErased = true;
+ vitalsChanged = TRUE;
+ break;
+ }
+ else if((*itHits) == shield )
+ {
+ delete *itPup;
+ itPup = powerups.erase(itPup);
+ pupErased = true;
+ break;
+ }
+ else if ( (*itHits)->type() == ID_MISSILE )
+ {
+ if ( can_destroy_powerups )
+ {
+ delete *itPup;
+ itPup = powerups.erase(itPup);
+ pupErased = true;
+ break;
+ }
+ }
+ }
+
+ if(!pupErased)
+ itPup++;
+ }
}
// - - -
diff --git a/examples/graphicsview/portedasteroids/view.h b/examples/graphicsview/portedasteroids/view.h
index eeb7e2bf5b..31ae3a098a 100644
--- a/examples/graphicsview/portedasteroids/view.h
+++ b/examples/graphicsview/portedasteroids/view.h
@@ -47,13 +47,12 @@
#ifndef __AST_VIEW_H__
#define __AST_VIEW_H__
-#include <qwidget.h>
-#include <q3ptrlist.h>
-#include <q3intdict.h>
-#include <qtimer.h>
+#include <QWidget>
+#include <QList>
+#include <QMultiHash>
+#include <QTimer>
#include <QGraphicsScene>
#include <QGraphicsView>
-//Added by qt3to4:
#include <QTimerEvent>
#include <QShowEvent>
#include <QResizeEvent>
@@ -65,7 +64,7 @@ class KAsteroidsView : public QWidget
{
Q_OBJECT
public:
- KAsteroidsView( QWidget *parent = 0, const char *name = 0 );
+ KAsteroidsView( QWidget *parent = 0);
virtual ~KAsteroidsView();
int refreshRate;
@@ -129,11 +128,11 @@ private:
QGraphicsScene field;
QGraphicsView view;
QMap<int, QList<QPixmap> > animation;
- Q3PtrList<AnimatedPixmapItem> rocks;
- Q3PtrList<KMissile> missiles;
- Q3PtrList<KBit> bits;
- Q3PtrList<KExhaust> exhaust;
- Q3PtrList<KPowerup> powerups;
+ QList<AnimatedPixmapItem*> rocks;
+ QList<KMissile*> missiles;
+ QList<KBit*> bits;
+ QList<KExhaust*> exhaust;
+ QList<KPowerup*> powerups;
KShield *shield;
AnimatedPixmapItem *ship;
QGraphicsTextItem *textSprite;
diff --git a/examples/graphicsview/portedcanvas/canvas.cpp b/examples/graphicsview/portedcanvas/canvas.cpp
index 7937762f0d..efcfcc5dad 100644
--- a/examples/graphicsview/portedcanvas/canvas.cpp
+++ b/examples/graphicsview/portedcanvas/canvas.cpp
@@ -38,27 +38,24 @@
**
****************************************************************************/
-#include <qdatetime.h>
-#include <qmainwindow.h>
-#include <qstatusbar.h>
-#include <qmessagebox.h>
-#include <qmenubar.h>
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qprinter.h>
-#include <qlabel.h>
-#include <qimage.h>
-#include <q3progressdialog.h>
-#include <Q3PointArray>
-#include <Q3PtrList>
+#include <QDateTime>
+#include <QMainWindow>
+#include <QStatusBar>
+#include <QMessageBox>
+#include <QMenuBar>
+#include <QApplication>
+#include <QPainter>
+#include <QPrinter>
+#include <QPrintDialog>
+#include <QLabel>
+#include <QImage>
+#include <QProgressDialog>
#include <QPixmap>
-#include <Q3PopupMenu>
#include <QMouseEvent>
-#include <Q3MemArray>
-#include "canvas.h"
#include <QStyleOptionGraphicsItem>
-#include <qdebug.h>
-#include <stdlib.h>
+#include <QDebug>
+
+#include "canvas.h"
// We use a global variable to save memory - all the brushes and pens in
// the mesh are shared.
@@ -79,14 +76,11 @@ private:
static int c;
};
-static const int imageRTTI = 984376;
-
class ImageItem: public QGraphicsRectItem
{
public:
ImageItem( QImage img );
- int rtti () const { return imageRTTI; }
protected:
void paint( QPainter *, const QStyleOptionGraphicsItem *option, QWidget *widget );
private:
@@ -101,7 +95,7 @@ ImageItem::ImageItem( QImage img )
setRect(0, 0, image.width(), image.height());
setFlag(ItemIsMovable);
#if !defined(Q_WS_QWS)
- pixmap.convertFromImage(image, Qt::OrderedAlphaDither);
+ pixmap.fromImage(image, Qt::OrderedAlphaDither);
#endif
}
@@ -131,8 +125,8 @@ protected:
// QPoint center() { return boundingRect().center(); }
private:
- Q3PtrList<EdgeItem> inList;
- Q3PtrList<EdgeItem> outList;
+ QList<EdgeItem*> inList;
+ QList<EdgeItem*> outList;
};
@@ -163,15 +157,12 @@ void EdgeItem::setToPoint( int x, int y )
QVariant NodeItem::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == ItemPositionHasChanged) {
- Q3PtrListIterator<EdgeItem> it1( inList );
EdgeItem *edge;
- while (( edge = it1.current() )) {
- ++it1;
+ foreach(edge, inList) {
edge->setToPoint( int(x()), int(y()) );
}
- Q3PtrListIterator<EdgeItem> it2( outList );
- while (( edge = it2.current() )) {
- ++it2;
+
+ foreach(edge, outList) {
edge->setFromPoint( int(x()), int(y()) );
}
}
@@ -311,63 +302,65 @@ static uint mainCount = 0;
static QImage *butterflyimg;
static QImage *logoimg;
-Main::Main(QGraphicsScene& c, QWidget* parent, const char* name, Qt::WindowFlags f) :
- Q3MainWindow(parent,name,f),
+Main::Main(QGraphicsScene& c, QWidget* parent, Qt::WindowFlags f) :
+ QMainWindow(parent, f),
canvas(c)
{
editor = new FigureEditor(canvas,this);
+
QMenuBar* menu = menuBar();
- Q3PopupMenu* file = new Q3PopupMenu( menu );
- file->insertItem("&Fill canvas", this, SLOT(init()), Qt::CTRL+Qt::Key_F);
- file->insertItem("&Erase canvas", this, SLOT(clear()), Qt::CTRL+Qt::Key_E);
- file->insertItem("&New view", this, SLOT(newView()), Qt::CTRL+Qt::Key_N);
- file->insertSeparator();
- file->insertItem("&Print...", this, SLOT(print()), Qt::CTRL+Qt::Key_P);
- file->insertSeparator();
- file->insertItem("E&xit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q);
- menu->insertItem("&File", file);
-
- Q3PopupMenu* edit = new Q3PopupMenu( menu );
- edit->insertItem("Add &Circle", this, SLOT(addCircle()), Qt::ALT+Qt::Key_C);
- edit->insertItem("Add &Hexagon", this, SLOT(addHexagon()), Qt::ALT+Qt::Key_H);
- edit->insertItem("Add &Polygon", this, SLOT(addPolygon()), Qt::ALT+Qt::Key_P);
- edit->insertItem("Add Spl&ine", this, SLOT(addSpline()), Qt::ALT+Qt::Key_I);
- edit->insertItem("Add &Text", this, SLOT(addText()), Qt::ALT+Qt::Key_T);
- edit->insertItem("Add &Line", this, SLOT(addLine()), Qt::ALT+Qt::Key_L);
- edit->insertItem("Add &Rectangle", this, SLOT(addRectangle()), Qt::ALT+Qt::Key_R);
- edit->insertItem("Add &Sprite", this, SLOT(addSprite()), Qt::ALT+Qt::Key_S);
- edit->insertItem("Create &Mesh", this, SLOT(addMesh()), Qt::ALT+Qt::Key_M );
- edit->insertItem("Add &Alpha-blended image", this, SLOT(addButterfly()), Qt::ALT+Qt::Key_A);
- menu->insertItem("&Edit", edit);
-
- Q3PopupMenu* view = new Q3PopupMenu( menu );
- view->insertItem("&Enlarge", this, SLOT(enlarge()), Qt::SHIFT+Qt::CTRL+Qt::Key_Plus);
- view->insertItem("Shr&ink", this, SLOT(shrink()), Qt::SHIFT+Qt::CTRL+Qt::Key_Minus);
- view->insertSeparator();
- view->insertItem("&Rotate clockwise", this, SLOT(rotateClockwise()), Qt::CTRL+Qt::Key_PageDown);
- view->insertItem("Rotate &counterclockwise", this, SLOT(rotateCounterClockwise()), Qt::CTRL+Qt::Key_PageUp);
- view->insertItem("&Zoom in", this, SLOT(zoomIn()), Qt::CTRL+Qt::Key_Plus);
- view->insertItem("Zoom &out", this, SLOT(zoomOut()), Qt::CTRL+Qt::Key_Minus);
- view->insertItem("Translate left", this, SLOT(moveL()), Qt::CTRL+Qt::Key_Left);
- view->insertItem("Translate right", this, SLOT(moveR()), Qt::CTRL+Qt::Key_Right);
- view->insertItem("Translate up", this, SLOT(moveU()), Qt::CTRL+Qt::Key_Up);
- view->insertItem("Translate down", this, SLOT(moveD()), Qt::CTRL+Qt::Key_Down);
- view->insertItem("&Mirror", this, SLOT(mirror()), Qt::CTRL+Qt::Key_Home);
- menu->insertItem("&View", view);
-
- menu->insertSeparator();
-
- Q3PopupMenu* help = new Q3PopupMenu( menu );
- help->insertItem("&About", this, SLOT(help()), Qt::Key_F1);
- help->setItemChecked(dbf_id, TRUE);
- menu->insertItem("&Help",help);
+ QMenu* file = new QMenu("&File", menu );
+ file->addAction("&Fill canvas", this, SLOT(init()), Qt::CTRL+Qt::Key_F);
+ file->addAction("&Erase canvas", this, SLOT(clear()), Qt::CTRL+Qt::Key_E);
+ file->addAction("&New view", this, SLOT(newView()), Qt::CTRL+Qt::Key_N);
+ file->addSeparator();
+ file->addAction("&Print...", this, SLOT(print()), Qt::CTRL+Qt::Key_P);
+ file->addSeparator();
+ file->addAction("E&xit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q);
+ menu->addMenu(file);
+
+ QMenu* edit = new QMenu("&Edit", menu );
+ edit->addAction("Add &Circle", this, SLOT(addCircle()), Qt::ALT+Qt::Key_C);
+ edit->addAction("Add &Hexagon", this, SLOT(addHexagon()), Qt::ALT+Qt::Key_H);
+ edit->addAction("Add &Polygon", this, SLOT(addPolygon()), Qt::ALT+Qt::Key_P);
+ edit->addAction("Add Spl&ine", this, SLOT(addSpline()), Qt::ALT+Qt::Key_I);
+ edit->addAction("Add &Text", this, SLOT(addText()), Qt::ALT+Qt::Key_T);
+ edit->addAction("Add &Line", this, SLOT(addLine()), Qt::ALT+Qt::Key_L);
+ edit->addAction("Add &Rectangle", this, SLOT(addRectangle()), Qt::ALT+Qt::Key_R);
+ edit->addAction("Add &Sprite", this, SLOT(addSprite()), Qt::ALT+Qt::Key_S);
+ edit->addAction("Create &Mesh", this, SLOT(addMesh()), Qt::ALT+Qt::Key_M );
+ edit->addAction("Add &Alpha-blended image", this, SLOT(addButterfly()), Qt::ALT+Qt::Key_A);
+ menu->addMenu(edit);
+
+ QMenu* view = new QMenu("&View", menu );
+ view->addAction("&Enlarge", this, SLOT(enlarge()), Qt::SHIFT+Qt::CTRL+Qt::Key_Plus);
+ view->addAction("Shr&ink", this, SLOT(shrink()), Qt::SHIFT+Qt::CTRL+Qt::Key_Minus);
+ view->addSeparator();
+ view->addAction("&Rotate clockwise", this, SLOT(rotateClockwise()), Qt::CTRL+Qt::Key_PageDown);
+ view->addAction("Rotate &counterclockwise", this, SLOT(rotateCounterClockwise()), Qt::CTRL+Qt::Key_PageUp);
+ view->addAction("&Zoom in", this, SLOT(zoomIn()), Qt::CTRL+Qt::Key_Plus);
+ view->addAction("Zoom &out", this, SLOT(zoomOut()), Qt::CTRL+Qt::Key_Minus);
+ view->addAction("Translate left", this, SLOT(moveL()), Qt::CTRL+Qt::Key_Left);
+ view->addAction("Translate right", this, SLOT(moveR()), Qt::CTRL+Qt::Key_Right);
+ view->addAction("Translate up", this, SLOT(moveU()), Qt::CTRL+Qt::Key_Up);
+ view->addAction("Translate down", this, SLOT(moveD()), Qt::CTRL+Qt::Key_Down);
+ view->addAction("&Mirror", this, SLOT(mirror()), Qt::CTRL+Qt::Key_Home);
+ menu->addMenu(view);
+
+ menu->addSeparator();
+
+ QMenu* help = new QMenu("&Help", menu );
+ help->addAction("&About", this, SLOT(help()), Qt::Key_F1);
+ menu->addMenu(help);
statusBar();
setCentralWidget(editor);
+#if !defined(Q_OS_SYMBIAN)
printer = 0;
+#endif
init();
}
@@ -397,7 +390,9 @@ void Main::init()
Main::~Main()
{
+#if !defined(Q_OS_SYMBIAN)
delete printer;
+#endif
if ( !--mainCount ) {
delete[] butterflyimg;
butterflyimg = 0;
@@ -409,7 +404,7 @@ Main::~Main()
void Main::newView()
{
// Open a new view... have it delete when closed.
- Main *m = new Main(canvas, 0, 0, Qt::WDestructiveClose);
+ Main *m = new Main(canvas, 0); // AKr, Qt::WA_DeleteOnClose);
m->show();
}
@@ -428,7 +423,7 @@ void Main::help()
"<li> Press ALT-L for some lines."
"<li> Drag the objects around."
"<li> Read the code!"
- "</ul>", QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
+ "</ul>", QMessageBox::Information, 1, 0, 0, this, 0);
about->setButtonText( 1, "Dismiss" );
about->show();
}
@@ -495,11 +490,14 @@ void Main::moveD()
void Main::print()
{
+#if !defined(Q_OS_SYMBIAN)
if ( !printer ) printer = new QPrinter;
- if ( printer->setup(this) ) {
- QPainter pp(printer);
+ QPrintDialog dialog(printer, this);
+ if(dialog.exec()) {
+ QPainter pp(printer);
canvas.render(&pp);
}
+#endif
}
@@ -522,12 +520,12 @@ void Main::addButterfly()
if ( !butterflyimg ) {
butterflyimg = new QImage[4];
butterflyimg[0].load( butterfly_fn );
- butterflyimg[1] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.75),
- int(butterflyimg[0].height()*0.75) );
- butterflyimg[2] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.5),
- int(butterflyimg[0].height()*0.5) );
- butterflyimg[3] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.25),
- int(butterflyimg[0].height()*0.25) );
+ butterflyimg[1] = butterflyimg[0].scaled( int(butterflyimg[0].width()*0.75),
+ int(butterflyimg[0].height()*0.75), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ butterflyimg[2] = butterflyimg[0].scaled( int(butterflyimg[0].width()*0.5),
+ int(butterflyimg[0].height()*0.5), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ butterflyimg[3] = butterflyimg[0].scaled( int(butterflyimg[0].width()*0.25),
+ int(butterflyimg[0].height()*0.25), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
QAbstractGraphicsShapeItem* i = new ImageItem(butterflyimg[qrand()%4]);
canvas.addItem(i);
@@ -543,12 +541,12 @@ void Main::addLogo()
if ( !logoimg ) {
logoimg = new QImage[4];
logoimg[0].load( logo_fn );
- logoimg[1] = logoimg[0].smoothScale( int(logoimg[0].width()*0.75),
- int(logoimg[0].height()*0.75) );
- logoimg[2] = logoimg[0].smoothScale( int(logoimg[0].width()*0.5),
- int(logoimg[0].height()*0.5) );
- logoimg[3] = logoimg[0].smoothScale( int(logoimg[0].width()*0.25),
- int(logoimg[0].height()*0.25) );
+ logoimg[1] = logoimg[0].scaled( int(logoimg[0].width()*0.75),
+ int(logoimg[0].height()*0.75), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ logoimg[2] = logoimg[0].scaled( int(logoimg[0].width()*0.5),
+ int(logoimg[0].height()*0.5), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ logoimg[3] = logoimg[0].scaled( int(logoimg[0].width()*0.25),
+ int(logoimg[0].height()*0.25), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
QAbstractGraphicsShapeItem* i = new ImageItem(logoimg[qrand()%4]);
canvas.addItem(i);
@@ -572,14 +570,15 @@ void Main::addCircle()
void Main::addHexagon()
{
const int size = int(canvas.width() / 25);
- Q3PointArray pa(6);
- pa[0] = QPoint(2*size,0);
- pa[1] = QPoint(size,-size*173/100);
- pa[2] = QPoint(-size,-size*173/100);
- pa[3] = QPoint(-2*size,0);
- pa[4] = QPoint(-size,size*173/100);
- pa[5] = QPoint(size,size*173/100);
- QGraphicsPolygonItem* i = canvas.addPolygon(pa);
+ QPolygon polygon;
+ polygon << QPoint(2*size,0)
+ << QPoint(size,-size*173/100)
+ << QPoint(-size,-size*173/100)
+ << QPoint(-2*size,0)
+ << QPoint(-size,size*173/100)
+ << QPoint(size,size*173/100);
+
+ QGraphicsPolygonItem* i = canvas.addPolygon(polygon);
i->setFlag(QGraphicsItem::ItemIsMovable);
i->setPen(Qt::NoPen);
i->setBrush( QColor(qrand()%32*8,qrand()%32*8,qrand()%32*8) );
@@ -590,14 +589,15 @@ void Main::addHexagon()
void Main::addPolygon()
{
const int size = int(canvas.width()/2);
- Q3PointArray pa(6);
- pa[0] = QPoint(0,0);
- pa[1] = QPoint(size,size/5);
- pa[2] = QPoint(size*4/5,size);
- pa[3] = QPoint(size/6,size*5/4);
- pa[4] = QPoint(size*3/4,size*3/4);
- pa[5] = QPoint(size*3/4,size/4);
- QGraphicsPolygonItem* i = canvas.addPolygon(pa);
+ QPolygon polygon;
+ polygon << QPoint(0,0)
+ << QPoint(size,size/5)
+ << QPoint(size*4/5,size)
+ << QPoint(size/6,size*5/4)
+ << QPoint(size*3/4,size*3/4)
+ << QPoint(size*3/4,size/4);
+
+ QGraphicsPolygonItem* i = canvas.addPolygon(polygon);
i->setFlag(QGraphicsItem::ItemIsMovable);
i->setPen(Qt::NoPen);
i->setBrush( QColor(qrand()%32*8,qrand()%32*8,qrand()%32*8) );
@@ -609,24 +609,24 @@ void Main::addSpline()
{
const int size = int(canvas.width()/6);
- Q3PointArray pa(12);
- pa[0] = QPoint(0,0);
- pa[1] = QPoint(size/2,0);
- pa[2] = QPoint(size,size/2);
- pa[3] = QPoint(size,size);
- pa[4] = QPoint(size,size*3/2);
- pa[5] = QPoint(size/2,size*2);
- pa[6] = QPoint(0,size*2);
- pa[7] = QPoint(-size/2,size*2);
- pa[8] = QPoint(size/4,size*3/2);
- pa[9] = QPoint(0,size);
- pa[10]= QPoint(-size/4,size/2);
- pa[11]= QPoint(-size/2,0);
+ QPolygon polygon;
+ polygon << QPoint(0,0)
+ << QPoint(size/2,0)
+ << QPoint(size,size/2)
+ << QPoint(size,size)
+ << QPoint(size,size*3/2)
+ << QPoint(size/2,size*2)
+ << QPoint(0,size*2)
+ << QPoint(-size/2,size*2)
+ << QPoint(size/4,size*3/2)
+ << QPoint(0,size)
+ << QPoint(-size/4,size/2)
+ << QPoint(-size/2,0);
QPainterPath path;
- path.moveTo(pa[0]);
- for (int i = 1; i < pa.size(); i += 3)
- path.cubicTo(pa[i], pa[(i + 1) % pa.size()], pa[(i + 2) % pa.size()]);
+ path.moveTo(polygon[0]);
+ for (int i = 1; i < polygon.size(); i += 3)
+ path.cubicTo(polygon[i], polygon[(i + 1) % polygon.size()], polygon[(i + 2) % polygon.size()]);
QGraphicsPathItem* item = canvas.addPath(path);
item->setFlag(QGraphicsItem::ItemIsMovable);
@@ -671,13 +671,12 @@ void Main::addMesh()
int cols = w / dist;
#ifndef QT_NO_PROGRESSDIALOG
- Q3ProgressDialog progress( "Creating mesh...", "Abort", rows,
- this, "progress", TRUE );
+ QProgressDialog progress("Creating mesh...", "Abort", 0, rows, this);
#endif
canvas.update();
- Q3MemArray<NodeItem*> lastRow(cols);
+ QVector<NodeItem*> lastRow(cols);
for ( int j = 0; j < rows; j++ ) {
int n = j%2 ? cols-1 : cols;
NodeItem *prev = 0;
@@ -707,13 +706,13 @@ void Main::addMesh()
}
lastRow[n-1]=prev;
#ifndef QT_NO_PROGRESSDIALOG
- progress.setProgress( j );
- if ( progress.wasCancelled() )
+ progress.setValue( j );
+ if ( progress.wasCanceled() )
break;
#endif
}
#ifndef QT_NO_PROGRESSDIALOG
- progress.setProgress( rows );
+ progress.setValue( rows );
#endif
// qDebug( "%d nodes, %d edges", nodecount, EdgeItem::count() );
}
diff --git a/examples/graphicsview/portedcanvas/canvas.h b/examples/graphicsview/portedcanvas/canvas.h
index 1ebdf90449..609090b582 100644
--- a/examples/graphicsview/portedcanvas/canvas.h
+++ b/examples/graphicsview/portedcanvas/canvas.h
@@ -41,9 +41,8 @@
#ifndef EXAMPLE_H
#define EXAMPLE_H
-#include <q3popupmenu.h>
-#include <q3mainwindow.h>
-#include <q3intdict.h>
+#include <QMenu>
+#include <QMainWindow>
#include <QMouseEvent>
#include <QGraphicsView>
#include <QGraphicsScene>
@@ -76,11 +75,11 @@ signals:
void status(const QString&);
};
-class Main : public Q3MainWindow {
+class Main : public QMainWindow {
Q_OBJECT
public:
- Main(QGraphicsScene&, QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0);
+ Main(QGraphicsScene&, QWidget* parent=0, Qt::WindowFlags f=0);
~Main();
public slots:
@@ -122,9 +121,10 @@ private:
QGraphicsScene& canvas;
FigureEditor *editor;
- Q3PopupMenu* options;
+ QMenu* options;
+#if !defined(Q_OS_SYMBIAN)
QPrinter* printer;
- int dbf_id;
+#endif
};
#endif
diff --git a/examples/graphicsview/portedcanvas/main.cpp b/examples/graphicsview/portedcanvas/main.cpp
index 8478d94ac2..4e447baefe 100644
--- a/examples/graphicsview/portedcanvas/main.cpp
+++ b/examples/graphicsview/portedcanvas/main.cpp
@@ -38,13 +38,13 @@
**
****************************************************************************/
-#include <qstatusbar.h>
-#include <qmessagebox.h>
-#include <qmenubar.h>
-#include <qapplication.h>
-#include <qdesktopwidget.h>
-#include <qimage.h>
-#include <qtimer.h>
+#include <QStatusBar>
+#include <QMessageBox>
+#include <QMenuBar>
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QImage>
+#include <QTimer>
#include "canvas.h"
@@ -73,12 +73,19 @@ int main(int argc, char** argv)
canvas.setSceneRect(0, 0, 800, 600);
Main m(canvas);
m.resize(m.sizeHint());
- m.setCaption("Ported Canvas Example");
+ m.setWindowTitle("Ported Canvas Example");
+
+#if defined(Q_OS_SYMBIAN)
+ m.showMaximized();
+#elif defined(Q_WS_MAEMO_5)
+ m.show();
+#else
if ( QApplication::desktop()->width() > m.width() + 10
&& QApplication::desktop()->height() > m.height() +30 )
m.show();
else
m.showMaximized();
+#endif
QTimer timer;
QObject::connect(&timer, SIGNAL(timeout()), &canvas, SLOT(advance()));
diff --git a/examples/graphicsview/portedcanvas/portedcanvas.desktop b/examples/graphicsview/portedcanvas/portedcanvas.desktop
new file mode 100644
index 0000000000..1217dc43de
--- /dev/null
+++ b/examples/graphicsview/portedcanvas/portedcanvas.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Ported Canvas
+Exec=/opt/usr/bin/portedcanvas
+Icon=portedcanvas
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/portedcanvas/portedcanvas.pro b/examples/graphicsview/portedcanvas/portedcanvas.pro
index 850b4409e0..f2d626de71 100644
--- a/examples/graphicsview/portedcanvas/portedcanvas.pro
+++ b/examples/graphicsview/portedcanvas/portedcanvas.pro
@@ -5,7 +5,6 @@ CONFIG += qt warn_on
HEADERS = canvas.h
SOURCES = canvas.cpp main.cpp
-QT += qt3support
RESOURCES += portedcanvas.qrc
@@ -16,3 +15,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedcanvas
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/simpleanchorlayout/main.cpp b/examples/graphicsview/simpleanchorlayout/main.cpp
index 4fa837f540..cba37d9fb7 100644
--- a/examples/graphicsview/simpleanchorlayout/main.cpp
+++ b/examples/graphicsview/simpleanchorlayout/main.cpp
@@ -126,8 +126,15 @@ int main(int argc, char *argv[])
QGraphicsView *view = new QGraphicsView();
view->setScene(scene);
view->setWindowTitle(QApplication::translate("simpleanchorlayout", "Simple Anchor Layout"));
+
+#if defined(Q_OS_SYMBIAN)
+ view->showMaximized();
+#elif defined(Q_WS_MAEMO_5)
+ view-show();
+#else
view->resize(360, 320);
view->show();
+#endif
return app.exec();
}
diff --git a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.desktop b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.desktop
new file mode 100644
index 0000000000..0e8d73a859
--- /dev/null
+++ b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple Anchor Layout
+Exec=/opt/usr/bin/simpleanchorlayout
+Icon=simpleanchorlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro
index e1c7aeb446..2c8c3c37fc 100644
--- a/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro
+++ b/examples/graphicsview/simpleanchorlayout/simpleanchorlayout.pro
@@ -7,3 +7,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/simpleanchorlayout
INSTALLS += target sources
TARGET = simpleanchorlayout
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/graphicsview/weatheranchorlayout/main.cpp b/examples/graphicsview/weatheranchorlayout/main.cpp
index 67596ac4bc..b1f2c724a1 100644
--- a/examples/graphicsview/weatheranchorlayout/main.cpp
+++ b/examples/graphicsview/weatheranchorlayout/main.cpp
@@ -51,6 +51,21 @@
#include <QGraphicsSceneResizeEvent>
+class GraphicsView : public QGraphicsView
+{
+public:
+ GraphicsView(QGraphicsScene *scene, QGraphicsWidget *widget) : QGraphicsView(scene), w(widget)
+ {
+ }
+
+ virtual void resizeEvent(QResizeEvent *event)
+ {
+ w->setGeometry(0, 0, event->size().width(), event->size().height());
+ }
+
+ QGraphicsWidget *w;
+};
+
class PixmapWidget : public QGraphicsLayoutItem
{
@@ -175,7 +190,10 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
QGraphicsScene scene;
+#if defined(Q_OS_SYMBIAN)
+#else
scene.setSceneRect(0, 0, 800, 480);
+#endif
// pixmaps widgets
PixmapWidget *title = new PixmapWidget(QPixmap(":/images/title.jpg"));
@@ -250,8 +268,13 @@ int main(int argc, char **argv)
// QGV setup
scene.addItem(w);
scene.setBackgroundBrush(Qt::white);
+#if defined(Q_OS_SYMBIAN)
+ GraphicsView *view = new GraphicsView(&scene, w);
+ view->showMaximized();
+#else
QGraphicsView *view = new QGraphicsView(&scene);
view->show();
+#endif
return app.exec();
}
diff --git a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.desktop b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.desktop
new file mode 100644
index 0000000000..0c6ab89a68
--- /dev/null
+++ b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Weather Anchor Layout
+Exec=/opt/usr/bin/weatheranchorlayout
+Icon=weatheranchorlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro
index fa2733c875..68a3a311e4 100644
--- a/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro
+++ b/examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro
@@ -12,3 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES weatheranchorlayout.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/weatheranchorlayout
INSTALLS += target sources
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/help/contextsensitivehelp/contextsensitivehelp.desktop b/examples/help/contextsensitivehelp/contextsensitivehelp.desktop
new file mode 100644
index 0000000000..3171065f8c
--- /dev/null
+++ b/examples/help/contextsensitivehelp/contextsensitivehelp.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Context-Sensitive Help
+Exec=/opt/usr/bin/contextsensitivehelp
+Icon=contextsensitivehelp
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/help/contextsensitivehelp/contextsensitivehelp.pro b/examples/help/contextsensitivehelp/contextsensitivehelp.pro
index 03b0a8d810..cabc49b410 100644
--- a/examples/help/contextsensitivehelp/contextsensitivehelp.pro
+++ b/examples/help/contextsensitivehelp/contextsensitivehelp.pro
@@ -18,3 +18,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/help/contextsensitivehelp
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/help/help.pro b/examples/help/help.pro
index 79b005ee58..33bd4d55cd 100644
--- a/examples/help/help.pro
+++ b/examples/help/help.pro
@@ -10,4 +10,3 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/help
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/help/remotecontrol/remotecontrol.desktop b/examples/help/remotecontrol/remotecontrol.desktop
new file mode 100644
index 0000000000..7a720550d8
--- /dev/null
+++ b/examples/help/remotecontrol/remotecontrol.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Remote Control
+Exec=/opt/usr/bin/remotecontrol
+Icon=remotecontrol
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/help/remotecontrol/remotecontrol.pro b/examples/help/remotecontrol/remotecontrol.pro
index 55473592da..0e95cdcc9c 100644
--- a/examples/help/remotecontrol/remotecontrol.pro
+++ b/examples/help/remotecontrol/remotecontrol.pro
@@ -13,3 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/help/remotecontrol
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/help/simpletextviewer/simpletextviewer.desktop b/examples/help/simpletextviewer/simpletextviewer.desktop
new file mode 100644
index 0000000000..d72b602a9b
--- /dev/null
+++ b/examples/help/simpletextviewer/simpletextviewer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple Text Viewer
+Exec=/opt/usr/bin/simpletextviewer
+Icon=simpletextviewer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/help/simpletextviewer/simpletextviewer.pro b/examples/help/simpletextviewer/simpletextviewer.pro
index bfbd31b1b8..b4dbab60fd 100644
--- a/examples/help/simpletextviewer/simpletextviewer.pro
+++ b/examples/help/simpletextviewer/simpletextviewer.pro
@@ -15,4 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/help/simpletextviewer
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/ipc/ipc.pro b/examples/ipc/ipc.pro
index d084498e1c..4282043599 100644
--- a/examples/ipc/ipc.pro
+++ b/examples/ipc/ipc.pro
@@ -8,4 +8,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS ipc.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/ipc/localfortuneclient/client.cpp b/examples/ipc/localfortuneclient/client.cpp
index c8c3fe4f35..86cc0cc005 100644
--- a/examples/ipc/localfortuneclient/client.cpp
+++ b/examples/ipc/localfortuneclient/client.cpp
@@ -44,7 +44,11 @@
#include "client.h"
Client::Client(QWidget *parent)
+#ifdef Q_WS_MAEMO_5
+ : QWidget(parent)
+#else
: QDialog(parent)
+#endif
{
hostLabel = new QLabel(tr("&Server name:"));
hostLineEdit = new QLineEdit("fortune");
@@ -53,6 +57,7 @@ Client::Client(QWidget *parent)
statusLabel = new QLabel(tr("This examples requires that you run the "
"Fortune Server example as well."));
+ statusLabel->setWordWrap(true);
getFortuneButton = new QPushButton(tr("Get Fortune"));
getFortuneButton->setDefault(true);
diff --git a/examples/ipc/localfortuneclient/client.h b/examples/ipc/localfortuneclient/client.h
index d23db9e6e2..b0f0e36189 100644
--- a/examples/ipc/localfortuneclient/client.h
+++ b/examples/ipc/localfortuneclient/client.h
@@ -41,7 +41,12 @@
#ifndef CLIENT_H
#define CLIENT_H
+#ifdef Q_WS_MAEMO_5
+#include <QWidget>
+#else
#include <QDialog>
+#endif
+
#include <qlocalsocket.h>
QT_BEGIN_NAMESPACE
@@ -52,7 +57,11 @@ class QPushButton;
class QLocalSocket;
QT_END_NAMESPACE
+#ifdef Q_WS_MAEMO_5
+class Client : public QWidget
+#else
class Client : public QDialog
+#endif
{
Q_OBJECT
diff --git a/examples/ipc/localfortuneclient/localfortuneclient.desktop b/examples/ipc/localfortuneclient/localfortuneclient.desktop
new file mode 100644
index 0000000000..556ff4795d
--- /dev/null
+++ b/examples/ipc/localfortuneclient/localfortuneclient.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Local Fortune Client
+Exec=/opt/usr/bin/localfortuneclient
+Icon=localfortuneclient
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/ipc/localfortuneclient/localfortuneclient.pro b/examples/ipc/localfortuneclient/localfortuneclient.pro
index a937ea16c4..47ae6fbc7f 100644
--- a/examples/ipc/localfortuneclient/localfortuneclient.pro
+++ b/examples/ipc/localfortuneclient/localfortuneclient.pro
@@ -10,5 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/localfortuneclient
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-
-
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/ipc/localfortuneclient/main.cpp b/examples/ipc/localfortuneclient/main.cpp
index 19464d1de3..8e6feeba72 100644
--- a/examples/ipc/localfortuneclient/main.cpp
+++ b/examples/ipc/localfortuneclient/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Client client;
+#if defined(Q_WS_S60)
+ client.showMaximized();
+#else
client.show();
- return client.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/ipc/localfortuneserver/localfortuneserver.desktop b/examples/ipc/localfortuneserver/localfortuneserver.desktop
new file mode 100644
index 0000000000..74f485049a
--- /dev/null
+++ b/examples/ipc/localfortuneserver/localfortuneserver.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Local Fortune Server
+Exec=/opt/usr/bin/localfortuneserver
+Icon=localfortuneserver
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/ipc/localfortuneserver/localfortuneserver.pro b/examples/ipc/localfortuneserver/localfortuneserver.pro
index e14ec8ebf7..313fb7933b 100644
--- a/examples/ipc/localfortuneserver/localfortuneserver.pro
+++ b/examples/ipc/localfortuneserver/localfortuneserver.pro
@@ -10,5 +10,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/localfortuneserver
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
-
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/ipc/localfortuneserver/main.cpp b/examples/ipc/localfortuneserver/main.cpp
index 6c0e9ee9f3..fc0c698156 100644
--- a/examples/ipc/localfortuneserver/main.cpp
+++ b/examples/ipc/localfortuneserver/main.cpp
@@ -49,7 +49,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Server server;
+#if defined(Q_WS_S60)
+ server.showMaximized();
+#else
server.show();
+#endif
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
- return server.exec();
+ return app.exec();
}
diff --git a/examples/ipc/localfortuneserver/server.cpp b/examples/ipc/localfortuneserver/server.cpp
index 88784d440e..08dd31d81e 100644
--- a/examples/ipc/localfortuneserver/server.cpp
+++ b/examples/ipc/localfortuneserver/server.cpp
@@ -48,9 +48,14 @@
#include <qlocalsocket.h>
Server::Server(QWidget *parent)
+#ifdef Q_WS_MAEMO_5
+ : QWidget(parent)
+#else
: QDialog(parent)
+#endif
{
statusLabel = new QLabel;
+ statusLabel->setWordWrap(true);
quitButton = new QPushButton(tr("Quit"));
quitButton->setAutoDefault(false);
diff --git a/examples/ipc/localfortuneserver/server.h b/examples/ipc/localfortuneserver/server.h
index 5f00ba4d2d..313862cfaa 100644
--- a/examples/ipc/localfortuneserver/server.h
+++ b/examples/ipc/localfortuneserver/server.h
@@ -41,7 +41,11 @@
#ifndef SERVER_H
#define SERVER_H
+#ifdef Q_WS_MAEMO_5
+#include <QWidget>
+#else
#include <QDialog>
+#endif
QT_BEGIN_NAMESPACE
class QLabel;
@@ -49,7 +53,11 @@ class QPushButton;
class QLocalServer;
QT_END_NAMESPACE
+#ifdef Q_WS_MAEMO_5
+class Server : public QWidget
+#else
class Server : public QDialog
+#endif
{
Q_OBJECT
diff --git a/examples/ipc/sharedmemory/sharedmemory.desktop b/examples/ipc/sharedmemory/sharedmemory.desktop
new file mode 100644
index 0000000000..118ded97cd
--- /dev/null
+++ b/examples/ipc/sharedmemory/sharedmemory.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Shared Memory
+Exec=/opt/usr/bin/sharedmemory
+Icon=sharedmemory
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/ipc/sharedmemory/sharedmemory.pro b/examples/ipc/sharedmemory/sharedmemory.pro
index 37ac2c8b06..1414309fd6 100644
--- a/examples/ipc/sharedmemory/sharedmemory.pro
+++ b/examples/ipc/sharedmemory/sharedmemory.pro
@@ -13,3 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/itemviews/addressbook/addressbook.desktop b/examples/itemviews/addressbook/addressbook.desktop
new file mode 100644
index 0000000000..11767f59d8
--- /dev/null
+++ b/examples/itemviews/addressbook/addressbook.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Address Book
+Exec=/opt/usr/bin/addressbook
+Icon=addressbook
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/addressbook/addressbook.pro b/examples/itemviews/addressbook/addressbook.pro
index f45f92c104..d5d4af9d09 100644
--- a/examples/itemviews/addressbook/addressbook.pro
+++ b/examples/itemviews/addressbook/addressbook.pro
@@ -20,3 +20,5 @@ symbian {
TARGET.UID3 = 0xA000A646
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/addressbook/main.cpp b/examples/itemviews/addressbook/main.cpp
index 455b275dfb..76efb01979 100644
--- a/examples/itemviews/addressbook/main.cpp
+++ b/examples/itemviews/addressbook/main.cpp
@@ -46,7 +46,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mw;
+#if defined(Q_OS_SYMBIAN)
+ mw.showMaximized();
+#else
mw.show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.desktop b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.desktop
new file mode 100644
index 0000000000..22621f3ba5
--- /dev/null
+++ b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Basic Sort Filter Model
+Exec=/opt/usr/bin/basicsortfiltermodel
+Icon=basicsortfiltermodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
index 1daba5d9fe..cdf9d36e53 100644
--- a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
+++ b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
@@ -10,3 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/basicsortfiltermodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/basicsortfiltermodel/main.cpp b/examples/itemviews/basicsortfiltermodel/main.cpp
index 84cfd05478..750a19e55a 100644
--- a/examples/itemviews/basicsortfiltermodel/main.cpp
+++ b/examples/itemviews/basicsortfiltermodel/main.cpp
@@ -88,6 +88,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
Window window;
window.setSourceModel(createMailModel(&window));
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/basicsortfiltermodel/window.cpp b/examples/itemviews/basicsortfiltermodel/window.cpp
index f35c1e18f6..f95c9cc48a 100644
--- a/examples/itemviews/basicsortfiltermodel/window.cpp
+++ b/examples/itemviews/basicsortfiltermodel/window.cpp
@@ -47,9 +47,6 @@ Window::Window()
proxyModel = new QSortFilterProxyModel;
proxyModel->setDynamicSortFilter(true);
- sourceGroupBox = new QGroupBox(tr("Original Model"));
- proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model"));
-
sourceView = new QTreeView;
sourceView->setRootIsDecorated(false);
sourceView->setAlternatingRowColors(true);
@@ -92,6 +89,41 @@ Window::Window()
connect(sortCaseSensitivityCheckBox, SIGNAL(toggled(bool)),
this, SLOT(sortChanged()));
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ sourceWidget = new QWidget;
+ filterWidget = new QWidget;
+ proxyWidget = new QWidget;
+
+ QHBoxLayout *sourceLayout = new QHBoxLayout;
+ sourceLayout->addWidget(sourceView);
+ sourceWidget->setLayout(sourceLayout);
+
+ QGridLayout *filterLayout = new QGridLayout;
+ filterLayout->addWidget(filterPatternLabel, 1, 0);
+ filterLayout->addWidget(filterPatternLineEdit, 1, 1, 1, 2);
+ filterLayout->addWidget(filterSyntaxLabel, 2, 0);
+ filterLayout->addWidget(filterSyntaxComboBox, 2, 1, 1, 2);
+ filterLayout->addWidget(filterColumnLabel, 3, 0);
+ filterLayout->addWidget(filterColumnComboBox, 3, 1, 1, 2);
+ filterLayout->addWidget(filterCaseSensitivityCheckBox, 4, 0, 1, 2);
+ filterLayout->addWidget(sortCaseSensitivityCheckBox, 4, 2);
+ filterWidget->setLayout(filterLayout);
+
+ QHBoxLayout *proxyLayout = new QHBoxLayout;
+ proxyLayout->addWidget(proxyView);
+ proxyWidget->setLayout(proxyLayout);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+
+ QTabWidget *tabWidget = new QTabWidget;
+ tabWidget->addTab(sourceWidget, "Source");
+ tabWidget->addTab(filterWidget, "Filters");
+ tabWidget->addTab(proxyWidget, "Proxy");
+ mainLayout->addWidget(tabWidget);
+#else
+ sourceGroupBox = new QGroupBox(tr("Original Model"));
+ proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model"));
+
QHBoxLayout *sourceLayout = new QHBoxLayout;
sourceLayout->addWidget(sourceView);
sourceGroupBox->setLayout(sourceLayout);
@@ -109,8 +141,11 @@ Window::Window()
proxyGroupBox->setLayout(proxyLayout);
QVBoxLayout *mainLayout = new QVBoxLayout;
+
mainLayout->addWidget(sourceGroupBox);
mainLayout->addWidget(proxyGroupBox);
+#endif
+
setLayout(mainLayout);
setWindowTitle(tr("Basic Sort/Filter Model"));
diff --git a/examples/itemviews/basicsortfiltermodel/window.h b/examples/itemviews/basicsortfiltermodel/window.h
index 92b5008384..fbdffc3abb 100644
--- a/examples/itemviews/basicsortfiltermodel/window.h
+++ b/examples/itemviews/basicsortfiltermodel/window.h
@@ -71,8 +71,14 @@ private slots:
private:
QSortFilterProxyModel *proxyModel;
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QWidget *sourceWidget;
+ QWidget *filterWidget;
+ QWidget *proxyWidget;
+#else
QGroupBox *sourceGroupBox;
QGroupBox *proxyGroupBox;
+#endif
QTreeView *sourceView;
QTreeView *proxyView;
QCheckBox *filterCaseSensitivityCheckBox;
diff --git a/examples/itemviews/chart/chart.desktop b/examples/itemviews/chart/chart.desktop
new file mode 100644
index 0000000000..73e017baeb
--- /dev/null
+++ b/examples/itemviews/chart/chart.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Chart
+Exec=/opt/usr/bin/chart
+Icon=chart
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro
index 12f08b9943..b8f00cb6fc 100644
--- a/examples/itemviews/chart/chart.pro
+++ b/examples/itemviews/chart/chart.pro
@@ -18,3 +18,5 @@ symbian {
TARGET.UID3 = 0xA000A647
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/chart/main.cpp b/examples/itemviews/chart/main.cpp
index 936654097f..52d8f281c3 100644
--- a/examples/itemviews/chart/main.cpp
+++ b/examples/itemviews/chart/main.cpp
@@ -48,6 +48,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/coloreditorfactory/coloreditorfactory.desktop b/examples/itemviews/coloreditorfactory/coloreditorfactory.desktop
new file mode 100644
index 0000000000..70b966445c
--- /dev/null
+++ b/examples/itemviews/coloreditorfactory/coloreditorfactory.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Color Editor Factory
+Exec=/opt/usr/bin/coloreditorfactory
+Icon=coloreditorfactory
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
index 934d880573..2416eb97dc 100644
--- a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
+++ b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
@@ -11,3 +11,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/coloreditorfactory
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/itemviews/coloreditorfactory/main.cpp b/examples/itemviews/coloreditorfactory/main.cpp
index aa46cc5c53..8b7eff429e 100644
--- a/examples/itemviews/coloreditorfactory/main.cpp
+++ b/examples/itemviews/coloreditorfactory/main.cpp
@@ -47,7 +47,11 @@ int main(int argv, char **args)
QApplication app(argv, args);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/combowidgetmapper/combowidgetmapper.desktop b/examples/itemviews/combowidgetmapper/combowidgetmapper.desktop
new file mode 100644
index 0000000000..3bbf6ad5f3
--- /dev/null
+++ b/examples/itemviews/combowidgetmapper/combowidgetmapper.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Combo Widget Mapper
+Exec=/opt/usr/bin/combowidgetmapper
+Icon=combowidgetmapper
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro
index 7f5c8e8c96..28dffa4931 100644
--- a/examples/itemviews/combowidgetmapper/combowidgetmapper.pro
+++ b/examples/itemviews/combowidgetmapper/combowidgetmapper.pro
@@ -7,3 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/combowidgetmapper
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/combowidgetmapper
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/itemviews/combowidgetmapper/main.cpp b/examples/itemviews/combowidgetmapper/main.cpp
index 41e756d8ad..9e45edefac 100644
--- a/examples/itemviews/combowidgetmapper/main.cpp
+++ b/examples/itemviews/combowidgetmapper/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.desktop b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.desktop
new file mode 100644
index 0000000000..3c961f7e65
--- /dev/null
+++ b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Custom Sort Filter Model
+Exec=/opt/usr/bin/customsortfiltermodel
+Icon=customsortfiltermodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
index df32a2bb91..8754d5ecf8 100644
--- a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
+++ b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
@@ -12,3 +12,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/customsortfiltermodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/itemviews/customsortfiltermodel/main.cpp b/examples/itemviews/customsortfiltermodel/main.cpp
index b35b847663..4154dbf1f9 100644
--- a/examples/itemviews/customsortfiltermodel/main.cpp
+++ b/examples/itemviews/customsortfiltermodel/main.cpp
@@ -89,7 +89,11 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
Window window;
window.setSourceModel(createMailModel(&window));
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/itemviews/customsortfiltermodel/window.cpp b/examples/itemviews/customsortfiltermodel/window.cpp
index 555e854044..51fdcb705e 100644
--- a/examples/itemviews/customsortfiltermodel/window.cpp
+++ b/examples/itemviews/customsortfiltermodel/window.cpp
@@ -48,22 +48,27 @@ Window::Window()
{
proxyModel = new MySortFilterProxyModel(this);
proxyModel->setDynamicSortFilter(true);
-//! [0]
+ //! [0]
-//! [1]
+ //! [1]
sourceView = new QTreeView;
sourceView->setRootIsDecorated(false);
sourceView->setAlternatingRowColors(true);
-//! [1]
+ //! [1]
QHBoxLayout *sourceLayout = new QHBoxLayout;
-//! [2]
+ //! [2]
sourceLayout->addWidget(sourceView);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ sourceWidget = new QWidget;
+ sourceWidget->setLayout(sourceLayout);
+#else
sourceGroupBox = new QGroupBox(tr("Original Model"));
sourceGroupBox->setLayout(sourceLayout);
-//! [2]
+#endif
+ //! [2]
-//! [3]
+ //! [3]
filterCaseSensitivityCheckBox = new QCheckBox(tr("Case sensitive filter"));
filterCaseSensitivityCheckBox->setChecked(true);
@@ -97,11 +102,11 @@ Window::Window()
connect(fromDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(dateFilterChanged()));
connect(toDateEdit, SIGNAL(dateChanged(QDate)),
-//! [3] //! [4]
+ //! [3] //! [4]
this, SLOT(dateFilterChanged()));
-//! [4]
+ //! [4]
-//! [5]
+ //! [5]
proxyView = new QTreeView;
proxyView->setRootIsDecorated(false);
proxyView->setAlternatingRowColors(true);
@@ -109,6 +114,26 @@ Window::Window()
proxyView->setSortingEnabled(true);
proxyView->sortByColumn(1, Qt::AscendingOrder);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QGridLayout *filterLayout = new QGridLayout;
+ filterLayout->addWidget(filterPatternLabel, 0, 0);
+ filterLayout->addWidget(filterPatternLineEdit, 0, 1);
+ filterLayout->addWidget(filterSyntaxComboBox, 0, 2);
+ filterLayout->addWidget(filterCaseSensitivityCheckBox, 1, 0, 1, 3);
+ filterLayout->addWidget(fromLabel, 2, 0);
+ filterLayout->addWidget(fromDateEdit, 2, 1, 1, 2);
+ filterLayout->addWidget(toLabel, 3, 0);
+ filterLayout->addWidget(toDateEdit, 3, 1, 1, 2);
+
+ filterWidget = new QWidget;
+ filterWidget->setLayout(filterLayout);
+
+ QHBoxLayout *proxyLayout = new QHBoxLayout;
+ proxyLayout->addWidget(proxyView);
+
+ proxyWidget = new QWidget;
+ proxyWidget->setLayout(proxyLayout);
+#else
QGridLayout *proxyLayout = new QGridLayout;
proxyLayout->addWidget(proxyView, 0, 0, 1, 3);
proxyLayout->addWidget(filterPatternLabel, 1, 0);
@@ -122,9 +147,21 @@ Window::Window()
proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model"));
proxyGroupBox->setLayout(proxyLayout);
-//! [5]
+#endif
+ //! [5]
-//! [6]
+ //! [6]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QTabWidget *tabWidget = new QTabWidget;
+ tabWidget->addTab(sourceWidget, "Original");
+ tabWidget->addTab(filterWidget, "Filters");
+ tabWidget->addTab(proxyWidget, "Sorted");
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(tabWidget);
+ setLayout(mainLayout);
+ setWindowTitle(tr("Custom Model"));
+#else
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(sourceGroupBox);
mainLayout->addWidget(proxyGroupBox);
@@ -132,6 +169,7 @@ Window::Window()
setWindowTitle(tr("Custom Sort/Filter Model"));
resize(500, 450);
+#endif
}
//! [6]
@@ -151,7 +189,7 @@ void Window::textFilterChanged()
filterSyntaxComboBox->currentIndex()).toInt());
Qt::CaseSensitivity caseSensitivity =
filterCaseSensitivityCheckBox->isChecked() ? Qt::CaseSensitive
- : Qt::CaseInsensitive;
+ : Qt::CaseInsensitive;
QRegExp regExp(filterPatternLineEdit->text(), caseSensitivity, syntax);
proxyModel->setFilterRegExp(regExp);
diff --git a/examples/itemviews/customsortfiltermodel/window.h b/examples/itemviews/customsortfiltermodel/window.h
index 15baffc2c6..50ec1f413c 100644
--- a/examples/itemviews/customsortfiltermodel/window.h
+++ b/examples/itemviews/customsortfiltermodel/window.h
@@ -72,8 +72,14 @@ private slots:
private:
MySortFilterProxyModel *proxyModel;
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5 ) || defined(Q_WS_SIMULATOR)
+ QWidget *sourceWidget;
+ QWidget *filterWidget;
+ QWidget *proxyWidget;
+#else
QGroupBox *sourceGroupBox;
QGroupBox *proxyGroupBox;
+#endif
QTreeView *sourceView;
QTreeView *proxyView;
QCheckBox *filterCaseSensitivityCheckBox;
diff --git a/examples/itemviews/dirview/dirview.desktop b/examples/itemviews/dirview/dirview.desktop
new file mode 100644
index 0000000000..51ec4df26c
--- /dev/null
+++ b/examples/itemviews/dirview/dirview.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Dir View
+Exec=/opt/usr/bin/dirview
+Icon=dirview
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/dirview/dirview.pro b/examples/itemviews/dirview/dirview.pro
index 31970009bb..b0ee17fcad 100644
--- a/examples/itemviews/dirview/dirview.pro
+++ b/examples/itemviews/dirview/dirview.pro
@@ -7,3 +7,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/dirview
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/dirview/main.cpp b/examples/itemviews/dirview/main.cpp
index ffa287b321..3500d7bef8 100644
--- a/examples/itemviews/dirview/main.cpp
+++ b/examples/itemviews/dirview/main.cpp
@@ -55,8 +55,12 @@ int main(int argc, char *argv[])
tree.setSortingEnabled(true);
tree.setWindowTitle(QObject::tr("Dir View"));
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ tree.showMaximized();
+#else
tree.resize(640, 480);
tree.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/editabletreemodel/editabletreemodel.desktop b/examples/itemviews/editabletreemodel/editabletreemodel.desktop
new file mode 100644
index 0000000000..17d17330df
--- /dev/null
+++ b/examples/itemviews/editabletreemodel/editabletreemodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Editable Tree Model
+Exec=/opt/usr/bin/editabletreemodel
+Icon=editabletreemodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/editabletreemodel/editabletreemodel.pro b/examples/itemviews/editabletreemodel/editabletreemodel.pro
index d9ce8039cd..941bee67b2 100644
--- a/examples/itemviews/editabletreemodel/editabletreemodel.pro
+++ b/examples/itemviews/editabletreemodel/editabletreemodel.pro
@@ -16,3 +16,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/editabletreemodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/editabletreemodel/main.cpp b/examples/itemviews/editabletreemodel/main.cpp
index b6e6b0277d..d8b3b9bcf8 100644
--- a/examples/itemviews/editabletreemodel/main.cpp
+++ b/examples/itemviews/editabletreemodel/main.cpp
@@ -48,6 +48,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/editabletreemodel/mainwindow.cpp b/examples/itemviews/editabletreemodel/mainwindow.cpp
index 6f08ced0e9..486a9ad1c6 100644
--- a/examples/itemviews/editabletreemodel/mainwindow.cpp
+++ b/examples/itemviews/editabletreemodel/mainwindow.cpp
@@ -48,6 +48,11 @@ MainWindow::MainWindow(QWidget *parent)
{
setupUi(this);
+#ifdef Q_WS_MAEMO_5
+ // Alternating row colors look bad on Maemo
+ view->setAlternatingRowColors(false);
+#endif
+
QStringList headers;
headers << tr("Title") << tr("Description");
diff --git a/examples/itemviews/fetchmore/fetchmore.desktop b/examples/itemviews/fetchmore/fetchmore.desktop
new file mode 100644
index 0000000000..b8c9ff32cb
--- /dev/null
+++ b/examples/itemviews/fetchmore/fetchmore.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Fetch More
+Exec=/opt/usr/bin/fetchmore
+Icon=fetchmore
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/fetchmore/fetchmore.pro b/examples/itemviews/fetchmore/fetchmore.pro
index dcb84ed39d..f620fba9f9 100644
--- a/examples/itemviews/fetchmore/fetchmore.pro
+++ b/examples/itemviews/fetchmore/fetchmore.pro
@@ -10,3 +10,5 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/fetchmore
INSTALLS += target sources
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/itemviews/fetchmore/main.cpp b/examples/itemviews/fetchmore/main.cpp
index aedfd9f8d3..c2deca3ff1 100644
--- a/examples/itemviews/fetchmore/main.cpp
+++ b/examples/itemviews/fetchmore/main.cpp
@@ -45,6 +45,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/frozencolumn/frozencolumn.desktop b/examples/itemviews/frozencolumn/frozencolumn.desktop
new file mode 100644
index 0000000000..3d1e3b430d
--- /dev/null
+++ b/examples/itemviews/frozencolumn/frozencolumn.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Frozen Column
+Exec=/opt/usr/bin/frozencolumn
+Icon=frozencolumn
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/frozencolumn/frozencolumn.pro b/examples/itemviews/frozencolumn/frozencolumn.pro
index 361de5be3d..c79c7cc1ae 100644
--- a/examples/itemviews/frozencolumn/frozencolumn.pro
+++ b/examples/itemviews/frozencolumn/frozencolumn.pro
@@ -7,3 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/frozencolumn
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/frozencolumn
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/itemviews/frozencolumn/main.cpp b/examples/itemviews/frozencolumn/main.cpp
index f6aa489d05..79f8ad4abe 100644
--- a/examples/itemviews/frozencolumn/main.cpp
+++ b/examples/itemviews/frozencolumn/main.cpp
@@ -81,8 +81,14 @@ int main( int argc, char** argv )
FreezeTableWidget *tableView = new FreezeTableWidget(model);
tableView->setWindowTitle(QObject::tr("Frozen Column Example"));
+#if defined(Q_OS_SYMBIAN)
+ tableView->showMaximized();
+#elif defined(Q_WS_MAEMO_5)
+ tableView->show();
+#else
tableView->resize(560,680);
tableView->show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/itemviews.pro b/examples/itemviews/itemviews.pro
index 56eeee1380..137599ca65 100644
--- a/examples/itemviews/itemviews.pro
+++ b/examples/itemviews/itemviews.pro
@@ -2,7 +2,6 @@ TEMPLATE = subdirs
SUBDIRS = addressbook \
basicsortfiltermodel \
chart \
- coloreditorfactory \
combowidgetmapper \
customsortfiltermodel \
dirview \
@@ -14,16 +13,10 @@ SUBDIRS = addressbook \
simpledommodel \
simpletreemodel \
simplewidgetmapper \
- spinboxdelegate \
- stardelegate
-
-symbian: SUBDIRS = \
- addressbook \
- chart
+ spinboxdelegate
# install
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/itemviews/pixelator/main.cpp b/examples/itemviews/pixelator/main.cpp
index e7f45e3f42..0324b3a3b2 100644
--- a/examples/itemviews/pixelator/main.cpp
+++ b/examples/itemviews/pixelator/main.cpp
@@ -48,7 +48,11 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
window.openImage(":/images/qt.png");
return app.exec();
}
diff --git a/examples/itemviews/pixelator/pixelator.desktop b/examples/itemviews/pixelator/pixelator.desktop
new file mode 100644
index 0000000000..751deb13b3
--- /dev/null
+++ b/examples/itemviews/pixelator/pixelator.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Pixelator
+Exec=/opt/usr/bin/pixelator
+Icon=pixelator
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/pixelator/pixelator.pro b/examples/itemviews/pixelator/pixelator.pro
index a41d906a95..60ed7ba2a1 100644
--- a/examples/itemviews/pixelator/pixelator.pro
+++ b/examples/itemviews/pixelator/pixelator.pro
@@ -14,3 +14,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/pixelator
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/pixelator/pixeldelegate.cpp b/examples/itemviews/pixelator/pixeldelegate.cpp
index 9ec88e614c..2c026e1a98 100644
--- a/examples/itemviews/pixelator/pixeldelegate.cpp
+++ b/examples/itemviews/pixelator/pixeldelegate.cpp
@@ -80,7 +80,7 @@ void PixelDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
painter->setBrush(option.palette.highlightedText());
else
//! [2]
- painter->setBrush(QBrush(Qt::black));
+ painter->setBrush(option.palette.text());
//! [9]
//! [10]
diff --git a/examples/itemviews/puzzle/main.cpp b/examples/itemviews/puzzle/main.cpp
index 60341948ab..bdba2874f3 100644
--- a/examples/itemviews/puzzle/main.cpp
+++ b/examples/itemviews/puzzle/main.cpp
@@ -49,6 +49,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
window.openImage(":/images/example.jpg");
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/puzzle/mainwindow.cpp b/examples/itemviews/puzzle/mainwindow.cpp
index 4d6da116bf..6fd5d63987 100644
--- a/examples/itemviews/puzzle/mainwindow.cpp
+++ b/examples/itemviews/puzzle/mainwindow.cpp
@@ -50,7 +50,7 @@ MainWindow::MainWindow(QWidget *parent)
{
setupMenus();
setupWidgets();
- model = new PiecesModel(this);
+ model = new PiecesModel(puzzleWidget->pieceSize(), this);
piecesList->setModel(model);
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
@@ -92,8 +92,8 @@ void MainWindow::setupPuzzle()
{
int size = qMin(puzzleImage.width(), puzzleImage.height());
puzzleImage = puzzleImage.copy((puzzleImage.width() - size)/2,
- (puzzleImage.height() - size)/2, size, size).scaled(400,
- 400, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ (puzzleImage.height() - size)/2, size, size).scaled(puzzleWidget->imageSize(),
+ puzzleWidget->imageSize(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
qsrand(QCursor::pos().x() ^ QCursor::pos().y());
@@ -125,21 +125,25 @@ void MainWindow::setupWidgets()
QFrame *frame = new QFrame;
QHBoxLayout *frameLayout = new QHBoxLayout(frame);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ puzzleWidget = new PuzzleWidget(260);
+#else
+ puzzleWidget = new PuzzleWidget(400);
+#endif
+
piecesList = new QListView;
piecesList->setDragEnabled(true);
piecesList->setViewMode(QListView::IconMode);
- piecesList->setIconSize(QSize(60, 60));
- piecesList->setGridSize(QSize(80, 80));
+ piecesList->setIconSize(QSize(puzzleWidget->pieceSize() - 20, puzzleWidget->pieceSize() - 20));
+ piecesList->setGridSize(QSize(puzzleWidget->pieceSize(), puzzleWidget->pieceSize()));
piecesList->setSpacing(10);
piecesList->setMovement(QListView::Snap);
piecesList->setAcceptDrops(true);
piecesList->setDropIndicatorShown(true);
- PiecesModel *model = new PiecesModel(this);
+ PiecesModel *model = new PiecesModel(puzzleWidget->pieceSize(), this);
piecesList->setModel(model);
- puzzleWidget = new PuzzleWidget;
-
connect(puzzleWidget, SIGNAL(puzzleCompleted()),
this, SLOT(setCompleted()), Qt::QueuedConnection);
diff --git a/examples/itemviews/puzzle/piecesmodel.cpp b/examples/itemviews/puzzle/piecesmodel.cpp
index 4235050d9d..520b571f0a 100644
--- a/examples/itemviews/puzzle/piecesmodel.cpp
+++ b/examples/itemviews/puzzle/piecesmodel.cpp
@@ -42,8 +42,8 @@
#include "piecesmodel.h"
-PiecesModel::PiecesModel(QObject *parent)
- : QAbstractListModel(parent)
+PiecesModel::PiecesModel(int pieceSize, QObject *parent)
+ : QAbstractListModel(parent), m_PieceSize(pieceSize)
{
}
@@ -53,7 +53,7 @@ QVariant PiecesModel::data(const QModelIndex &index, int role) const
return QVariant();
if (role == Qt::DecorationRole)
- return QIcon(pixmaps.value(index.row()).scaled(60, 60,
+ return QIcon(pixmaps.value(index.row()).scaled(m_PieceSize, m_PieceSize,
Qt::KeepAspectRatio, Qt::SmoothTransformation));
else if (role == Qt::UserRole)
return pixmaps.value(index.row());
@@ -196,7 +196,7 @@ void PiecesModel::addPieces(const QPixmap& pixmap)
endRemoveRows();
for (int y = 0; y < 5; ++y) {
for (int x = 0; x < 5; ++x) {
- QPixmap pieceImage = pixmap.copy(x*80, y*80, 80, 80);
+ QPixmap pieceImage = pixmap.copy(x*m_PieceSize, y*m_PieceSize, m_PieceSize, m_PieceSize);
addPiece(pieceImage, QPoint(x, y));
}
}
diff --git a/examples/itemviews/puzzle/piecesmodel.h b/examples/itemviews/puzzle/piecesmodel.h
index 30bbdf83b2..40079fe1c1 100644
--- a/examples/itemviews/puzzle/piecesmodel.h
+++ b/examples/itemviews/puzzle/piecesmodel.h
@@ -56,7 +56,7 @@ class PiecesModel : public QAbstractListModel
Q_OBJECT
public:
- PiecesModel(QObject *parent = 0);
+ PiecesModel(int pieceSize, QObject *parent = 0);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
@@ -75,6 +75,8 @@ public:
private:
QList<QPoint> locations;
QList<QPixmap> pixmaps;
+
+ int m_PieceSize;
};
#endif
diff --git a/examples/itemviews/puzzle/puzzle.desktop b/examples/itemviews/puzzle/puzzle.desktop
new file mode 100644
index 0000000000..d493e7dd41
--- /dev/null
+++ b/examples/itemviews/puzzle/puzzle.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Item Views Puzzle
+Exec=/opt/usr/bin/puzzle
+Icon=puzzle
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro
index b1c490a2b9..dd900df7cf 100644
--- a/examples/itemviews/puzzle/puzzle.pro
+++ b/examples/itemviews/puzzle/puzzle.pro
@@ -19,3 +19,5 @@ wince* {
DEPLOYMENT_PLUGIN += qjpeg qgif qtiff
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/puzzle/puzzlewidget.cpp b/examples/itemviews/puzzle/puzzlewidget.cpp
index a0d769d20a..261e0080a2 100644
--- a/examples/itemviews/puzzle/puzzlewidget.cpp
+++ b/examples/itemviews/puzzle/puzzlewidget.cpp
@@ -42,12 +42,12 @@
#include "puzzlewidget.h"
-PuzzleWidget::PuzzleWidget(QWidget *parent)
- : QWidget(parent)
+PuzzleWidget::PuzzleWidget(int imageSize, QWidget *parent)
+ : QWidget(parent), m_ImageSize(imageSize)
{
setAcceptDrops(true);
- setMinimumSize(400, 400);
- setMaximumSize(400, 400);
+ setMinimumSize(m_ImageSize, m_ImageSize);
+ setMaximumSize(m_ImageSize, m_ImageSize);
}
void PuzzleWidget::clear()
@@ -116,7 +116,7 @@ void PuzzleWidget::dropEvent(QDropEvent *event)
event->setDropAction(Qt::MoveAction);
event->accept();
- if (location == QPoint(square.x()/80, square.y()/80)) {
+ if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize())) {
inPlace++;
if (inPlace == 25)
emit puzzleCompleted();
@@ -151,7 +151,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
piecePixmaps.removeAt(found);
pieceRects.removeAt(found);
- if (location == QPoint(square.x()/80, square.y()/80))
+ if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize()))
inPlace--;
update(square);
@@ -175,7 +175,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
pieceRects.insert(found, square);
update(targetSquare(event->pos()));
- if (location == QPoint(square.x()/80, square.y()/80))
+ if (location == QPoint(square.x()/pieceSize(), square.y()/pieceSize()))
inPlace++;
}
}
@@ -200,5 +200,15 @@ void PuzzleWidget::paintEvent(QPaintEvent *event)
const QRect PuzzleWidget::targetSquare(const QPoint &position) const
{
- return QRect(position.x()/80 * 80, position.y()/80 * 80, 80, 80);
+ return QRect(position.x()/pieceSize() * pieceSize(), position.y()/pieceSize() * pieceSize(), pieceSize(), pieceSize());
+}
+
+int PuzzleWidget::pieceSize() const
+{
+ return m_ImageSize / 5;
+}
+
+int PuzzleWidget::imageSize() const
+{
+ return m_ImageSize;
}
diff --git a/examples/itemviews/puzzle/puzzlewidget.h b/examples/itemviews/puzzle/puzzlewidget.h
index e0356b48fd..2cc789c292 100644
--- a/examples/itemviews/puzzle/puzzlewidget.h
+++ b/examples/itemviews/puzzle/puzzlewidget.h
@@ -57,9 +57,12 @@ class PuzzleWidget : public QWidget
Q_OBJECT
public:
- PuzzleWidget(QWidget *parent = 0);
+ PuzzleWidget(int imageSize, QWidget *parent = 0);
void clear();
+ int pieceSize() const;
+ int imageSize() const;
+
signals:
void puzzleCompleted();
@@ -80,6 +83,7 @@ private:
QList<QPoint> pieceLocations;
QRect highlightedRect;
int inPlace;
+ int m_ImageSize;
};
#endif
diff --git a/examples/itemviews/simpledommodel/main.cpp b/examples/itemviews/simpledommodel/main.cpp
index 74a14b0f8c..94496f88bb 100644
--- a/examples/itemviews/simpledommodel/main.cpp
+++ b/examples/itemviews/simpledommodel/main.cpp
@@ -46,7 +46,13 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#elif defined(Q_WS_MAEMO_5)
+ window.show();
+#else
window.resize(640, 480);
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/simpledommodel/simpledommodel.desktop b/examples/itemviews/simpledommodel/simpledommodel.desktop
new file mode 100644
index 0000000000..a53b896848
--- /dev/null
+++ b/examples/itemviews/simpledommodel/simpledommodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple DOM Model
+Exec=/opt/usr/bin/simpledommodel
+Icon=simpledommodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/simpledommodel/simpledommodel.pro b/examples/itemviews/simpledommodel/simpledommodel.pro
index c0c4b1d69e..2022dada11 100644
--- a/examples/itemviews/simpledommodel/simpledommodel.pro
+++ b/examples/itemviews/simpledommodel/simpledommodel.pro
@@ -15,3 +15,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpledommodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/simpletreemodel/main.cpp b/examples/itemviews/simpletreemodel/main.cpp
index b14b52498b..6401695d00 100644
--- a/examples/itemviews/simpletreemodel/main.cpp
+++ b/examples/itemviews/simpletreemodel/main.cpp
@@ -56,6 +56,10 @@ int main(int argc, char *argv[])
QTreeView view;
view.setModel(&model);
view.setWindowTitle(QObject::tr("Simple Tree Model"));
+#if defined(Q_OS_SYMBIAN)
+ view.showMaximized();
+#else
view.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/simpletreemodel/simpletreemodel.desktop b/examples/itemviews/simpletreemodel/simpletreemodel.desktop
new file mode 100644
index 0000000000..361202f5c0
--- /dev/null
+++ b/examples/itemviews/simpletreemodel/simpletreemodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple Tree Model
+Exec=/opt/usr/bin/simpletreemodel
+Icon=simpletreemodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/simpletreemodel/simpletreemodel.pro b/examples/itemviews/simpletreemodel/simpletreemodel.pro
index 4f0e7c44c9..20de83592d 100644
--- a/examples/itemviews/simpletreemodel/simpletreemodel.pro
+++ b/examples/itemviews/simpletreemodel/simpletreemodel.pro
@@ -13,3 +13,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpletreemodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/simplewidgetmapper/main.cpp b/examples/itemviews/simplewidgetmapper/main.cpp
index 41e756d8ad..9e45edefac 100644
--- a/examples/itemviews/simplewidgetmapper/main.cpp
+++ b/examples/itemviews/simplewidgetmapper/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.desktop b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.desktop
new file mode 100644
index 0000000000..6b09a236da
--- /dev/null
+++ b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple Widget Mapper
+Exec=/opt/usr/bin/simplewidgetmapper
+Icon=simplewidgetmapper
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
index 67eaf11a9f..ca3945e04b 100644
--- a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
+++ b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simplewidgetmapper
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/itemviews/spinboxdelegate/main.cpp b/examples/itemviews/spinboxdelegate/main.cpp
index e078d7f2df..50d2ef1323 100644
--- a/examples/itemviews/spinboxdelegate/main.cpp
+++ b/examples/itemviews/spinboxdelegate/main.cpp
@@ -80,7 +80,11 @@ int main(int argc, char *argv[])
//! [3]
tableView.setWindowTitle(QObject::tr("Spin Box Delegate"));
+#if defined(Q_OS_SYMBIAN)
+ tableView.showMaximized();
+#else
tableView.show();
+#endif
return app.exec();
}
//! [3]
diff --git a/examples/itemviews/spinboxdelegate/spinboxdelegate.desktop b/examples/itemviews/spinboxdelegate/spinboxdelegate.desktop
new file mode 100644
index 0000000000..347e408e96
--- /dev/null
+++ b/examples/itemviews/spinboxdelegate/spinboxdelegate.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Spin Box Delegate
+Exec=/opt/usr/bin/spinboxdelegate
+Icon=spinboxdelegate
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
index 42e957b4b2..df36781c04 100644
--- a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
+++ b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/spinboxdelegate
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/itemviews/stardelegate/main.cpp b/examples/itemviews/stardelegate/main.cpp
index 1af54d0d84..4f5c86164e 100644
--- a/examples/itemviews/stardelegate/main.cpp
+++ b/examples/itemviews/stardelegate/main.cpp
@@ -100,7 +100,11 @@ int main(int argc, char *argv[])
tableWidget.resizeColumnsToContents();
tableWidget.resize(500, 300);
+#if defined(Q_OS_SYMBIAN)
+ tableWidget.showMaximized();
+#else
tableWidget.show();
+#endif
return app.exec();
}
diff --git a/examples/itemviews/stardelegate/stardelegate.desktop b/examples/itemviews/stardelegate/stardelegate.desktop
new file mode 100644
index 0000000000..d508c3b286
--- /dev/null
+++ b/examples/itemviews/stardelegate/stardelegate.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Star Delegate
+Exec=/opt/usr/bin/stardelegate
+Icon=stardelegate
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/itemviews/stardelegate/stardelegate.pro b/examples/itemviews/stardelegate/stardelegate.pro
index 5b5c10b692..50ef5cf472 100644
--- a/examples/itemviews/stardelegate/stardelegate.pro
+++ b/examples/itemviews/stardelegate/stardelegate.pro
@@ -13,4 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/stardelegate
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/ja_JP/linguist/hellotr/hellotr.pro b/examples/ja_JP/linguist/hellotr/hellotr.pro
index 3846bfb4da..b14d8478e6 100644
--- a/examples/ja_JP/linguist/hellotr/hellotr.pro
+++ b/examples/ja_JP/linguist/hellotr/hellotr.pro
@@ -11,3 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/layouts/basiclayouts/basiclayouts.desktop b/examples/layouts/basiclayouts/basiclayouts.desktop
new file mode 100644
index 0000000000..6c612eed09
--- /dev/null
+++ b/examples/layouts/basiclayouts/basiclayouts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Basic Layouts
+Exec=/opt/usr/bin/basiclayouts
+Icon=basiclayouts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/layouts/basiclayouts/basiclayouts.pro b/examples/layouts/basiclayouts/basiclayouts.pro
index 95e6ec4f06..a08417a719 100644
--- a/examples/layouts/basiclayouts/basiclayouts.pro
+++ b/examples/layouts/basiclayouts/basiclayouts.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/basiclayouts
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/layouts/basiclayouts/main.cpp b/examples/layouts/basiclayouts/main.cpp
index 8aa11f488d..6b6077546f 100644
--- a/examples/layouts/basiclayouts/main.cpp
+++ b/examples/layouts/basiclayouts/main.cpp
@@ -46,5 +46,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
- return dialog.exec();
+#if defined(Q_OS_SYMBIAN)
+ dialog.showMaximized();
+#else
+ dialog.show();
+#endif
+
+ return app.exec();
}
diff --git a/examples/layouts/borderlayout/borderlayout.desktop b/examples/layouts/borderlayout/borderlayout.desktop
new file mode 100644
index 0000000000..3fd0641f1c
--- /dev/null
+++ b/examples/layouts/borderlayout/borderlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Border Layout
+Exec=/opt/usr/bin/borderlayout
+Icon=borderlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/layouts/borderlayout/borderlayout.pro b/examples/layouts/borderlayout/borderlayout.pro
index e7214d9ecd..cd36a0b9c6 100644
--- a/examples/layouts/borderlayout/borderlayout.pro
+++ b/examples/layouts/borderlayout/borderlayout.pro
@@ -11,3 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/borderlayout
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/layouts/borderlayout/main.cpp b/examples/layouts/borderlayout/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/layouts/borderlayout/main.cpp
+++ b/examples/layouts/borderlayout/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/layouts/dynamiclayouts/dialog.cpp b/examples/layouts/dynamiclayouts/dialog.cpp
index 58711bee7f..690e52b8fa 100644
--- a/examples/layouts/dynamiclayouts/dialog.cpp
+++ b/examples/layouts/dynamiclayouts/dialog.cpp
@@ -43,7 +43,11 @@
#include "dialog.h"
Dialog::Dialog(QWidget *parent)
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ : QWidget(parent)
+#else
: QDialog(parent)
+#endif
{
createRotableGroupBox();
createOptionsGroupBox();
diff --git a/examples/layouts/dynamiclayouts/dialog.h b/examples/layouts/dynamiclayouts/dialog.h
index 9409be1b57..3ada992858 100644
--- a/examples/layouts/dynamiclayouts/dialog.h
+++ b/examples/layouts/dynamiclayouts/dialog.h
@@ -41,6 +41,7 @@
#ifndef DIALOG_H
#define DIALOG_H
+#include <QMainWindow>
#include <QDialog>
#include <QQueue>
@@ -53,7 +54,11 @@ class QLabel;
class QPushButton;
QT_END_NAMESPACE
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+class Dialog : public QWidget
+#else
class Dialog : public QDialog
+#endif
{
Q_OBJECT
diff --git a/examples/layouts/dynamiclayouts/dynamiclayouts.desktop b/examples/layouts/dynamiclayouts/dynamiclayouts.desktop
new file mode 100644
index 0000000000..482286bfb8
--- /dev/null
+++ b/examples/layouts/dynamiclayouts/dynamiclayouts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Dynamic Layouts
+Exec=/opt/usr/bin/dynamiclayouts
+Icon=dynamiclayouts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/layouts/dynamiclayouts/dynamiclayouts.pro b/examples/layouts/dynamiclayouts/dynamiclayouts.pro
index 58e6d794fc..5460282b60 100644
--- a/examples/layouts/dynamiclayouts/dynamiclayouts.pro
+++ b/examples/layouts/dynamiclayouts/dynamiclayouts.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/dynamiclayouts
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/layouts/dynamiclayouts/main.cpp b/examples/layouts/dynamiclayouts/main.cpp
index 8aa11f488d..c30db12bb5 100644
--- a/examples/layouts/dynamiclayouts/main.cpp
+++ b/examples/layouts/dynamiclayouts/main.cpp
@@ -46,5 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
- return dialog.exec();
+#if defined(Q_OS_SYMBIAN)
+ dialog.showMaximized();
+#else
+ dialog.show();
+#endif
+ return app.exec();
}
diff --git a/examples/layouts/flowlayout/flowlayout.desktop b/examples/layouts/flowlayout/flowlayout.desktop
new file mode 100644
index 0000000000..54ea3b0290
--- /dev/null
+++ b/examples/layouts/flowlayout/flowlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Flow Layout
+Exec=/opt/usr/bin/flowlayout
+Icon=flowlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/layouts/flowlayout/flowlayout.pro b/examples/layouts/flowlayout/flowlayout.pro
index 40ff447a23..703729715b 100644
--- a/examples/layouts/flowlayout/flowlayout.pro
+++ b/examples/layouts/flowlayout/flowlayout.pro
@@ -11,3 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/flowlayout
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/layouts/flowlayout/main.cpp b/examples/layouts/flowlayout/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/layouts/flowlayout/main.cpp
+++ b/examples/layouts/flowlayout/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/layouts/flowlayout/window.cpp b/examples/layouts/flowlayout/window.cpp
index 51f09a8b83..0c7eb73101 100644
--- a/examples/layouts/flowlayout/window.cpp
+++ b/examples/layouts/flowlayout/window.cpp
@@ -56,4 +56,4 @@ Window::Window()
setWindowTitle(tr("Flow Layout"));
}
-//! [1] \ No newline at end of file
+//! [1]
diff --git a/examples/layouts/layouts.pro b/examples/layouts/layouts.pro
index d84e721c3d..7eac91653a 100644
--- a/examples/layouts/layouts.pro
+++ b/examples/layouts/layouts.pro
@@ -9,4 +9,3 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/linguist/arrowpad/arrowpad.desktop b/examples/linguist/arrowpad/arrowpad.desktop
new file mode 100644
index 0000000000..a498296468
--- /dev/null
+++ b/examples/linguist/arrowpad/arrowpad.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Arrow Pad
+Exec=/opt/usr/bin/arrowpad
+Icon=arrowpad
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/linguist/arrowpad/arrowpad.pro b/examples/linguist/arrowpad/arrowpad.pro
index 0a463d34ff..af7d816251 100644
--- a/examples/linguist/arrowpad/arrowpad.pro
+++ b/examples/linguist/arrowpad/arrowpad.pro
@@ -16,3 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/linguist/hellotr/hellotr.desktop b/examples/linguist/hellotr/hellotr.desktop
new file mode 100644
index 0000000000..0d916b07e0
--- /dev/null
+++ b/examples/linguist/hellotr/hellotr.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Hello tr()
+Exec=/opt/usr/bin/hellotr
+Icon=hellotr
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/linguist/hellotr/hellotr.pro b/examples/linguist/hellotr/hellotr.pro
index 7a930ff258..aaf2cd5e20 100644
--- a/examples/linguist/hellotr/hellotr.pro
+++ b/examples/linguist/hellotr/hellotr.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/linguist/linguist.pro b/examples/linguist/linguist.pro
index 2b7515af1c..92dc4c4b0f 100644
--- a/examples/linguist/linguist.pro
+++ b/examples/linguist/linguist.pro
@@ -8,4 +8,3 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/linguist/trollprint/trollprint.desktop b/examples/linguist/trollprint/trollprint.desktop
new file mode 100644
index 0000000000..7690bc2cec
--- /dev/null
+++ b/examples/linguist/trollprint/trollprint.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Troll Print
+Exec=/opt/usr/bin/trollprint
+Icon=trollprint
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/linguist/trollprint/trollprint.pro b/examples/linguist/trollprint/trollprint.pro
index 0ec64b017e..bbda534b3d 100644
--- a/examples/linguist/trollprint/trollprint.pro
+++ b/examples/linguist/trollprint/trollprint.pro
@@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/maemo5pkgrules.pri b/examples/maemo5pkgrules.pri
new file mode 100644
index 0000000000..18cc1a7fd5
--- /dev/null
+++ b/examples/maemo5pkgrules.pri
@@ -0,0 +1,27 @@
+!maemo5: error(Only include this file for Maemo5 platforms)
+
+PREFIX = /opt/usr
+BINDIR = $$PREFIX/bin
+DATADIR = $$PREFIX/share
+
+provide_icon.commands = "$$QMAKE_COPY \"$$PWD/qt.png\" \"$$OUT_PWD/$${TARGET}.png\""
+QMAKE_EXTRA_TARGETS += provide_icon
+CLEANFILES += $$OUT_PWD/$${TARGET}.png
+
+icon.CONFIG += no_check_exist
+icon.files = $$OUT_PWD/$${TARGET}.png
+icon.path = /usr/share/icons/hicolor/64x64/apps/
+icon.depends = provide_icon
+
+desktopfile.path = /usr/share/applications/hildon
+desktopfile.files = $${TARGET}.desktop
+
+DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+ PKGDATADIR=\\\"$$PKGDATADIR\\\"
+
+target.path = $$BINDIR
+
+INSTALLS += desktopfile icon
+
+# Don't install sources on the embedded target
+INSTALLS -= sources
diff --git a/examples/mainwindows/application/application.desktop b/examples/mainwindows/application/application.desktop
new file mode 100644
index 0000000000..b6fab1f1fe
--- /dev/null
+++ b/examples/mainwindows/application/application.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Application
+Exec=/opt/usr/bin/application
+Icon=application
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/mainwindows/application/application.pro b/examples/mainwindows/application/application.pro
index 0851f72912..9b4a2a97b3 100644
--- a/examples/mainwindows/application/application.pro
+++ b/examples/mainwindows/application/application.pro
@@ -12,3 +12,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/application
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/mainwindows/application/main.cpp b/examples/mainwindows/application/main.cpp
index 9a9dc9ca76..14c7af2bb3 100644
--- a/examples/mainwindows/application/main.cpp
+++ b/examples/mainwindows/application/main.cpp
@@ -51,7 +51,11 @@ int main(int argc, char *argv[])
app.setOrganizationName("Trolltech");
app.setApplicationName("Application Example");
MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showMaximized();
+#else
mainWin.show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/mainwindows/dockwidgets/dockwidgets.desktop b/examples/mainwindows/dockwidgets/dockwidgets.desktop
new file mode 100644
index 0000000000..1f57cb613b
--- /dev/null
+++ b/examples/mainwindows/dockwidgets/dockwidgets.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Dock Widgets
+Exec=/opt/usr/bin/dockwidgets
+Icon=dockwidgets
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/mainwindows/dockwidgets/dockwidgets.pro b/examples/mainwindows/dockwidgets/dockwidgets.pro
index a19658774c..20cd07a5ba 100644
--- a/examples/mainwindows/dockwidgets/dockwidgets.pro
+++ b/examples/mainwindows/dockwidgets/dockwidgets.pro
@@ -10,3 +10,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/mainwindows/mainwindows.pro b/examples/mainwindows/mainwindows.pro
index 661b741526..0b9b299f04 100644
--- a/examples/mainwindows/mainwindows.pro
+++ b/examples/mainwindows/mainwindows.pro
@@ -1,19 +1,13 @@
TEMPLATE = subdirs
SUBDIRS = application \
- dockwidgets \
mdi \
menus \
recentfiles \
sdi
-symbian: SUBDIRS = \
- menus
-
-
# install
target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mainwindows.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/mainwindows/mdi/main.cpp b/examples/mainwindows/mdi/main.cpp
index 1a10a19619..4e21e75159 100644
--- a/examples/mainwindows/mdi/main.cpp
+++ b/examples/mainwindows/mdi/main.cpp
@@ -48,6 +48,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showMaximized();
+#else
mainWin.show();
+#endif
return app.exec();
}
diff --git a/examples/mainwindows/mdi/mdi.desktop b/examples/mainwindows/mdi/mdi.desktop
new file mode 100644
index 0000000000..267e6f19d0
--- /dev/null
+++ b/examples/mainwindows/mdi/mdi.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=MDI
+Exec=/opt/usr/bin/mdi
+Icon=mdi
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/mainwindows/mdi/mdi.pro b/examples/mainwindows/mdi/mdi.pro
index 8d859b096f..90c103a15d 100644
--- a/examples/mainwindows/mdi/mdi.pro
+++ b/examples/mainwindows/mdi/mdi.pro
@@ -12,3 +12,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/mdi
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/mainwindows/menus/main.cpp b/examples/mainwindows/menus/main.cpp
index 01c8adae53..dffe80348a 100644
--- a/examples/mainwindows/menus/main.cpp
+++ b/examples/mainwindows/menus/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/mainwindows/menus/mainwindow.cpp b/examples/mainwindows/menus/mainwindow.cpp
index cae81f6b71..99f1ddcfbf 100644
--- a/examples/mainwindows/menus/mainwindow.cpp
+++ b/examples/mainwindows/menus/mainwindow.cpp
@@ -53,8 +53,12 @@ MainWindow::MainWindow()
QWidget *topFiller = new QWidget;
topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+#ifdef Q_OS_SYMBIAN
+ infoLabel = new QLabel(tr("<i>Choose a menu option</i>"));
+#else
infoLabel = new QLabel(tr("<i>Choose a menu option, or right-click to "
"invoke a context menu</i>"));
+#endif
infoLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
infoLabel->setAlignment(Qt::AlignCenter);
@@ -73,8 +77,10 @@ MainWindow::MainWindow()
createActions();
createMenus();
+#ifndef Q_OS_SYMBIAN
QString message = tr("A context menu is available by right-clicking");
statusBar()->showMessage(message);
+#endif
setWindowTitle(tr("Menus"));
setMinimumSize(160, 160);
diff --git a/examples/mainwindows/menus/menus.desktop b/examples/mainwindows/menus/menus.desktop
new file mode 100644
index 0000000000..dc2bda92af
--- /dev/null
+++ b/examples/mainwindows/menus/menus.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Menus
+Exec=/opt/usr/bin/menus
+Icon=menus
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro
index 7ca442ef85..28eed5c892 100644
--- a/examples/mainwindows/menus/menus.pro
+++ b/examples/mainwindows/menus/menus.pro
@@ -12,3 +12,6 @@ symbian {
TARGET.UID3 = 0xA000CF66
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/mainwindows/recentfiles/main.cpp b/examples/mainwindows/recentfiles/main.cpp
index 3bbf0137c1..37891b3983 100644
--- a/examples/mainwindows/recentfiles/main.cpp
+++ b/examples/mainwindows/recentfiles/main.cpp
@@ -48,6 +48,10 @@ int main(int argc, char *argv[])
app.setOrganizationName("Trolltech");
app.setApplicationName("Recent Files Example");
MainWindow *mainWin = new MainWindow;
+#if defined(Q_OS_SYMBIAN)
+ mainWin->showMaximized();
+#else
mainWin->show();
+#endif
return app.exec();
}
diff --git a/examples/mainwindows/recentfiles/recentfiles.desktop b/examples/mainwindows/recentfiles/recentfiles.desktop
new file mode 100644
index 0000000000..c314cf7f7c
--- /dev/null
+++ b/examples/mainwindows/recentfiles/recentfiles.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Recent Files
+Exec=/opt/usr/bin/recentfiles
+Icon=recentfiles
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/mainwindows/recentfiles/recentfiles.pro b/examples/mainwindows/recentfiles/recentfiles.pro
index 9724b77c2d..65c0c219d5 100644
--- a/examples/mainwindows/recentfiles/recentfiles.pro
+++ b/examples/mainwindows/recentfiles/recentfiles.pro
@@ -9,3 +9,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/recentfiles
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/mainwindows/sdi/main.cpp b/examples/mainwindows/sdi/main.cpp
index 0fb8a0388d..ae3586cffc 100644
--- a/examples/mainwindows/sdi/main.cpp
+++ b/examples/mainwindows/sdi/main.cpp
@@ -49,6 +49,10 @@ int main(int argc, char *argv[])
app.setApplicationName("SDI Example");
app.setOrganizationName("Trolltech");
MainWindow *mainWin = new MainWindow;
+#if defined(Q_OS_SYMBIAN)
+ mainWin->showMaximized();
+#else
mainWin->show();
+#endif
return app.exec();
}
diff --git a/examples/mainwindows/sdi/sdi.desktop b/examples/mainwindows/sdi/sdi.desktop
new file mode 100644
index 0000000000..06d7289c8b
--- /dev/null
+++ b/examples/mainwindows/sdi/sdi.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=SDI
+Exec=/opt/usr/bin/sdi
+Icon=sdi
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/mainwindows/sdi/sdi.pro b/examples/mainwindows/sdi/sdi.pro
index 5707c41b4d..040b722d1f 100644
--- a/examples/mainwindows/sdi/sdi.pro
+++ b/examples/mainwindows/sdi/sdi.pro
@@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/sdi
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp
index 8af6ce74e8..fcc433fb31 100644
--- a/examples/multimedia/audiodevices/audiodevices.cpp
+++ b/examples/multimedia/audiodevices/audiodevices.cpp
@@ -47,7 +47,7 @@
QString toString(QAudioFormat::SampleType sampleType)
{
- QString result("Unknown");
+ QString result;
switch (sampleType) {
case QAudioFormat::SignedInt:
result = "SignedInt";
@@ -58,7 +58,9 @@ QString toString(QAudioFormat::SampleType sampleType)
case QAudioFormat::Float:
result = "Float";
break;
+ default:
case QAudioFormat::Unknown:
+ result = "Unknown";
break;
}
return result;
diff --git a/examples/multimedia/audiodevices/audiodevices.desktop b/examples/multimedia/audiodevices/audiodevices.desktop
new file mode 100644
index 0000000000..ffff4b4f5e
--- /dev/null
+++ b/examples/multimedia/audiodevices/audiodevices.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Audio Devices
+Exec=/opt/usr/bin/audiodevices
+Icon=audiodevices
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/multimedia/audiodevices/audiodevices.pro b/examples/multimedia/audiodevices/audiodevices.pro
index 1cb4679ebb..c12866408c 100644
--- a/examples/multimedia/audiodevices/audiodevices.pro
+++ b/examples/multimedia/audiodevices/audiodevices.pro
@@ -15,3 +15,5 @@ symbian {
TARGET.UID3 = 0xA000D7BE
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/multimedia/audioinput/audioinput.desktop b/examples/multimedia/audioinput/audioinput.desktop
new file mode 100644
index 0000000000..0f1571e5b1
--- /dev/null
+++ b/examples/multimedia/audioinput/audioinput.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=AudioInput
+Exec=/opt/usr/bin/audioinput
+Icon=audioinput
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/multimedia/audioinput/audioinput.pro b/examples/multimedia/audioinput/audioinput.pro
index 6a1c79dfff..01b97d316c 100644
--- a/examples/multimedia/audioinput/audioinput.pro
+++ b/examples/multimedia/audioinput/audioinput.pro
@@ -15,3 +15,6 @@ symbian {
TARGET.CAPABILITY += UserEnvironment
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/multimedia/audioinput/main.cpp b/examples/multimedia/audioinput/main.cpp
index dd25f62f87..bdae9986df 100644
--- a/examples/multimedia/audioinput/main.cpp
+++ b/examples/multimedia/audioinput/main.cpp
@@ -48,7 +48,11 @@ int main(int argv, char **args)
app.setApplicationName("Audio Input Test");
InputTest input;
+#if defined(Q_OS_SYMBIAN)
+ input.showMaximized();
+#else
input.show();
+#endif
return app.exec();
}
diff --git a/examples/multimedia/audiooutput/audiooutput.desktop b/examples/multimedia/audiooutput/audiooutput.desktop
new file mode 100644
index 0000000000..147633fd14
--- /dev/null
+++ b/examples/multimedia/audiooutput/audiooutput.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Audio Output
+Exec=/opt/usr/bin/audiooutput
+Icon=audiooutput
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/multimedia/audiooutput/audiooutput.pro b/examples/multimedia/audiooutput/audiooutput.pro
index 26f68fe3b2..3c473ad9df 100644
--- a/examples/multimedia/audiooutput/audiooutput.pro
+++ b/examples/multimedia/audiooutput/audiooutput.pro
@@ -14,3 +14,5 @@ symbian {
TARGET.UID3 = 0xA000D7C0
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/multimedia/audiooutput/main.cpp b/examples/multimedia/audiooutput/main.cpp
index 389a35d6c2..8492f81bfc 100644
--- a/examples/multimedia/audiooutput/main.cpp
+++ b/examples/multimedia/audiooutput/main.cpp
@@ -49,7 +49,11 @@ int main(int argv, char **args)
app.setApplicationName("Audio Output Test");
AudioTest audio;
+#if defined(Q_OS_SYMBIAN)
+ audio.showMaximized();
+#else
audio.show();
+#endif
return app.exec();
}
diff --git a/examples/multimedia/videographicsitem/videographicsitem.desktop b/examples/multimedia/videographicsitem/videographicsitem.desktop
new file mode 100644
index 0000000000..8d5d087bb8
--- /dev/null
+++ b/examples/multimedia/videographicsitem/videographicsitem.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Video Graphics Item
+Exec=/opt/usr/bin/videographicsitem
+Icon=videographicsitem
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/multimedia/videographicsitem/videographicsitem.pro b/examples/multimedia/videographicsitem/videographicsitem.pro
index 7c118ccd60..46e1066b9a 100644
--- a/examples/multimedia/videographicsitem/videographicsitem.pro
+++ b/examples/multimedia/videographicsitem/videographicsitem.pro
@@ -19,3 +19,6 @@ symbian {
TARGET.UID3 = 0xA000D7C2
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
diff --git a/examples/multimedia/videowidget/videowidget.desktop b/examples/multimedia/videowidget/videowidget.desktop
new file mode 100644
index 0000000000..9bc183dafd
--- /dev/null
+++ b/examples/multimedia/videowidget/videowidget.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Video Widget
+Exec=/opt/usr/bin/videowidget
+Icon=videowidget
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/multimedia/videowidget/videowidget.pro b/examples/multimedia/videowidget/videowidget.pro
index 3f93745584..6e6e613599 100644
--- a/examples/multimedia/videowidget/videowidget.pro
+++ b/examples/multimedia/videowidget/videowidget.pro
@@ -23,3 +23,6 @@ symbian {
TARGET.UID3 = 0xA000D7C3
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
diff --git a/examples/network/bearercloud/bearercloud.desktop b/examples/network/bearercloud/bearercloud.desktop
new file mode 100644
index 0000000000..4e494e0475
--- /dev/null
+++ b/examples/network/bearercloud/bearercloud.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Bearer Cloud
+Exec=/opt/usr/bin/bearercloud
+Icon=bearercloud
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/bearercloud/bearercloud.pro b/examples/network/bearercloud/bearercloud.pro
index c07626a341..ff3f917cb3 100644
--- a/examples/network/bearercloud/bearercloud.pro
+++ b/examples/network/bearercloud/bearercloud.pro
@@ -13,4 +13,10 @@ QT = core gui network svg
CONFIG += console
-symbian:TARGET.CAPABILITY = NetworkServices ReadUserData
+symbian: {
+ TARGET.CAPABILITY = NetworkServices ReadUserData
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 942b19ce01..43ae8e9027 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -63,7 +63,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
delete tabWidget->currentWidget();
sessionGroup->hide();
#endif
-#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI)
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) || defined(Q_WS_SIMULATOR)
setWindowState(Qt::WindowMaximized);
#endif
updateConfigurations();
@@ -87,7 +87,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
this, SLOT(configurationChanged(const QNetworkConfiguration)));
connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
connect(unregisterButton, SIGNAL(clicked()), this, SLOT(unregisterNetwork()));
#else
@@ -226,7 +226,7 @@ void BearerMonitor::updateConfigurations()
if (defaultConfiguration.type() == QNetworkConfiguration::ServiceNetwork)
updateSnapConfiguration(defaultItem, defaultConfiguration);
- } else if (defaultConfiguration.isValid()) {
+ } else {
configurationAdded(defaultConfiguration);
}
@@ -260,7 +260,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline)
onlineState->setText(tr("Offline"));
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
void BearerMonitor::registerNetwork()
{
QTreeWidgetItem *item = treeWidget->currentItem();
diff --git a/examples/network/bearermonitor/bearermonitor.desktop b/examples/network/bearermonitor/bearermonitor.desktop
new file mode 100644
index 0000000000..14f1094d17
--- /dev/null
+++ b/examples/network/bearermonitor/bearermonitor.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Bearer Monitor
+Exec=/opt/usr/bin/bearermonitor
+Icon=bearermonitor
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h
index a06522fafa..f4dbf81dee 100644
--- a/examples/network/bearermonitor/bearermonitor.h
+++ b/examples/network/bearermonitor/bearermonitor.h
@@ -43,7 +43,7 @@
#include <qnetworkconfigmanager.h>
#include <qnetworksession.h>
-#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
+#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_SIMULATOR)
#include "ui_bearermonitor_240_320.h"
#elif defined(MAEMO_UI)
#include "ui_bearermonitor_maemo.h"
@@ -72,7 +72,7 @@ private slots:
void onlineStateChanged(bool isOnline);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_WS_SIMULATOR)
void registerNetwork();
void unregisterNetwork();
#endif
diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro
index bd9bd68e5c..a91f064f3e 100644
--- a/examples/network/bearermonitor/bearermonitor.pro
+++ b/examples/network/bearermonitor/bearermonitor.pro
@@ -23,4 +23,11 @@ wince*:LIBS += -lws2
CONFIG += console
-symbian:TARGET.CAPABILITY = NetworkServices ReadUserData
+symbian: {
+ TARGET.CAPABILITY = NetworkServices ReadUserData
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/network/blockingfortuneclient/blockingclient.cpp b/examples/network/blockingfortuneclient/blockingclient.cpp
index f5def3d927..bd2fb829a9 100644
--- a/examples/network/blockingfortuneclient/blockingclient.cpp
+++ b/examples/network/blockingfortuneclient/blockingclient.cpp
@@ -44,7 +44,7 @@
#include "blockingclient.h"
BlockingClient::BlockingClient(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
hostLabel = new QLabel(tr("&Server name:"));
portLabel = new QLabel(tr("S&erver port:"));
@@ -68,12 +68,35 @@ BlockingClient::BlockingClient(QWidget *parent)
portLineEdit = new QLineEdit;
portLineEdit->setValidator(new QIntValidator(1, 65535, this));
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ Qt::InputMethodHint hints = Qt::ImhDigitsOnly;
+ portLineEdit->setInputMethodHints(hints);
+#endif
+
hostLabel->setBuddy(hostLineEdit);
portLabel->setBuddy(portLineEdit);
statusLabel = new QLabel(tr("This examples requires that you run the "
"Fortune Server example as well."));
+ statusLabel->setWordWrap(true);
+
+#ifdef Q_OS_SYMBIAN
+ QMenu *menu = new QMenu(this);
+ fortuneAction = menu->addAction(tr("Get Fortune"));
+ fortuneAction->setVisible(false);
+
+ QAction *optionsAction = new QAction(tr("Options"), this);
+ optionsAction->setMenu(menu);
+ optionsAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ addAction(optionsAction);
+
+ exitAction = new QAction(tr("Exit"), this);
+ exitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(exitAction);
+ connect(fortuneAction, SIGNAL(triggered()), this, SLOT(requestNewFortune()));
+ connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
+#else
getFortuneButton = new QPushButton(tr("Get Fortune"));
getFortuneButton->setDefault(true);
getFortuneButton->setEnabled(false);
@@ -84,13 +107,14 @@ BlockingClient::BlockingClient(QWidget *parent)
buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
+ connect(getFortuneButton, SIGNAL(clicked()), this, SLOT(requestNewFortune()));
+ connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+#endif
+
connect(hostLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableGetFortuneButton()));
connect(portLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableGetFortuneButton()));
- connect(getFortuneButton, SIGNAL(clicked()),
- this, SLOT(requestNewFortune()));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
//! [0]
connect(&thread, SIGNAL(newFortune(QString)),
this, SLOT(showFortune(QString)));
@@ -105,7 +129,9 @@ BlockingClient::BlockingClient(QWidget *parent)
mainLayout->addWidget(portLabel, 1, 0);
mainLayout->addWidget(portLineEdit, 1, 1);
mainLayout->addWidget(statusLabel, 2, 0, 1, 2);
+#ifndef Q_OS_SYMBIAN
mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
+#endif
setLayout(mainLayout);
setWindowTitle(tr("Blocking Fortune Client"));
@@ -115,7 +141,11 @@ BlockingClient::BlockingClient(QWidget *parent)
//! [2]
void BlockingClient::requestNewFortune()
{
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(false);
+#else
getFortuneButton->setEnabled(false);
+#endif
thread.requestNewFortune(hostLineEdit->text(),
portLineEdit->text().toInt());
}
@@ -133,7 +163,11 @@ void BlockingClient::showFortune(const QString &nextFortune)
//! [4]
currentFortune = nextFortune;
statusLabel->setText(currentFortune);
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(true);
+#else
getFortuneButton->setEnabled(true);
+#endif
}
//! [4]
@@ -158,11 +192,19 @@ void BlockingClient::displayError(int socketError, const QString &message)
.arg(message));
}
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(true);
+#else
getFortuneButton->setEnabled(true);
+#endif
}
void BlockingClient::enableGetFortuneButton()
{
- getFortuneButton->setEnabled(!hostLineEdit->text().isEmpty()
- && !portLineEdit->text().isEmpty());
+ bool enable(!hostLineEdit->text().isEmpty() && !portLineEdit->text().isEmpty());
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(enable);
+#else
+ getFortuneButton->setEnabled(enable);
+#endif
}
diff --git a/examples/network/blockingfortuneclient/blockingclient.h b/examples/network/blockingfortuneclient/blockingclient.h
index 8b76fa6596..83ff93b228 100644
--- a/examples/network/blockingfortuneclient/blockingclient.h
+++ b/examples/network/blockingfortuneclient/blockingclient.h
@@ -41,7 +41,7 @@
#ifndef BLOCKINGCLIENT_H
#define BLOCKINGCLIENT_H
-#include <QDialog>
+#include <QWidget>
#include "fortunethread.h"
@@ -50,10 +50,11 @@ class QDialogButtonBox;
class QLabel;
class QLineEdit;
class QPushButton;
+class QAction;
QT_END_NAMESPACE
//! [0]
-class BlockingClient : public QDialog
+class BlockingClient : public QWidget
{
Q_OBJECT
@@ -72,9 +73,14 @@ private:
QLineEdit *hostLineEdit;
QLineEdit *portLineEdit;
QLabel *statusLabel;
+#ifdef Q_OS_SYMBIAN
+ QAction *fortuneAction;
+ QAction *exitAction;
+#else
QPushButton *getFortuneButton;
QPushButton *quitButton;
QDialogButtonBox *buttonBox;
+#endif
FortuneThread thread;
QString currentFortune;
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.desktop b/examples/network/blockingfortuneclient/blockingfortuneclient.desktop
new file mode 100644
index 0000000000..87b13092ae
--- /dev/null
+++ b/examples/network/blockingfortuneclient/blockingfortuneclient.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Blocking Fortune Client
+Exec=/opt/usr/bin/blockingfortuneclient
+Icon=blockingfortuneclient
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
index 5840d300a2..c6a6b501cc 100644
--- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro
+++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
@@ -11,4 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pr
sources.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/network/blockingfortuneclient/main.cpp b/examples/network/blockingfortuneclient/main.cpp
index d1ff1659af..97ce59fdb3 100644
--- a/examples/network/blockingfortuneclient/main.cpp
+++ b/examples/network/blockingfortuneclient/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
BlockingClient client;
+#ifdef Q_OS_SYMBIAN
+ client.showMaximized();
+#else
client.show();
- return client.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/broadcastreceiver/broadcastreceiver.desktop b/examples/network/broadcastreceiver/broadcastreceiver.desktop
new file mode 100644
index 0000000000..29072ed8b1
--- /dev/null
+++ b/examples/network/broadcastreceiver/broadcastreceiver.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Broadcast Receiver
+Exec=/opt/usr/bin/broadcastreceiver
+Icon=broadcastreceiver
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro
index 0778f96284..7819109fcc 100644
--- a/examples/network/broadcastreceiver/broadcastreceiver.pro
+++ b/examples/network/broadcastreceiver/broadcastreceiver.pro
@@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/network/broadcastreceiver/main.cpp b/examples/network/broadcastreceiver/main.cpp
index 041163178d..80d0bba869 100644
--- a/examples/network/broadcastreceiver/main.cpp
+++ b/examples/network/broadcastreceiver/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Receiver receiver;
+#ifdef Q_OS_SYMBIAN
+ receiver.showMaximized();
+#else
receiver.show();
- return receiver.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/broadcastreceiver/receiver.cpp b/examples/network/broadcastreceiver/receiver.cpp
index bd45a3cb35..04feffbc80 100644
--- a/examples/network/broadcastreceiver/receiver.cpp
+++ b/examples/network/broadcastreceiver/receiver.cpp
@@ -44,10 +44,18 @@
#include "receiver.h"
Receiver::Receiver(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
statusLabel = new QLabel(tr("Listening for broadcasted messages"));
+ statusLabel->setWordWrap(true);
+
+#ifdef Q_OS_SYMBIAN
+ quitAction = new QAction(tr("Exit"), this);
+ quitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(quitAction);
+#else
quitButton = new QPushButton(tr("&Quit"));
+#endif
//! [0]
udpSocket = new QUdpSocket(this);
@@ -58,6 +66,13 @@ Receiver::Receiver(QWidget *parent)
connect(udpSocket, SIGNAL(readyRead()),
this, SLOT(processPendingDatagrams()));
//! [1]
+#ifdef Q_OS_SYMBIAN
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(statusLabel);
+ setLayout(mainLayout);
+#else
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
QHBoxLayout *buttonLayout = new QHBoxLayout;
@@ -69,6 +84,7 @@ Receiver::Receiver(QWidget *parent)
mainLayout->addWidget(statusLabel);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
+#endif
setWindowTitle(tr("Broadcast Receiver"));
}
diff --git a/examples/network/broadcastreceiver/receiver.h b/examples/network/broadcastreceiver/receiver.h
index 80b35a5571..3084da1e26 100644
--- a/examples/network/broadcastreceiver/receiver.h
+++ b/examples/network/broadcastreceiver/receiver.h
@@ -41,15 +41,16 @@
#ifndef RECEIVER_H
#define RECEIVER_H
-#include <QDialog>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QLabel;
class QPushButton;
class QUdpSocket;
+class QAction;
QT_END_NAMESPACE
-class Receiver : public QDialog
+class Receiver : public QWidget
{
Q_OBJECT
@@ -61,7 +62,11 @@ private slots:
private:
QLabel *statusLabel;
+#ifdef Q_OS_SYMBIAN
+ QAction *quitAction;
+#else
QPushButton *quitButton;
+#endif
QUdpSocket *udpSocket;
};
diff --git a/examples/network/broadcastsender/broadcastsender.desktop b/examples/network/broadcastsender/broadcastsender.desktop
new file mode 100644
index 0000000000..2690a15e66
--- /dev/null
+++ b/examples/network/broadcastsender/broadcastsender.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Broadcast Sender
+Exec=/opt/usr/bin/broadcastsender
+Icon=broadcastsender
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro
index 6415706ec9..ef2d0cc93e 100644
--- a/examples/network/broadcastsender/broadcastsender.pro
+++ b/examples/network/broadcastsender/broadcastsender.pro
@@ -9,4 +9,9 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/network/broadcastsender/main.cpp b/examples/network/broadcastsender/main.cpp
index 56e35c9540..88be21d2d8 100644
--- a/examples/network/broadcastsender/main.cpp
+++ b/examples/network/broadcastsender/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Sender sender;
+#ifdef Q_OS_SYMBIAN
+ sender.showMaximized();
+#else
sender.show();
- return sender.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/broadcastsender/sender.cpp b/examples/network/broadcastsender/sender.cpp
index d753094637..7ce877d586 100644
--- a/examples/network/broadcastsender/sender.cpp
+++ b/examples/network/broadcastsender/sender.cpp
@@ -44,9 +44,10 @@
#include "sender.h"
Sender::Sender(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
statusLabel = new QLabel(tr("Ready to broadcast datagrams on port 45454"));
+ statusLabel->setWordWrap(true);
startButton = new QPushButton(tr("&Start"));
quitButton = new QPushButton(tr("&Quit"));
diff --git a/examples/network/broadcastsender/sender.h b/examples/network/broadcastsender/sender.h
index d592051efd..666269f38e 100644
--- a/examples/network/broadcastsender/sender.h
+++ b/examples/network/broadcastsender/sender.h
@@ -41,7 +41,7 @@
#ifndef SENDER_H
#define SENDER_H
-#include <QDialog>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QDialogButtonBox;
@@ -51,7 +51,7 @@ class QTimer;
class QUdpSocket;
QT_END_NAMESPACE
-class Sender : public QDialog
+class Sender : public QWidget
{
Q_OBJECT
diff --git a/examples/network/download/download.desktop b/examples/network/download/download.desktop
new file mode 100644
index 0000000000..8dbdfe872f
--- /dev/null
+++ b/examples/network/download/download.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Network Download
+Exec=/opt/usr/bin/download
+Icon=download
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro
index 432998d23a..8b8b26fcb8 100644
--- a/examples/network/download/download.pro
+++ b/examples/network/download/download.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
@@ -19,3 +18,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/download
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/network/downloadmanager/downloadmanager.desktop b/examples/network/downloadmanager/downloadmanager.desktop
new file mode 100644
index 0000000000..d046340c6f
--- /dev/null
+++ b/examples/network/downloadmanager/downloadmanager.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Network Download Manager
+Exec=/opt/usr/bin/downloadmanager
+Icon=downloadmanager
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro
index 8d91cf00e2..024ee2adc8 100644
--- a/examples/network/downloadmanager/downloadmanager.pro
+++ b/examples/network/downloadmanager/downloadmanager.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
@@ -20,3 +19,14 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+OTHER_FILES += \
+ debian/changelog \
+ debian/compat \
+ debian/control \
+ debian/copyright \
+ debian/README \
+ debian/rules
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/network/fortuneclient/fortuneclient.desktop b/examples/network/fortuneclient/fortuneclient.desktop
new file mode 100644
index 0000000000..dc801ed026
--- /dev/null
+++ b/examples/network/fortuneclient/fortuneclient.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Fortune Client
+Exec=/opt/usr/bin/fortuneclient
+Icon=fortuneclient
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro
index f79679d6ac..c6ad332c81 100644
--- a/examples/network/fortuneclient/fortuneclient.pro
+++ b/examples/network/fortuneclient/fortuneclient.pro
@@ -14,3 +14,8 @@ symbian {
TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/network/fortuneserver/fortuneserver.desktop b/examples/network/fortuneserver/fortuneserver.desktop
new file mode 100644
index 0000000000..8c936e8b9e
--- /dev/null
+++ b/examples/network/fortuneserver/fortuneserver.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Fortune Server
+Exec=/opt/usr/bin/fortuneserver
+Icon=fortuneserver
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index 0ef3e97be9..6da1f926e4 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -15,3 +15,8 @@ symbian {
TARGET.CAPABILITY = "NetworkServices ReadUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/network/googlesuggest/googlesuggest.desktop b/examples/network/googlesuggest/googlesuggest.desktop
new file mode 100644
index 0000000000..5034e2398c
--- /dev/null
+++ b/examples/network/googlesuggest/googlesuggest.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Google Suggest
+Exec=/opt/usr/bin/googlesuggest
+Icon=googlesuggest
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro
index 33b79de5e4..e6fb579b82 100644
--- a/examples/network/googlesuggest/googlesuggest.pro
+++ b/examples/network/googlesuggest/googlesuggest.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/network/http/http.desktop b/examples/network/http/http.desktop
new file mode 100644
index 0000000000..ce35e51947
--- /dev/null
+++ b/examples/network/http/http.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=HTTP
+Exec=/opt/usr/bin/http
+Icon=http
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro
index 2b702ea798..dc035c114a 100644
--- a/examples/network/http/http.pro
+++ b/examples/network/http/http.pro
@@ -10,4 +10,9 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/http
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index 874994ab92..6497a33508 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -45,7 +45,11 @@
#include "ui_authenticationdialog.h"
HttpWindow::HttpWindow(QWidget *parent)
+#ifdef Q_WS_MAEMO_5
+ : QWidget(parent)
+#else
: QDialog(parent)
+#endif
{
#ifndef QT_NO_OPENSSL
urlLineEdit = new QLineEdit("https://qt.nokia.com/");
@@ -57,6 +61,7 @@ HttpWindow::HttpWindow(QWidget *parent)
urlLabel->setBuddy(urlLineEdit);
statusLabel = new QLabel(tr("Please enter the URL of a file you want to "
"download."));
+ statusLabel->setWordWrap(true);
downloadButton = new QPushButton(tr("Download"));
downloadButton->setDefault(true);
@@ -67,7 +72,9 @@ HttpWindow::HttpWindow(QWidget *parent)
buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
+#ifndef Q_WS_MAEMO_5
progressDialog = new QProgressDialog(this);
+#endif
connect(urlLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableDownloadButton()));
@@ -78,7 +85,9 @@ HttpWindow::HttpWindow(QWidget *parent)
connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
+#ifndef Q_WS_MAEMO_5
connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
+#endif
connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
@@ -117,7 +126,7 @@ void HttpWindow::downloadFile()
fileName = "index.html";
if (QFile::exists(fileName)) {
- if (QMessageBox::question(this, tr("HTTP"),
+ if (QMessageBox::question(this, tr("HTTP"),
tr("There already exists a file called %1 in "
"the current directory. Overwrite?").arg(fileName),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No)
@@ -136,9 +145,10 @@ void HttpWindow::downloadFile()
return;
}
-
+#ifndef Q_WS_MAEMO_5
progressDialog->setWindowTitle(tr("HTTP"));
progressDialog->setLabelText(tr("Downloading %1.").arg(fileName));
+#endif
downloadButton->setEnabled(false);
// schedule the request
@@ -164,11 +174,15 @@ void HttpWindow::httpFinished()
file = 0;
}
reply->deleteLater();
+#ifndef Q_WS_MAEMO_5
progressDialog->hide();
+#endif
return;
}
+#ifndef Q_WS_MAEMO_5
progressDialog->hide();
+#endif
file->flush();
file->close();
@@ -194,7 +208,7 @@ void HttpWindow::httpFinished()
}
} else {
QString fileName = QFileInfo(QUrl(urlLineEdit->text()).path()).fileName();
- statusLabel->setText(tr("Downloaded %1 to current directory.").arg(fileName));
+ statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath()));
downloadButton->setEnabled(true);
}
@@ -219,8 +233,13 @@ void HttpWindow::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
if (httpRequestAborted)
return;
+#ifndef Q_WS_MAEMO_5
progressDialog->setMaximum(totalBytes);
progressDialog->setValue(bytesRead);
+#else
+ Q_UNUSED(bytesRead);
+ Q_UNUSED(totalBytes);
+#endif
}
void HttpWindow::enableDownloadButton()
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index 0ec87af48a..8bbe1a261a 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -41,7 +41,11 @@
#ifndef HTTPWINDOW_H
#define HTTPWINDOW_H
+#ifdef Q_WS_MAEMO_5
+#include <QWidget>
+#else
#include <QDialog>
+#endif
#include <QNetworkAccessManager>
#include <QUrl>
@@ -59,7 +63,11 @@ class QNetworkReply;
QT_END_NAMESPACE
+#ifdef Q_WS_MAEMO_5
+class HttpWindow : public QWidget
+#else
class HttpWindow : public QDialog
+#endif
{
Q_OBJECT
@@ -84,7 +92,9 @@ private:
QLabel *statusLabel;
QLabel *urlLabel;
QLineEdit *urlLineEdit;
+#ifndef Q_WS_MAEMO_5
QProgressDialog *progressDialog;
+#endif
QPushButton *downloadButton;
QPushButton *quitButton;
QDialogButtonBox *buttonBox;
diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp
index 4c4f61c775..e4f157476c 100644
--- a/examples/network/http/main.cpp
+++ b/examples/network/http/main.cpp
@@ -39,13 +39,28 @@
****************************************************************************/
#include <QApplication>
+#include <QDir>
#include "httpwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+
+#if defined(Q_OS_SYMBIAN)
+ // Change current directory from default private to c:\data
+ // in order that user can access the downloaded content
+ QDir::setCurrent("c:\\data");
+#elif defined(Q_WS_MAEMO_5)
+ QDir::setCurrent("/home/user");
+#endif
+
HttpWindow httpWin;
+
+#if defined(Q_OS_SYMBIAN)
+ httpWin.showMaximized();
+#else
httpWin.show();
- return httpWin.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp
index 50a191e9ee..14154b47cc 100644
--- a/examples/network/loopback/dialog.cpp
+++ b/examples/network/loopback/dialog.cpp
@@ -58,6 +58,22 @@ Dialog::Dialog(QWidget *parent)
serverProgressBar = new QProgressBar;
serverStatusLabel = new QLabel(tr("Server ready"));
+#ifdef Q_OS_SYMBIAN
+ QMenu *menu = new QMenu(this);
+
+ QAction *optionsAction = new QAction(tr("Options"), this);
+ optionsAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ optionsAction->setMenu(menu);
+ addAction(optionsAction);
+
+ startAction = menu->addAction(tr("Start"), this, SLOT(start()));
+
+ quitAction = new QAction(tr("Exit"), this);
+ quitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(quitAction);
+
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+#else
startButton = new QPushButton(tr("&Start"));
quitButton = new QPushButton(tr("&Quit"));
@@ -67,6 +83,7 @@ Dialog::Dialog(QWidget *parent)
connect(startButton, SIGNAL(clicked()), this, SLOT(start()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+#endif
connect(&tcpServer, SIGNAL(newConnection()),
this, SLOT(acceptConnection()));
connect(&tcpClient, SIGNAL(connected()), this, SLOT(startTransfer()));
@@ -82,7 +99,9 @@ Dialog::Dialog(QWidget *parent)
mainLayout->addWidget(serverStatusLabel);
mainLayout->addStretch(1);
mainLayout->addSpacing(10);
+#ifndef Q_OS_SYMBIAN
mainLayout->addWidget(buttonBox);
+#endif
setLayout(mainLayout);
setWindowTitle(tr("Loopback"));
@@ -90,7 +109,11 @@ Dialog::Dialog(QWidget *parent)
void Dialog::start()
{
+#ifdef Q_OS_SYMBIAN
+ startAction->setVisible(false);
+#else
startButton->setEnabled(false);
+#endif
#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
@@ -146,7 +169,11 @@ void Dialog::updateServerProgress()
if (bytesReceived == TotalBytes) {
tcpServerConnection->close();
+#ifdef Q_OS_SYMBIAN
+ startAction->setVisible(true);
+#else
startButton->setEnabled(true);
+#endif
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
@@ -183,7 +210,11 @@ void Dialog::displayError(QAbstractSocket::SocketError socketError)
serverProgressBar->reset();
clientStatusLabel->setText(tr("Client ready"));
serverStatusLabel->setText(tr("Server ready"));
+#ifdef Q_OS_SYMBIAN
+ startAction->setVisible(true);
+#else
startButton->setEnabled(true);
+#endif
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
diff --git a/examples/network/loopback/dialog.h b/examples/network/loopback/dialog.h
index 09b4366e19..b48c090d3f 100644
--- a/examples/network/loopback/dialog.h
+++ b/examples/network/loopback/dialog.h
@@ -52,6 +52,7 @@ class QProgressBar;
class QPushButton;
class QTcpServer;
class QTcpSocket;
+class QAction;
QT_END_NAMESPACE
class Dialog : public QDialog
@@ -74,9 +75,15 @@ private:
QProgressBar *serverProgressBar;
QLabel *clientStatusLabel;
QLabel *serverStatusLabel;
+
+#ifdef Q_OS_SYMBIAN
+ QAction *startAction;
+ QAction *quitAction;
+#else
QPushButton *startButton;
QPushButton *quitButton;
QDialogButtonBox *buttonBox;
+#endif
QTcpServer tcpServer;
QTcpSocket tcpClient;
diff --git a/examples/network/loopback/loopback.desktop b/examples/network/loopback/loopback.desktop
new file mode 100644
index 0000000000..ee982153c4
--- /dev/null
+++ b/examples/network/loopback/loopback.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Loopback
+Exec=/opt/usr/bin/loopback
+Icon=loopback
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro
index cf6a0f384c..a696a6f8b8 100644
--- a/examples/network/loopback/loopback.pro
+++ b/examples/network/loopback/loopback.pro
@@ -9,4 +9,9 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/loopback
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/network/loopback/main.cpp b/examples/network/loopback/main.cpp
index 6810b795fc..7f26fd4357 100644
--- a/examples/network/loopback/main.cpp
+++ b/examples/network/loopback/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
+#ifdef Q_OS_SYMBIAN
+ dialog.showMaximized();
+#else
dialog.show();
- return dialog.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/network-chat/network-chat.desktop b/examples/network/network-chat/network-chat.desktop
new file mode 100644
index 0000000000..ba3eeb36c5
--- /dev/null
+++ b/examples/network/network-chat/network-chat.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Network Chat
+Exec=/opt/usr/bin/network-chat
+Icon=network-chat
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index b3d429ef5b..c4f0d0e5ac 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -24,3 +24,7 @@ symbian {
TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 0012a978b3..28c57ec3ab 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -38,4 +38,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/network
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp
index 159cad621b..c0a2b73428 100644
--- a/examples/network/qftp/ftpwindow.cpp
+++ b/examples/network/qftp/ftpwindow.cpp
@@ -51,7 +51,7 @@ FtpWindow::FtpWindow(QWidget *parent)
ftpServerLabel->setBuddy(ftpServerLineEdit);
statusLabel = new QLabel(tr("Please enter the name of an FTP server."));
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
// Use word wrapping to fit the text on screen
statusLabel->setWordWrap( true );
#endif
diff --git a/examples/network/qftp/qftp.desktop b/examples/network/qftp/qftp.desktop
new file mode 100644
index 0000000000..6149fe96df
--- /dev/null
+++ b/examples/network/qftp/qftp.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=FTP
+Exec=/opt/usr/bin/qftp
+Icon=qftp
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro
index 232e8ebd78..39683653fd 100644
--- a/examples/network/qftp/qftp.pro
+++ b/examples/network/qftp/qftp.pro
@@ -16,3 +16,7 @@ symbian {
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData"
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp
index ff3a4d2f3c..b1a9acb0b2 100644
--- a/examples/network/securesocketclient/certificateinfo.cpp
+++ b/examples/network/securesocketclient/certificateinfo.cpp
@@ -47,7 +47,7 @@ CertificateInfo::CertificateInfo(QWidget *parent)
form = new Ui_CertificateInfo;
form->setupUi(this);
- connect(form->certificationPathView, SIGNAL(currentRowChanged(int)),
+ connect(form->certificationPathView, SIGNAL(currentIndexChanged(int)),
this, SLOT(updateCertificateInfo(int)));
}
@@ -69,7 +69,7 @@ void CertificateInfo::setCertificateChain(const QList<QSslCertificate> &chain)
.arg(cert.subjectInfo(QSslCertificate::CommonName)));
}
- form->certificationPathView->setCurrentRow(0);
+ form->certificationPathView->setCurrentIndex(0);
}
void CertificateInfo::updateCertificateInfo(int index)
diff --git a/examples/network/securesocketclient/certificateinfo.ui b/examples/network/securesocketclient/certificateinfo.ui
index 3761fe8f50..c5238eb3e1 100644
--- a/examples/network/securesocketclient/certificateinfo.ui
+++ b/examples/network/securesocketclient/certificateinfo.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>CertificateInfo</class>
- <widget class="QDialog" name="CertificateInfo" >
- <property name="geometry" >
+ <widget class="QDialog" name="CertificateInfo">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,42 +10,57 @@
<height>397</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Display Certificate Information</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
<item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Certification Path</string>
</property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QListWidget" name="certificationPathView" />
- </item>
- </layout>
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="title" >
+ <widget class="QComboBox" name="certificationPathView">
+ <property name="minimumContentsLength">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Certificate Information</string>
</property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QListWidget" name="certificateInfoView" />
- </item>
- </layout>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" >
+ <widget class="QListWidget" name="certificateInfoView">
+ <property name="font">
+ <font>
+ <pointsize>8</pointsize>
+ </font>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -53,8 +69,8 @@
</spacer>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="standardButtons" >
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
@@ -71,11 +87,11 @@
<receiver>CertificateInfo</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>343</x>
<y>374</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>352</x>
<y>422</y>
</hint>
diff --git a/examples/network/securesocketclient/main.cpp b/examples/network/securesocketclient/main.cpp
index c15534b523..ca50f31dcf 100644
--- a/examples/network/securesocketclient/main.cpp
+++ b/examples/network/securesocketclient/main.cpp
@@ -56,7 +56,11 @@ int main(int argc, char **argv)
}
SslClient client;
+#ifdef Q_OS_SYMBIAN
+ client.showMaximized();
+#else
client.show();
+#endif
return app.exec();
}
diff --git a/examples/network/securesocketclient/securesocketclient.desktop b/examples/network/securesocketclient/securesocketclient.desktop
new file mode 100644
index 0000000000..8335b27e33
--- /dev/null
+++ b/examples/network/securesocketclient/securesocketclient.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Secure Socket Client
+Exec=/opt/usr/bin/securesocketclient
+Icon=securesocketclient
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index ff4f458752..78302b1166 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -18,4 +18,7 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF67
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index 43b81cd984..11e6ffd537 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -82,7 +82,6 @@ void SslClient::updateEnabledState()
form->connectButton->setEnabled(unconnected && !form->hostNameEdit->text().isEmpty());
bool connected = socket && socket->state() == QAbstractSocket::ConnectedState;
- form->sessionBox->setEnabled(connected);
form->sessionOutput->setEnabled(connected);
form->sessionInput->setEnabled(connected);
form->sessionInputLabel->setEnabled(connected);
@@ -193,6 +192,9 @@ void SslClient::sslErrors(const QList<QSslError> &errors)
ui.sslErrorList->addItem(error.errorString());
executingDialog = true;
+#ifdef Q_OS_SYMBIAN
+ errorDialog.showMaximized();
+#endif
if (errorDialog.exec() == QDialog::Accepted)
socket->ignoreSslErrors();
executingDialog = false;
@@ -206,6 +208,9 @@ void SslClient::displayCertificateInfo()
{
CertificateInfo *info = new CertificateInfo(this);
info->setCertificateChain(socket->peerCertificateChain());
+#ifdef Q_OS_SYMBIAN
+ info->showMaximized();
+#endif
info->exec();
info->deleteLater();
}
diff --git a/examples/network/securesocketclient/sslclient.ui b/examples/network/securesocketclient/sslclient.ui
index 5a24751168..4b81fe46eb 100644
--- a/examples/network/securesocketclient/sslclient.ui
+++ b/examples/network/securesocketclient/sslclient.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>Form</class>
- <widget class="QWidget" name="Form" >
- <property name="geometry" >
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,147 +10,149 @@
<height>320</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Secure Socket Client</string>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="hostNameLabel" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="hostNameLabel">
+ <property name="text">
<string>Host name:</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="hostNameEdit" >
- <property name="text" >
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="hostNameEdit">
+ <property name="text">
<string>imap.example.com</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="portLabel" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="portLabel">
+ <property name="text">
<string>Port:</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="portBox" >
- <property name="minimum" >
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="portBox">
+ <property name="minimum">
<number>1</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>65535</number>
</property>
- <property name="value" >
+ <property name="value">
<number>993</number>
</property>
</widget>
</item>
</layout>
</item>
- <item>
- <widget class="QPushButton" name="connectButton" >
- <property name="enabled" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Active session</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="connectButton">
+ <property name="enabled">
<bool>true</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Connect to host</string>
</property>
- <property name="default" >
+ <property name="default">
<bool>true</bool>
</property>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="sessionBox" >
- <property name="enabled" >
+ <item row="2" column="0" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="cipherText">
+ <property name="text">
+ <string>Cryptographic Cipher:</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="cipherLabel">
+ <property name="text">
+ <string>&lt;none&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QTextEdit" name="sessionOutput">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="title" >
- <string>Active session</string>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="cipherText" >
- <property name="text" >
- <string>Cryptographic Cipher:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="cipherLabel" >
- <property name="text" >
- <string>&lt;none></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTextEdit" name="sessionOutput" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- <property name="html" >
- <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="sessionInputLabel" >
- <property name="text" >
- <string>Input:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="sessionInput" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="sendButton" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="text" >
- <string>&amp;Send</string>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
</widget>
</item>
+ <item row="4" column="0" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="sessionInputLabel">
+ <property name="text">
+ <string>Input:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="sessionInput">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="sendButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>&amp;Send</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>
@@ -160,11 +163,11 @@ p, li { white-space: pre-wrap; }
<receiver>connectButton</receiver>
<slot>animateClick()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>126</x>
<y>20</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>142</x>
<y>78</y>
</hint>
@@ -176,11 +179,11 @@ p, li { white-space: pre-wrap; }
<receiver>sendButton</receiver>
<slot>animateClick()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>142</x>
<y>241</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>297</x>
<y>234</y>
</hint>
diff --git a/examples/network/securesocketclient/sslerrors.ui b/examples/network/securesocketclient/sslerrors.ui
index 4aac18cddb..1aadbfeca5 100644
--- a/examples/network/securesocketclient/sslerrors.ui
+++ b/examples/network/securesocketclient/sslerrors.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>SslErrors</class>
- <widget class="QDialog" name="SslErrors" >
- <property name="geometry" >
+ <widget class="QDialog" name="SslErrors">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,44 +10,48 @@
<height>216</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Unable To Validate The Connection</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout">
<item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600; color:#ff0000;">Warning&lt;/span>&lt;span style=" color:#ff0000;">:&lt;/span>&lt;span style=" color:#000000;"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click &lt;/span>&lt;span style=" color:#000000;">Ignore&lt;/span>&lt;span style=" color:#000000;"> to continue, or &lt;/span>&lt;span style=" color:#000000;">Cancel&lt;/span>&lt;span style=" color:#000000;"> to abort the connection.&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click &lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Ignore&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; to continue, or &lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Cancel&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; to abort the connection.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
- <property name="wordWrap" >
+ <property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QListWidget" name="sslErrorList" />
+ <widget class="QListWidget" name="sslErrorList">
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item>
- <layout class="QHBoxLayout" >
+ <layout class="QHBoxLayout">
<item>
- <widget class="QPushButton" name="certificateChainButton" >
- <property name="text" >
+ <widget class="QPushButton" name="certificateChainButton">
+ <property name="text">
<string>View Certificate Chain</string>
</property>
- <property name="autoDefault" >
+ <property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -55,15 +60,15 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
- <widget class="QPushButton" name="pushButton" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
<string>Ignore</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_2" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
<string>Cancel</string>
</property>
</widget>
@@ -80,11 +85,11 @@ p, li { white-space: pre-wrap; }
<receiver>SslErrors</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>235</x>
<y>185</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>228</x>
<y>287</y>
</hint>
@@ -96,11 +101,11 @@ p, li { white-space: pre-wrap; }
<receiver>SslErrors</receiver>
<slot>reject()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>325</x>
<y>192</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>333</x>
<y>231</y>
</hint>
diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp
index b69f42cc85..27bf253b1a 100644
--- a/examples/network/threadedfortuneserver/dialog.cpp
+++ b/examples/network/threadedfortuneserver/dialog.cpp
@@ -47,11 +47,18 @@
#include "fortuneserver.h"
Dialog::Dialog(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
statusLabel = new QLabel;
+ statusLabel->setWordWrap(true);
+#ifdef Q_OS_SYMBIAN
+ QAction *quitAction = new QAction(tr("Exit"), this);
+ quitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(quitAction);
+#else
quitButton = new QPushButton(tr("Quit"));
quitButton->setAutoDefault(false);
+#endif
if (!server.listen()) {
QMessageBox::critical(this, tr("Threaded Fortune Server"),
@@ -78,6 +85,13 @@ Dialog::Dialog(QWidget *parent)
"Run the Fortune Client example now.")
.arg(ipAddress).arg(server.serverPort()));
+#ifdef Q_OS_SYMBIAN
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(statusLabel);
+ setLayout(mainLayout);
+#else
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
QHBoxLayout *buttonLayout = new QHBoxLayout;
@@ -89,6 +103,6 @@ Dialog::Dialog(QWidget *parent)
mainLayout->addWidget(statusLabel);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
-
+#endif
setWindowTitle(tr("Threaded Fortune Server"));
}
diff --git a/examples/network/threadedfortuneserver/dialog.h b/examples/network/threadedfortuneserver/dialog.h
index 10ae3ebaa2..19a6fc2f47 100644
--- a/examples/network/threadedfortuneserver/dialog.h
+++ b/examples/network/threadedfortuneserver/dialog.h
@@ -41,7 +41,7 @@
#ifndef DIALOG_H
#define DIALOG_H
-#include <QDialog>
+#include <QWidget>
#include "fortuneserver.h"
QT_BEGIN_NAMESPACE
@@ -49,7 +49,7 @@ class QLabel;
class QPushButton;
QT_END_NAMESPACE
-class Dialog : public QDialog
+class Dialog : public QWidget
{
Q_OBJECT
diff --git a/examples/network/threadedfortuneserver/main.cpp b/examples/network/threadedfortuneserver/main.cpp
index 396f9244b6..1e245e9e01 100644
--- a/examples/network/threadedfortuneserver/main.cpp
+++ b/examples/network/threadedfortuneserver/main.cpp
@@ -49,7 +49,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
+#ifdef Q_OS_SYMBIAN
+ dialog.showMaximized();
+#else
dialog.show();
+#endif
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
- return dialog.exec();
+ return app.exec();
}
diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.desktop b/examples/network/threadedfortuneserver/threadedfortuneserver.desktop
new file mode 100644
index 0000000000..509e24493f
--- /dev/null
+++ b/examples/network/threadedfortuneserver/threadedfortuneserver.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Threaded Fortune Server
+Exec=/opt/usr/bin/threadedfortuneserver
+Icon=threadedfortuneserver
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
index 7853d57a40..5eb178a46e 100644
--- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro
+++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
@@ -13,4 +13,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pr
sources.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/network/torrent/torrent.desktop b/examples/network/torrent/torrent.desktop
new file mode 100644
index 0000000000..59db3d312d
--- /dev/null
+++ b/examples/network/torrent/torrent.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Torrent
+Exec=/opt/usr/bin/torrent
+Icon=torrent
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro
index 44716fdefb..242c79627b 100644
--- a/examples/network/torrent/torrent.pro
+++ b/examples/network/torrent/torrent.pro
@@ -37,3 +37,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/torrent
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/2dpainting/2dpainting.desktop b/examples/opengl/2dpainting/2dpainting.desktop
new file mode 100644
index 0000000000..0b3570df34
--- /dev/null
+++ b/examples/opengl/2dpainting/2dpainting.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=2D Painting
+Exec=/opt/usr/bin/2dpainting
+Icon=2dpainting
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro
index 80c865ccb3..450bc75600 100644
--- a/examples/opengl/2dpainting/2dpainting.pro
+++ b/examples/opengl/2dpainting/2dpainting.pro
@@ -17,3 +17,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/2dpainting
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/cube/cube.desktop b/examples/opengl/cube/cube.desktop
new file mode 100644
index 0000000000..627e5f2691
--- /dev/null
+++ b/examples/opengl/cube/cube.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Cube OpenGL ES 2.0
+Exec=/opt/usr/bin/cube
+Icon=cube
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/cube/cube.png b/examples/opengl/cube/cube.png
new file mode 100644
index 0000000000..42c8c51b3a
--- /dev/null
+++ b/examples/opengl/cube/cube.png
Binary files differ
diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro
new file mode 100644
index 0000000000..64f6973c00
--- /dev/null
+++ b/examples/opengl/cube/cube.pro
@@ -0,0 +1,40 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-06-23T12:55:35
+#
+#-------------------------------------------------
+
+QT += core gui
+
+TARGET = cube
+TEMPLATE = app
+
+SOURCES += main.cpp
+
+contains(QT_CONFIG, opengl) {
+ message(Building with OpenGL support.)
+ QT += opengl
+
+ SOURCES += mainwidget.cpp \
+ geometryengine.cpp
+
+ HEADERS += \
+ mainwidget.h \
+ geometryengine.h
+
+ RESOURCES += \
+ shaders.qrc \
+ textures.qrc
+
+ OTHER_FILES += \
+ vshader.glsl \
+ fshader.glsl
+} else {
+ message(OpenGL support is not available.)
+}
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/cube/fshader.glsl b/examples/opengl/cube/fshader.glsl
new file mode 100644
index 0000000000..18068cf0e6
--- /dev/null
+++ b/examples/opengl/cube/fshader.glsl
@@ -0,0 +1,18 @@
+#ifdef GL_ES
+// Set default precision to medium
+precision mediump int;
+precision mediump float;
+#endif
+
+uniform sampler2D texture;
+
+varying vec2 v_texcoord;
+
+//! [0]
+void main()
+{
+ // Set fragment color from texture
+ gl_FragColor = texture2D(texture, v_texcoord);
+}
+//! [0]
+
diff --git a/examples/opengl/cube/geometryengine.cpp b/examples/opengl/cube/geometryengine.cpp
new file mode 100644
index 0000000000..3001ed51d7
--- /dev/null
+++ b/examples/opengl/cube/geometryengine.cpp
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "geometryengine.h"
+
+#include <QVector2D>
+#include <QVector3D>
+
+struct VertexData
+{
+ QVector3D position;
+ QVector2D texCoord;
+};
+
+GeometryEngine::GeometryEngine() : vboIds(new GLuint[2])
+{
+}
+
+GeometryEngine::~GeometryEngine()
+{
+ glDeleteBuffers(2, vboIds);
+ delete[] vboIds;
+}
+
+void GeometryEngine::init()
+{
+//! [0]
+ // Generate 2 VBOs
+ glGenBuffers(2, vboIds);
+
+//! [0]
+
+ // Initializes cube geometry and transfers it to VBOs
+ initCubeGeometry();
+}
+
+void GeometryEngine::initCubeGeometry()
+{
+ // For cube we would need only 8 vertices but we have to
+ // duplicate vertex for each face because texture coordinate
+ // is different.
+ VertexData vertices[] = {
+ // Vertex data for face 0
+ {QVector3D(-1.0, -1.0, 1.0), QVector2D(0.0, 0.0)}, // v0
+ {QVector3D( 1.0, -1.0, 1.0), QVector2D(0.33, 0.0)}, // v1
+ {QVector3D(-1.0, 1.0, 1.0), QVector2D(0.0, 0.5)}, // v2
+ {QVector3D( 1.0, 1.0, 1.0), QVector2D(0.33, 0.5)}, // v3
+
+ // Vertex data for face 1
+ {QVector3D( 1.0, -1.0, 1.0), QVector2D( 0.0, 0.5)}, // v4
+ {QVector3D( 1.0, -1.0, -1.0), QVector2D(0.33, 0.5)}, // v5
+ {QVector3D( 1.0, 1.0, 1.0), QVector2D(0.0, 1.0)}, // v6
+ {QVector3D( 1.0, 1.0, -1.0), QVector2D(0.33, 1.0)}, // v7
+
+ // Vertex data for face 2
+ {QVector3D( 1.0, -1.0, -1.0), QVector2D(0.66, 0.5)}, // v8
+ {QVector3D(-1.0, -1.0, -1.0), QVector2D(1.0, 0.5)}, // v9
+ {QVector3D( 1.0, 1.0, -1.0), QVector2D(0.66, 1.0)}, // v10
+ {QVector3D(-1.0, 1.0, -1.0), QVector2D(1.0, 1.0)}, // v11
+
+ // Vertex data for face 3
+ {QVector3D(-1.0, -1.0, -1.0), QVector2D(0.66, 0.0)}, // v12
+ {QVector3D(-1.0, -1.0, 1.0), QVector2D(1.0, 0.0)}, // v13
+ {QVector3D(-1.0, 1.0, -1.0), QVector2D(0.66, 0.5)}, // v14
+ {QVector3D(-1.0, 1.0, 1.0), QVector2D(1.0, 0.5)}, // v15
+
+ // Vertex data for face 4
+ {QVector3D(-1.0, -1.0, -1.0), QVector2D(0.33, 0.0)}, // v16
+ {QVector3D( 1.0, -1.0, -1.0), QVector2D(0.66, 0.0)}, // v17
+ {QVector3D(-1.0, -1.0, 1.0), QVector2D(0.33, 0.5)}, // v18
+ {QVector3D( 1.0, -1.0, 1.0), QVector2D(0.66, 0.5)}, // v19
+
+ // Vertex data for face 5
+ {QVector3D(-1.0, 1.0, 1.0), QVector2D(0.33, 0.5)}, // v20
+ {QVector3D( 1.0, 1.0, 1.0), QVector2D(0.66, 0.5)}, // v21
+ {QVector3D(-1.0, 1.0, -1.0), QVector2D(0.33, 1.0)}, // v22
+ {QVector3D( 1.0, 1.0, -1.0), QVector2D(0.66, 1.0)} // v23
+ };
+
+ // Indices for drawing cube faces using triangle strips.
+ // Triangle strips can be connected by duplicating indices
+ // between the strips. If connecting strips have opposite
+ // vertex order then last index of the first strip and first
+ // index of the second strip needs to be duplicated. If
+ // connecting strips have same vertex order then only last
+ // index of the first strip needs to be duplicated.
+ GLushort indices[] = {
+ 0, 1, 2, 3, 3, // Face 0 - triangle strip ( v0, v1, v2, v3)
+ 4, 4, 5, 6, 7, 7, // Face 1 - triangle strip ( v4, v5, v6, v7)
+ 8, 8, 9, 10, 11, 11, // Face 2 - triangle strip ( v8, v9, v10, v11)
+ 12, 12, 13, 14, 15, 15, // Face 3 - triangle strip (v12, v13, v14, v15)
+ 16, 16, 17, 18, 19, 19, // Face 4 - triangle strip (v16, v17, v18, v19)
+ 20, 20, 21, 22, 23 // Face 5 - triangle strip (v20, v21, v22, v23)
+ };
+
+//! [1]
+ // Transfer vertex data to VBO 0
+ glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
+ glBufferData(GL_ARRAY_BUFFER, 24 * sizeof(VertexData), vertices, GL_STATIC_DRAW);
+
+ // Transfer index data to VBO 1
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, 34 * sizeof(GLushort), indices, GL_STATIC_DRAW);
+//! [1]
+}
+
+//! [2]
+void GeometryEngine::drawCubeGeometry(QGLShaderProgram *program)
+{
+ // Tell OpenGL which VBOs to use
+ glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
+
+ // Offset for position
+ int offset = 0;
+
+ // Tell OpenGL programmable pipeline how to locate vertex position data
+ int vertexLocation = program->attributeLocation("a_position");
+ program->enableAttributeArray(vertexLocation);
+ glVertexAttribPointer(vertexLocation, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (const void *)offset);
+
+ // Offset for texture coordinate
+ offset += sizeof(QVector3D);
+
+ // Tell OpenGL programmable pipeline how to locate vertex texture coordinate data
+ int texcoordLocation = program->attributeLocation("a_texcoord");
+ program->enableAttributeArray(texcoordLocation);
+ glVertexAttribPointer(texcoordLocation, 2, GL_FLOAT, GL_FALSE, sizeof(VertexData), (const void *)offset);
+
+ // Draw cube geometry using indices from VBO 1
+ glDrawElements(GL_TRIANGLE_STRIP, 34, GL_UNSIGNED_SHORT, 0);
+}
+//! [2]
diff --git a/examples/opengl/cube/geometryengine.h b/examples/opengl/cube/geometryengine.h
new file mode 100644
index 0000000000..e071ef6202
--- /dev/null
+++ b/examples/opengl/cube/geometryengine.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GEOMETRYENGINE_H
+#define GEOMETRYENGINE_H
+
+#include <QtOpenGL/QGLFunctions>
+#include <QtOpenGL/QGLShaderProgram>
+
+class GeometryEngine : protected QGLFunctions
+{
+public:
+ GeometryEngine();
+ virtual ~GeometryEngine();
+
+ void init();
+
+ void drawCubeGeometry(QGLShaderProgram *program);
+
+private:
+ void initCubeGeometry();
+
+ GLuint *vboIds;
+
+};
+
+#endif // GEOMETRYENGINE_H
diff --git a/examples/opengl/cube/main.cpp b/examples/opengl/cube/main.cpp
new file mode 100644
index 0000000000..c75fd0826a
--- /dev/null
+++ b/examples/opengl/cube/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QLabel>
+
+#ifndef QT_NO_OPENGL
+#include "mainwidget.h"
+#endif
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ a.setApplicationName("cube");
+ a.setApplicationVersion("0.1");
+#ifndef QT_NO_OPENGL
+ MainWidget w;
+ w.resize(640, 480);
+ w.show();
+#else
+ QLabel * notifyLabel = new QLabel("OpenGL Support required");
+ notifyLabel->show();
+#endif
+ return a.exec();
+}
diff --git a/examples/opengl/cube/mainwidget.cpp b/examples/opengl/cube/mainwidget.cpp
new file mode 100644
index 0000000000..2a2cd6322c
--- /dev/null
+++ b/examples/opengl/cube/mainwidget.cpp
@@ -0,0 +1,232 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mainwidget.h"
+
+#include "geometryengine.h"
+
+#include <QtOpenGL/QGLShaderProgram>
+
+#include <QBasicTimer>
+#include <QMouseEvent>
+
+#include <math.h>
+
+#include <QDebug>
+
+MainWidget::MainWidget(QWidget *parent) :
+ QGLWidget(parent),
+ timer(new QBasicTimer),
+ program(new QGLShaderProgram),
+ geometries(new GeometryEngine)
+{
+}
+
+MainWidget::~MainWidget()
+{
+ delete timer; timer = 0;
+ delete program; program = 0;
+ delete geometries; geometries = 0;
+
+ deleteTexture(texture);
+}
+
+//! [0]
+void MainWidget::mousePressEvent(QMouseEvent *e)
+{
+ // Saving mouse press position
+ mousePressPosition = QVector2D(e->posF());
+}
+
+void MainWidget::mouseReleaseEvent(QMouseEvent *e)
+{
+ // Mouse release position - mouse press position
+ QVector2D diff = QVector2D(e->posF()) - mousePressPosition;
+
+ // Rotation axis is perpendicular to the mouse position difference
+ // vector
+ QVector3D n = QVector3D(diff.y(), diff.x(), 0.0).normalized();
+
+ // Accelerate angular speed relative to the length of the mouse sweep
+ qreal acc = diff.length() / 100.0;
+
+ // Calculate new rotation axis as weighted sum
+ rotationAxis = (rotationAxis * angularSpeed + n * acc).normalized();
+
+ // Increase angular speed
+ angularSpeed += acc;
+}
+//! [0]
+
+//! [1]
+void MainWidget::timerEvent(QTimerEvent *e)
+{
+ Q_UNUSED(e);
+
+ // Decrease angular speed (friction)
+ angularSpeed *= 0.99;
+
+ // Stop rotation when speed goes below threshold
+ if (angularSpeed < 0.01)
+ angularSpeed = 0.0;
+ else {
+ // Update rotation
+ rotation = QQuaternion::fromAxisAndAngle(rotationAxis, angularSpeed) * rotation;
+
+ // Update scene
+ updateGL();
+ }
+}
+//! [1]
+
+void MainWidget::initializeGL()
+{
+ qglClearColor(Qt::black);
+
+ qDebug() << "Initializing shaders...";
+ initShaders();
+
+ qDebug() << "Initializing textures...";
+ initTextures();
+
+//! [2]
+ // Enable depth buffer
+ glEnable(GL_DEPTH_TEST);
+
+ // Enable back face culling
+ glEnable(GL_CULL_FACE);
+//! [2]
+
+ qDebug() << "Initializing geometries...";
+ geometries->init();
+
+ // using QBasicTimer because its faster that QTimer
+ timer->start(12, this);
+}
+
+//! [3]
+void MainWidget::initShaders()
+{
+ // Overriding system locale until shaders are compiled
+ setlocale(LC_NUMERIC, "C");
+
+ // Compiling vertex shader
+ if (!program->addShaderFromSourceFile(QGLShader::Vertex, ":/vshader.glsl"))
+ close();
+
+ // Compiling fragment shader
+ if (!program->addShaderFromSourceFile(QGLShader::Fragment, ":/fshader.glsl"))
+ close();
+
+ // Linking shader pipeline
+ if (!program->link())
+ close();
+
+ // Binding shader pipeline for use
+ if (!program->bind())
+ close();
+
+ // Restore system locale
+ setlocale(LC_ALL, "");
+}
+//! [3]
+
+//! [4]
+void MainWidget::initTextures()
+{
+ // Loading cube.png to texture unit 0
+ glActiveTexture(GL_TEXTURE0);
+ glEnable(GL_TEXTURE_2D);
+ texture = bindTexture(QImage(":/cube.png"));
+
+ // Set nearest filtering mode for texture minification
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+ // Set bilinear filtering mode for texture magnification
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ // Wrap texture coordinates by repeating
+ // f.ex. texture coordinate (1.1, 1.2) is same as (0.1, 0.2)
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+}
+//! [4]
+
+//! [5]
+void MainWidget::resizeGL(int w, int h)
+{
+ // Set OpenGL viewport to cover whole widget
+ glViewport(0, 0, w, h);
+
+ // Calculate aspect ratio
+ qreal aspect = (qreal)w / ((qreal)h?h:1);
+
+ // Set near plane to 3.0, far plane to 7.0, field of view 45 degrees
+ const qreal zNear = 3.0, zFar = 7.0, fov = 45.0;
+
+ // Reset projection
+ projection.setToIdentity();
+
+ // Set perspective projection
+ projection.perspective(fov, aspect, zNear, zFar);
+}
+//! [5]
+
+void MainWidget::paintGL()
+{
+ // Clear color and depth buffer
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+//! [6]
+ // Calculate model view transformation
+ QMatrix4x4 matrix;
+ matrix.translate(0.0, 0.0, -5.0);
+ matrix.rotate(rotation);
+
+ // Set modelview-projection matrix
+ program->setUniformValue("mvp_matrix", projection * matrix);
+//! [6]
+
+ // Using texture unit 0 which contains cube.png
+ program->setUniformValue("texture", 0);
+
+ // Draw cube geometry
+ geometries->drawCubeGeometry(program);
+}
diff --git a/examples/opengl/cube/mainwidget.h b/examples/opengl/cube/mainwidget.h
new file mode 100644
index 0000000000..33ab0d8a05
--- /dev/null
+++ b/examples/opengl/cube/mainwidget.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWIDGET_H
+#define MAINWIDGET_H
+
+#include <QtOpenGL/QGLWidget>
+
+#include <QMatrix4x4>
+#include <QQuaternion>
+#include <QVector2D>
+
+class QBasicTimer;
+class QGLShaderProgram;
+
+class GeometryEngine;
+
+class MainWidget : public QGLWidget
+{
+ Q_OBJECT
+public:
+ explicit MainWidget(QWidget *parent = 0);
+ virtual ~MainWidget();
+
+signals:
+
+public slots:
+
+protected:
+ void mousePressEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e);
+ void timerEvent(QTimerEvent *e);
+
+ void initializeGL();
+ void resizeGL(int w, int h);
+ void paintGL();
+
+ void initShaders();
+ void initTextures();
+
+private:
+ QBasicTimer *timer;
+ QGLShaderProgram *program;
+ GeometryEngine *geometries;
+
+ GLuint texture;
+
+ QMatrix4x4 projection;
+
+ QVector2D mousePressPosition;
+ QVector3D rotationAxis;
+ qreal angularSpeed;
+ QQuaternion rotation;
+};
+
+#endif // MAINWIDGET_H
diff --git a/examples/opengl/cube/shaders.qrc b/examples/opengl/cube/shaders.qrc
new file mode 100644
index 0000000000..bfc4b25111
--- /dev/null
+++ b/examples/opengl/cube/shaders.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>vshader.glsl</file>
+ <file>fshader.glsl</file>
+ </qresource>
+</RCC>
diff --git a/examples/opengl/cube/textures.qrc b/examples/opengl/cube/textures.qrc
new file mode 100644
index 0000000000..fe53be5e64
--- /dev/null
+++ b/examples/opengl/cube/textures.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>cube.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/opengl/cube/vshader.glsl b/examples/opengl/cube/vshader.glsl
new file mode 100644
index 0000000000..cfdc061852
--- /dev/null
+++ b/examples/opengl/cube/vshader.glsl
@@ -0,0 +1,24 @@
+#ifdef GL_ES
+// Set default precision to medium
+precision mediump int;
+precision mediump float;
+#endif
+
+uniform mat4 mvp_matrix;
+
+attribute vec4 a_position;
+attribute vec2 a_texcoord;
+
+varying vec2 v_texcoord;
+
+//! [0]
+void main()
+{
+ // Calculate vertex position in screen space
+ gl_Position = mvp_matrix * a_position;
+
+ // Pass texture coordinate to fragment shader
+ // Value will be automatically interpolated to fragments inside polygon faces
+ v_texcoord = a_texcoord;
+}
+//! [0]
diff --git a/examples/opengl/framebufferobject/framebufferobject.desktop b/examples/opengl/framebufferobject/framebufferobject.desktop
new file mode 100644
index 0000000000..5858deaabb
--- /dev/null
+++ b/examples/opengl/framebufferobject/framebufferobject.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Framebuffer Object
+Exec=/opt/usr/bin/framebufferobject
+Icon=framebufferobject
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/framebufferobject/framebufferobject.pro b/examples/opengl/framebufferobject/framebufferobject.pro
index f9ee7e7e87..93780d86d6 100644
--- a/examples/opengl/framebufferobject/framebufferobject.pro
+++ b/examples/opengl/framebufferobject/framebufferobject.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
@@ -21,4 +20,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/framebufferobject2/framebufferobject2.desktop b/examples/opengl/framebufferobject2/framebufferobject2.desktop
new file mode 100644
index 0000000000..6aed108ef6
--- /dev/null
+++ b/examples/opengl/framebufferobject2/framebufferobject2.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Framebuffer Object 2
+Exec=/opt/usr/bin/framebufferobject2
+Icon=framebufferobject2
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/framebufferobject2/framebufferobject2.pro b/examples/opengl/framebufferobject2/framebufferobject2.pro
index 094ad80f30..804d92223e 100644
--- a/examples/opengl/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/framebufferobject2/framebufferobject2.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/grabber/grabber.desktop b/examples/opengl/grabber/grabber.desktop
new file mode 100644
index 0000000000..76f31bea5c
--- /dev/null
+++ b/examples/opengl/grabber/grabber.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Grabber
+Exec=/opt/usr/bin/grabber
+Icon=grabber
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/grabber/grabber.pro b/examples/opengl/grabber/grabber.pro
index daa32b3f3b..8cac35878f 100644
--- a/examples/opengl/grabber/grabber.pro
+++ b/examples/opengl/grabber/grabber.pro
@@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/hellogl/hellogl.desktop b/examples/opengl/hellogl/hellogl.desktop
new file mode 100644
index 0000000000..355e259846
--- /dev/null
+++ b/examples/opengl/hellogl/hellogl.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Hello GL
+Exec=/opt/usr/bin/hellogl
+Icon=hellogl
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/hellogl/hellogl.pro b/examples/opengl/hellogl/hellogl.pro
index 0e3209af80..0773404a26 100644
--- a/examples/opengl/hellogl/hellogl.pro
+++ b/examples/opengl/hellogl/hellogl.pro
@@ -17,3 +17,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/hellogl_es/hellogl_es.desktop b/examples/opengl/hellogl_es/hellogl_es.desktop
new file mode 100644
index 0000000000..11c1dd795c
--- /dev/null
+++ b/examples/opengl/hellogl_es/hellogl_es.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Hello GL ES
+Exec=/opt/usr/bin/hellogl_es
+Icon=hellogl_es
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro
index 80ef7df315..96338073a0 100644
--- a/examples/opengl/hellogl_es/hellogl_es.pro
+++ b/examples/opengl/hellogl_es/hellogl_es.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
@@ -25,3 +24,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/hellogl_es2/hellogl_es2.desktop b/examples/opengl/hellogl_es2/hellogl_es2.desktop
new file mode 100644
index 0000000000..2fe0adfc72
--- /dev/null
+++ b/examples/opengl/hellogl_es2/hellogl_es2.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Hello GL ES 2
+Exec=/opt/usr/bin/hellogl_es2
+Icon=hellogl_es2
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro
index 92b42248de..48acd972f5 100644
--- a/examples/opengl/hellogl_es2/hellogl_es2.pro
+++ b/examples/opengl/hellogl_es2/hellogl_es2.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
@@ -25,3 +24,15 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+
+maemo5 {
+ # Debian package name may not contain numbers or special characters
+ # such as '_', lets change this in Maemo.
+ TARGET = helloglestwo
+ include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+}
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro
index c3fbc77e80..ecb69728de 100644
--- a/examples/opengl/opengl.pro
+++ b/examples/opengl/opengl.pro
@@ -12,13 +12,14 @@ contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2){
}
} else {
SUBDIRS = 2dpainting \
+ cube \
grabber \
hellogl \
overpainting \
pbuffers \
framebufferobject2 \
samplebuffers \
- textures
+ textures \
contains(QT_CONFIG, svg) {
SUBDIRS += framebufferobject \
@@ -32,4 +33,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/opengl/overpainting/overpainting.desktop b/examples/opengl/overpainting/overpainting.desktop
new file mode 100644
index 0000000000..025300b922
--- /dev/null
+++ b/examples/opengl/overpainting/overpainting.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Overpainting
+Exec=/opt/usr/bin/overpainting
+Icon=overpainting
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro
index f9ba245358..863236a7e9 100644
--- a/examples/opengl/overpainting/overpainting.pro
+++ b/examples/opengl/overpainting/overpainting.pro
@@ -21,3 +21,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
INSTALLS += target \
sources
symbian:include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/pbuffers/pbuffers.desktop b/examples/opengl/pbuffers/pbuffers.desktop
new file mode 100644
index 0000000000..e5c5cee8c4
--- /dev/null
+++ b/examples/opengl/pbuffers/pbuffers.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Pixel Buffers
+Exec=/opt/usr/bin/pbuffers
+Icon=pbuffers
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro
index 1c21596520..0ac7fd267a 100644
--- a/examples/opengl/pbuffers/pbuffers.pro
+++ b/examples/opengl/pbuffers/pbuffers.pro
@@ -17,3 +17,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
INSTALLS += target \
sources
symbian:include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/pbuffers2/pbuffers2.desktop b/examples/opengl/pbuffers2/pbuffers2.desktop
new file mode 100644
index 0000000000..eed908c661
--- /dev/null
+++ b/examples/opengl/pbuffers2/pbuffers2.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Pixel Buffers 2
+Exec=/opt/usr/bin/pbuffers2
+Icon=pbuffers2
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/pbuffers2/pbuffers2.pro b/examples/opengl/pbuffers2/pbuffers2.pro
index ec718e5672..5f7bdfd30e 100644
--- a/examples/opengl/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/pbuffers2/pbuffers2.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
@@ -21,3 +20,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/samplebuffers/samplebuffers.desktop b/examples/opengl/samplebuffers/samplebuffers.desktop
new file mode 100644
index 0000000000..d7bd43d95c
--- /dev/null
+++ b/examples/opengl/samplebuffers/samplebuffers.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Sample Buffers
+Exec=/opt/usr/bin/samplebuffers
+Icon=samplebuffers
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/samplebuffers/samplebuffers.pro b/examples/opengl/samplebuffers/samplebuffers.pro
index 232c1f4a54..ea35f673d4 100644
--- a/examples/opengl/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/samplebuffers/samplebuffers.pro
@@ -10,3 +10,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/opengl/textures/textures.desktop b/examples/opengl/textures/textures.desktop
new file mode 100644
index 0000000000..e8a40cdcd5
--- /dev/null
+++ b/examples/opengl/textures/textures.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Textures
+Exec=/opt/usr/bin/textures
+Icon=textures
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro
index 8d6cc4e099..44f28ab6c9 100644
--- a/examples/opengl/textures/textures.pro
+++ b/examples/opengl/textures/textures.pro
@@ -13,3 +13,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/openvg/openvg.desktop b/examples/openvg/openvg.desktop
new file mode 100644
index 0000000000..186699aef1
--- /dev/null
+++ b/examples/openvg/openvg.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=OpenVG Star
+Exec=/opt/usr/bin/openvg
+Icon=openvg
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/openvg/openvg.pro b/examples/openvg/openvg.pro
index d76a389635..509ece826b 100644
--- a/examples/openvg/openvg.pro
+++ b/examples/openvg/openvg.pro
@@ -6,3 +6,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/openvg
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS openvg.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/openvg
INSTALLS += target sources
+
diff --git a/examples/painting/basicdrawing/basicdrawing.desktop b/examples/painting/basicdrawing/basicdrawing.desktop
new file mode 100644
index 0000000000..7f178ec8a7
--- /dev/null
+++ b/examples/painting/basicdrawing/basicdrawing.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Basic Drawing
+Exec=/opt/usr/bin/basicdrawing
+Icon=basicdrawing
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/basicdrawing/basicdrawing.pro b/examples/painting/basicdrawing/basicdrawing.pro
index 4fa0e71095..2f1b895704 100644
--- a/examples/painting/basicdrawing/basicdrawing.pro
+++ b/examples/painting/basicdrawing/basicdrawing.pro
@@ -15,3 +15,6 @@ symbian {
TARGET.UID3 = 0xA000A649
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/painting/basicdrawing/main.cpp b/examples/painting/basicdrawing/main.cpp
index 6662742166..aa839f68cc 100644
--- a/examples/painting/basicdrawing/main.cpp
+++ b/examples/painting/basicdrawing/main.cpp
@@ -48,6 +48,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/basicdrawing/window.cpp b/examples/painting/basicdrawing/window.cpp
index 54422a0104..072c3e08aa 100644
--- a/examples/painting/basicdrawing/window.cpp
+++ b/examples/painting/basicdrawing/window.cpp
@@ -74,7 +74,11 @@ Window::Window()
//! [2]
penWidthSpinBox = new QSpinBox;
penWidthSpinBox->setRange(0, 20);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ penWidthSpinBox->setSpecialValueText(tr("0"));
+#else
penWidthSpinBox->setSpecialValueText(tr("0 (cosmetic pen)"));
+#endif
penWidthLabel = new QLabel(tr("Pen &Width:"));
penWidthLabel->setBuddy(penWidthSpinBox);
@@ -134,12 +138,12 @@ Window::Window()
brushStyleComboBox->addItem(tr("Dense 7"), Qt::Dense7Pattern);
brushStyleComboBox->addItem(tr("None"), Qt::NoBrush);
- brushStyleLabel = new QLabel(tr("&Brush Style:"));
+ brushStyleLabel = new QLabel(tr("&Brush:"));
brushStyleLabel->setBuddy(brushStyleComboBox);
//! [4]
//! [5]
- otherOptionsLabel = new QLabel(tr("Other Options:"));
+ otherOptionsLabel = new QLabel(tr("Options:"));
//! [5] //! [6]
antialiasingCheckBox = new QCheckBox(tr("&Antialiasing"));
//! [6] //! [7]
@@ -168,26 +172,27 @@ Window::Window()
//! [9]
QGridLayout *mainLayout = new QGridLayout;
//! [9] //! [10]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
+#endif
mainLayout->setColumnStretch(0, 1);
mainLayout->setColumnStretch(3, 1);
mainLayout->addWidget(renderArea, 0, 0, 1, 4);
- mainLayout->setRowMinimumHeight(1, 6);
- mainLayout->addWidget(shapeLabel, 2, 1, Qt::AlignRight);
- mainLayout->addWidget(shapeComboBox, 2, 2);
- mainLayout->addWidget(penWidthLabel, 3, 1, Qt::AlignRight);
- mainLayout->addWidget(penWidthSpinBox, 3, 2);
- mainLayout->addWidget(penStyleLabel, 4, 1, Qt::AlignRight);
- mainLayout->addWidget(penStyleComboBox, 4, 2);
- mainLayout->addWidget(penCapLabel, 5, 1, Qt::AlignRight);
- mainLayout->addWidget(penCapComboBox, 5, 2);
- mainLayout->addWidget(penJoinLabel, 6, 1, Qt::AlignRight);
- mainLayout->addWidget(penJoinComboBox, 6, 2);
- mainLayout->addWidget(brushStyleLabel, 7, 1, Qt::AlignRight);
- mainLayout->addWidget(brushStyleComboBox, 7, 2);
- mainLayout->setRowMinimumHeight(8, 6);
- mainLayout->addWidget(otherOptionsLabel, 9, 1, Qt::AlignRight);
- mainLayout->addWidget(antialiasingCheckBox, 9, 2);
- mainLayout->addWidget(transformationsCheckBox, 10, 2);
+ mainLayout->addWidget(shapeLabel, 2, 0, Qt::AlignRight);
+ mainLayout->addWidget(shapeComboBox, 2, 1);
+ mainLayout->addWidget(penWidthLabel, 3, 0, Qt::AlignRight);
+ mainLayout->addWidget(penWidthSpinBox, 3, 1);
+ mainLayout->addWidget(penStyleLabel, 4, 0, Qt::AlignRight);
+ mainLayout->addWidget(penStyleComboBox, 4, 1);
+ mainLayout->addWidget(penCapLabel, 3, 2, Qt::AlignRight);
+ mainLayout->addWidget(penCapComboBox, 3, 3);
+ mainLayout->addWidget(penJoinLabel, 2, 2, Qt::AlignRight);
+ mainLayout->addWidget(penJoinComboBox, 2, 3);
+ mainLayout->addWidget(brushStyleLabel, 4, 2, Qt::AlignRight);
+ mainLayout->addWidget(brushStyleComboBox, 4, 3);
+ mainLayout->addWidget(otherOptionsLabel, 5, 0, Qt::AlignRight);
+ mainLayout->addWidget(antialiasingCheckBox, 5, 1, 1, 1, Qt::AlignRight);
+ mainLayout->addWidget(transformationsCheckBox, 5, 2, 1, 2, Qt::AlignRight);
setLayout(mainLayout);
shapeChanged();
diff --git a/examples/painting/concentriccircles/concentriccircles.desktop b/examples/painting/concentriccircles/concentriccircles.desktop
new file mode 100644
index 0000000000..7007f192bc
--- /dev/null
+++ b/examples/painting/concentriccircles/concentriccircles.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Concentric Circles
+Exec=/opt/usr/bin/concentriccircles
+Icon=concentriccircles
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/concentriccircles/concentriccircles.pro b/examples/painting/concentriccircles/concentriccircles.pro
index 0ef4337416..6a7cc00fa9 100644
--- a/examples/painting/concentriccircles/concentriccircles.pro
+++ b/examples/painting/concentriccircles/concentriccircles.pro
@@ -14,3 +14,5 @@ symbian {
TARGET.UID3 = 0xA000A64A
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/painting/concentriccircles/main.cpp b/examples/painting/concentriccircles/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/painting/concentriccircles/main.cpp
+++ b/examples/painting/concentriccircles/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/fontsampler/fontsampler.desktop b/examples/painting/fontsampler/fontsampler.desktop
new file mode 100644
index 0000000000..8582891fcf
--- /dev/null
+++ b/examples/painting/fontsampler/fontsampler.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Font Sampler
+Exec=/opt/usr/bin/fontsampler
+Icon=fontsampler
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/fontsampler/fontsampler.pro b/examples/painting/fontsampler/fontsampler.pro
index 1bb2f1d8cb..86b9c67bd3 100644
--- a/examples/painting/fontsampler/fontsampler.pro
+++ b/examples/painting/fontsampler/fontsampler.pro
@@ -10,3 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/painting/fontsampler
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/painting/fontsampler/main.cpp b/examples/painting/fontsampler/main.cpp
index 01c8adae53..dffe80348a 100644
--- a/examples/painting/fontsampler/main.cpp
+++ b/examples/painting/fontsampler/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/fontsampler/mainwindow.cpp b/examples/painting/fontsampler/mainwindow.cpp
index 0976d1f971..96698437b1 100644
--- a/examples/painting/fontsampler/mainwindow.cpp
+++ b/examples/painting/fontsampler/mainwindow.cpp
@@ -47,6 +47,10 @@ MainWindow::MainWindow(QWidget *parent)
{
setupUi(this);
+#if defined(Q_OS_SYMBIAN)
+ addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
+#endif
+
sampleSizes << 32 << 24 << 16 << 14 << 12 << 8 << 4 << 2 << 1;
markedCount = 0;
setupFontTree();
@@ -140,7 +144,11 @@ void MainWindow::showFont(QTreeWidgetItem *item)
QString oldText = textEdit->toPlainText().trimmed();
bool modified = textEdit->document()->isModified();
textEdit->clear();
+#if defined(Q_OS_SYMBIAN)
+ textEdit->document()->setDefaultFont(QFont(family, 10, weight, italic));
+#else
textEdit->document()->setDefaultFont(QFont(family, 32, weight, italic));
+#endif
QTextCursor cursor = textEdit->textCursor();
QTextBlockFormat blockFormat;
@@ -217,6 +225,30 @@ void MainWindow::updateStyles(QTreeWidgetItem *item, int column)
printPreviewAction->setEnabled(markedCount > 0);
}
+QMap<QString, StyleItems> MainWindow::currentPageMap()
+{
+ QMap<QString, StyleItems> pageMap;
+
+ for (int row = 0; row < fontTree->topLevelItemCount(); ++row) {
+ QTreeWidgetItem *familyItem = fontTree->topLevelItem(row);
+ QString family;
+
+ if (familyItem->checkState(0) == Qt::Checked) {
+ family = familyItem->text(0);
+ pageMap[family] = StyleItems();
+ }
+
+ for (int childRow = 0; childRow < familyItem->childCount(); ++childRow) {
+ QTreeWidgetItem *styleItem = familyItem->child(childRow);
+ if (styleItem->checkState(0) == Qt::Checked)
+ pageMap[family].append(styleItem);
+ }
+ }
+
+ return pageMap;
+}
+
+#ifndef QT_NO_PRINTER
void MainWindow::on_printAction_triggered()
{
pageMap = currentPageMap();
@@ -283,29 +315,6 @@ void MainWindow::on_printPreviewAction_triggered()
preview.exec();
}
-QMap<QString, StyleItems> MainWindow::currentPageMap()
-{
- QMap<QString, StyleItems> pageMap;
-
- for (int row = 0; row < fontTree->topLevelItemCount(); ++row) {
- QTreeWidgetItem *familyItem = fontTree->topLevelItem(row);
- QString family;
-
- if (familyItem->checkState(0) == Qt::Checked) {
- family = familyItem->text(0);
- pageMap[family] = StyleItems();
- }
-
- for (int childRow = 0; childRow < familyItem->childCount(); ++childRow) {
- QTreeWidgetItem *styleItem = familyItem->child(childRow);
- if (styleItem->checkState(0) == Qt::Checked)
- pageMap[family].append(styleItem);
- }
- }
-
- return pageMap;
-}
-
void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
{
QString family = pageMap.keys()[index];
@@ -370,3 +379,4 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
painter->restore();
}
+#endif
diff --git a/examples/painting/fontsampler/mainwindow.h b/examples/painting/fontsampler/mainwindow.h
index 7ea4cd5ed0..4021ee7c6c 100644
--- a/examples/painting/fontsampler/mainwindow.h
+++ b/examples/painting/fontsampler/mainwindow.h
@@ -61,11 +61,15 @@ public:
public slots:
void on_clearAction_triggered();
void on_markAction_triggered();
+#ifndef QT_NO_PRINTER
void on_printAction_triggered();
void on_printPreviewAction_triggered();
+#endif
void on_unmarkAction_triggered();
+#ifndef QT_NO_PRINTER
void printDocument(QPrinter *printer);
void printPage(int index, QPainter *painter, QPrinter *printer);
+#endif
void showFont(QTreeWidgetItem *item);
void updateStyles(QTreeWidgetItem *item, int column);
diff --git a/examples/painting/fontsampler/mainwindowbase.ui b/examples/painting/fontsampler/mainwindowbase.ui
index 6545b34083..1a95ebd6d1 100644
--- a/examples/painting/fontsampler/mainwindowbase.ui
+++ b/examples/painting/fontsampler/mainwindowbase.ui
@@ -1,10 +1,8 @@
-<ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>MainWindowBase</class>
- <widget class="QMainWindow" name="MainWindowBase" >
- <property name="geometry" >
+ <widget class="QMainWindow" name="MainWindowBase">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -12,129 +10,133 @@
<height>345</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Font Sampler</string>
</property>
- <widget class="QWidget" name="centralwidget" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <widget class="QTextEdit" name="textEdit" />
+ <widget class="QTextEdit" name="textEdit"/>
</item>
</layout>
</widget>
- <widget class="QMenuBar" name="menubar" >
- <property name="geometry" >
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
- <height>24</height>
+ <height>18</height>
</rect>
</property>
- <widget class="QMenu" name="menu_Selection" >
- <property name="title" >
+ <widget class="QMenu" name="menu_Selection">
+ <property name="title">
<string>&amp;Selection</string>
</property>
- <addaction name="markAction" />
- <addaction name="unmarkAction" />
- <addaction name="clearAction" />
+ <addaction name="markAction"/>
+ <addaction name="unmarkAction"/>
+ <addaction name="clearAction"/>
</widget>
- <widget class="QMenu" name="menu_File" >
- <property name="title" >
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
<string>&amp;File</string>
</property>
- <addaction name="printPreviewAction" />
- <addaction name="printAction" />
- <addaction name="quitAction" />
+ <addaction name="printPreviewAction"/>
+ <addaction name="printAction"/>
+ <addaction name="quitAction"/>
</widget>
- <addaction name="menu_File" />
- <addaction name="menu_Selection" />
+ <addaction name="menu_File"/>
+ <addaction name="menu_Selection"/>
</widget>
- <widget class="QStatusBar" name="statusbar" />
- <widget class="QDockWidget" name="dockWidget" >
- <property name="features" >
- <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable|QDockWidget::NoDockWidgetFeatures</set>
+ <widget class="QStatusBar" name="statusbar"/>
+ <widget class="QDockWidget" name="dockWidget">
+ <property name="features">
+ <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Available Fonts</string>
</property>
- <attribute name="dockWidgetArea" >
+ <attribute name="dockWidgetArea">
<number>1</number>
</attribute>
- <widget class="QWidget" name="dockWidgetContents" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <widget class="QWidget" name="dockWidgetContents">
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <widget class="QTreeWidget" name="fontTree" >
- <property name="selectionMode" >
+ <widget class="QTreeWidget" name="fontTree">
+ <property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
+ <column>
+ <property name="text">
+ <string notr="true">1</string>
+ </property>
+ </column>
</widget>
</item>
</layout>
</widget>
</widget>
- <action name="printAction" >
- <property name="enabled" >
+ <action name="printAction">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Print...</string>
</property>
- <property name="shortcut" >
+ <property name="shortcut">
<string>Ctrl+P</string>
</property>
</action>
- <action name="quitAction" >
- <property name="text" >
+ <action name="quitAction">
+ <property name="text">
<string>E&amp;xit</string>
</property>
- <property name="shortcut" >
+ <property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
- <action name="markAction" >
- <property name="text" >
+ <action name="markAction">
+ <property name="text">
<string>&amp;Mark</string>
</property>
- <property name="shortcut" >
+ <property name="shortcut">
<string>Ctrl+M</string>
</property>
</action>
- <action name="unmarkAction" >
- <property name="text" >
+ <action name="unmarkAction">
+ <property name="text">
<string>&amp;Unmark</string>
</property>
- <property name="shortcut" >
+ <property name="shortcut">
<string>Ctrl+U</string>
</property>
</action>
- <action name="clearAction" >
- <property name="text" >
+ <action name="clearAction">
+ <property name="text">
<string>&amp;Clear</string>
</property>
</action>
- <action name="printPreviewAction" >
- <property name="enabled" >
+ <action name="printPreviewAction">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Print Preview...</string>
</property>
</action>
</widget>
- <pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
diff --git a/examples/painting/imagecomposition/imagecomposer.cpp b/examples/painting/imagecomposition/imagecomposer.cpp
index a41f405fd0..9488204e30 100644
--- a/examples/painting/imagecomposition/imagecomposer.cpp
+++ b/examples/painting/imagecomposition/imagecomposer.cpp
@@ -43,7 +43,11 @@
#include "imagecomposer.h"
//! [0]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+static const QSize resultSize(50, 50);
+#else
static const QSize resultSize(200, 200);
+#endif
//! [0]
//! [1]
@@ -104,7 +108,10 @@ ImageComposer::ImageComposer()
mainLayout->addWidget(destinationButton, 0, 2, 3, 1);
mainLayout->addWidget(equalLabel, 1, 3);
mainLayout->addWidget(resultLabel, 0, 4, 3, 1);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+#else
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
+#endif
setLayout(mainLayout);
//! [4]
@@ -176,6 +183,9 @@ void ImageComposer::loadImage(const QString &fileName, QImage *image,
{
image->load(fileName);
+ // Scale the image to given size
+ *image = image->scaled(resultSize, Qt::KeepAspectRatio);
+
QImage fixedImage(resultSize, QImage::Format_ARGB32_Premultiplied);
QPainter painter(&fixedImage);
painter.setCompositionMode(QPainter::CompositionMode_Source);
diff --git a/examples/painting/imagecomposition/imagecomposition.desktop b/examples/painting/imagecomposition/imagecomposition.desktop
new file mode 100644
index 0000000000..854fc862f0
--- /dev/null
+++ b/examples/painting/imagecomposition/imagecomposition.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Image Composition
+Exec=/opt/usr/bin/imagecomposition
+Icon=imagecomposition
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/imagecomposition/imagecomposition.pro b/examples/painting/imagecomposition/imagecomposition.pro
index e9e872564d..089358ac13 100644
--- a/examples/painting/imagecomposition/imagecomposition.pro
+++ b/examples/painting/imagecomposition/imagecomposition.pro
@@ -13,3 +13,5 @@ symbian {
TARGET.UID3 = 0xA000A64B
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/painting/imagecomposition/main.cpp b/examples/painting/imagecomposition/main.cpp
index e70fa5fae9..f97a3ff7ef 100644
--- a/examples/painting/imagecomposition/main.cpp
+++ b/examples/painting/imagecomposition/main.cpp
@@ -49,7 +49,11 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
ImageComposer composer;
+#if defined(Q_OS_SYMBIAN)
+ composer.showMaximized();
+#else
composer.show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/painting/painterpaths/main.cpp b/examples/painting/painterpaths/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/painting/painterpaths/main.cpp
+++ b/examples/painting/painterpaths/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/painterpaths/painterpaths.desktop b/examples/painting/painterpaths/painterpaths.desktop
new file mode 100644
index 0000000000..ae92f2c589
--- /dev/null
+++ b/examples/painting/painterpaths/painterpaths.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Painter Paths
+Exec=/opt/usr/bin/painterpaths
+Icon=painterpaths
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro
index d096fa6218..2c849cde52 100644
--- a/examples/painting/painterpaths/painterpaths.pro
+++ b/examples/painting/painterpaths/painterpaths.pro
@@ -15,3 +15,5 @@ symbian {
TARGET.UID3 = 0xA000A64C
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/painting/painterpaths/window.cpp b/examples/painting/painterpaths/window.cpp
index 429f470b26..0a4c1b0ca3 100644
--- a/examples/painting/painterpaths/window.cpp
+++ b/examples/painting/painterpaths/window.cpp
@@ -130,16 +130,17 @@ Window::Window()
//! [9]
//! [10]
- renderAreas[0] = new RenderArea(rectPath);
- renderAreas[1] = new RenderArea(roundRectPath);
- renderAreas[2] = new RenderArea(ellipsePath);
- renderAreas[3] = new RenderArea(piePath);
- renderAreas[4] = new RenderArea(polygonPath);
- renderAreas[5] = new RenderArea(groupPath);
- renderAreas[6] = new RenderArea(textPath);
- renderAreas[7] = new RenderArea(bezierPath);
- renderAreas[8] = new RenderArea(starPath);
- Q_ASSERT(NumRenderAreas == 9);
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
+ renderAreas.push_back(new RenderArea(rectPath));
+ renderAreas.push_back(new RenderArea(roundRectPath));
+ renderAreas.push_back(new RenderArea(ellipsePath));
+ renderAreas.push_back(new RenderArea(piePath));
+ renderAreas.push_back(new RenderArea(polygonPath));
+ renderAreas.push_back(new RenderArea(groupPath));
+#endif
+ renderAreas.push_back(new RenderArea(textPath));
+ renderAreas.push_back(new RenderArea(bezierPath));
+ renderAreas.push_back(new RenderArea(starPath));
//! [10]
//! [11]
@@ -201,19 +202,27 @@ Window::Window()
connect(penColorComboBox, SIGNAL(activated(int)),
this, SLOT(penColorChanged()));
- for (int i = 0; i < NumRenderAreas; ++i) {
+ for(QList<RenderArea*>::iterator it = renderAreas.begin(); it != renderAreas.end(); it++) {
connect(penWidthSpinBox, SIGNAL(valueChanged(int)),
- renderAreas[i], SLOT(setPenWidth(int)));
+ *it, SLOT(setPenWidth(int)));
connect(rotationAngleSpinBox, SIGNAL(valueChanged(int)),
- renderAreas[i], SLOT(setRotationAngle(int)));
+ *it, SLOT(setRotationAngle(int)));
}
//! [16] //! [17]
QGridLayout *topLayout = new QGridLayout;
- for (int i = 0; i < NumRenderAreas; ++i)
- topLayout->addWidget(renderAreas[i], i / 3, i % 3);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ topLayout->setSizeConstraint(QLayout::SetNoConstraint);
+#endif
+
+ int i=0;
+ for(QList<RenderArea*>::iterator it = renderAreas.begin(); it != renderAreas.end(); it++, i++)
+ topLayout->addWidget(*it, i / 3, i % 3);
QGridLayout *mainLayout = new QGridLayout;
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
+#endif
mainLayout->addLayout(topLayout, 0, 0, 1, 4);
mainLayout->addWidget(fillRuleLabel, 1, 0);
mainLayout->addWidget(fillRuleComboBox, 1, 1, 1, 3);
@@ -225,8 +234,10 @@ Window::Window()
mainLayout->addWidget(penWidthSpinBox, 3, 1, 1, 3);
mainLayout->addWidget(penColorLabel, 4, 0);
mainLayout->addWidget(penColorComboBox, 4, 1, 1, 3);
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
mainLayout->addWidget(rotationAngleLabel, 5, 0);
mainLayout->addWidget(rotationAngleSpinBox, 5, 1, 1, 3);
+#endif
setLayout(mainLayout);
//! [17]
@@ -245,8 +256,8 @@ void Window::fillRuleChanged()
{
Qt::FillRule rule = (Qt::FillRule)currentItemData(fillRuleComboBox).toInt();
- for (int i = 0; i < NumRenderAreas; ++i)
- renderAreas[i]->setFillRule(rule);
+ for(QList<RenderArea*>::iterator it = renderAreas.begin(); it != renderAreas.end(); it++)
+ (*it)->setFillRule(rule);
}
//! [19]
@@ -256,8 +267,8 @@ void Window::fillGradientChanged()
QColor color1 = qvariant_cast<QColor>(currentItemData(fillColor1ComboBox));
QColor color2 = qvariant_cast<QColor>(currentItemData(fillColor2ComboBox));
- for (int i = 0; i < NumRenderAreas; ++i)
- renderAreas[i]->setFillGradient(color1, color2);
+ for(QList<RenderArea*>::iterator it = renderAreas.begin(); it != renderAreas.end(); it++)
+ (*it)->setFillGradient(color1, color2);
}
//! [20]
@@ -266,8 +277,8 @@ void Window::penColorChanged()
{
QColor color = qvariant_cast<QColor>(currentItemData(penColorComboBox));
- for (int i = 0; i < NumRenderAreas; ++i)
- renderAreas[i]->setPenColor(color);
+ for(QList<RenderArea*>::iterator it = renderAreas.begin(); it != renderAreas.end(); it++)
+ (*it)->setPenColor(color);
}
//! [21]
diff --git a/examples/painting/painterpaths/window.h b/examples/painting/painterpaths/window.h
index 4891fdd153..b95cd93851 100644
--- a/examples/painting/painterpaths/window.h
+++ b/examples/painting/painterpaths/window.h
@@ -71,9 +71,7 @@ private:
//! [1]
//! [2]
- enum { NumRenderAreas = 9 };
-
- RenderArea *renderAreas[NumRenderAreas];
+ QList<RenderArea*> renderAreas;
QLabel *fillRuleLabel;
QLabel *fillGradientLabel;
QLabel *fillToLabel;
diff --git a/examples/painting/painting.pro b/examples/painting/painting.pro
index 229c1bee59..825c3b3bc6 100644
--- a/examples/painting/painting.pro
+++ b/examples/painting/painting.pro
@@ -3,9 +3,8 @@ SUBDIRS = basicdrawing \
concentriccircles \
imagecomposition \
painterpaths \
- transformations
-
-!wince*:!symbian: SUBDIRS += fontsampler
+ transformations \
+ fontsampler
contains(QT_CONFIG, svg): SUBDIRS += svggenerator svgviewer
@@ -15,4 +14,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS painting.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/painting
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/painting/svggenerator/main.cpp b/examples/painting/svggenerator/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/painting/svggenerator/main.cpp
+++ b/examples/painting/svggenerator/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/svggenerator/svggenerator.desktop b/examples/painting/svggenerator/svggenerator.desktop
new file mode 100644
index 0000000000..3ae32a4908
--- /dev/null
+++ b/examples/painting/svggenerator/svggenerator.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=SVG Generator
+Exec=/opt/usr/bin/svggenerator
+Icon=svggenerator
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/svggenerator/svggenerator.pro b/examples/painting/svggenerator/svggenerator.pro
index 2e67372299..ae8a26a20a 100644
--- a/examples/painting/svggenerator/svggenerator.pro
+++ b/examples/painting/svggenerator/svggenerator.pro
@@ -20,3 +20,5 @@ symbian {
TARGET.UID3 = 0xA000CF68
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/painting/svggenerator/window.cpp b/examples/painting/svggenerator/window.cpp
index f3e950ee89..eb3d1b49c9 100644
--- a/examples/painting/svggenerator/window.cpp
+++ b/examples/painting/svggenerator/window.cpp
@@ -49,6 +49,10 @@ Window::Window(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
+
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ this->layout()->setSizeConstraint(QLayout::SetDefaultConstraint);
+#endif
}
void Window::updateBackground(int background)
diff --git a/examples/painting/svgviewer/main.cpp b/examples/painting/svgviewer/main.cpp
index de5cc09828..bad6cd5f6d 100644
--- a/examples/painting/svgviewer/main.cpp
+++ b/examples/painting/svgviewer/main.cpp
@@ -57,6 +57,10 @@ int main(int argc, char **argv)
window.openFile(argv[1]);
else
window.openFile(":/files/bubbles.svg");
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/svgviewer/svgviewer.desktop b/examples/painting/svgviewer/svgviewer.desktop
new file mode 100644
index 0000000000..477ef789d8
--- /dev/null
+++ b/examples/painting/svgviewer/svgviewer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=SVG Viewer
+Exec=/opt/usr/bin/svgviewer
+Icon=svgviewer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro
index 6417849db8..0d938f4440 100644
--- a/examples/painting/svgviewer/svgviewer.pro
+++ b/examples/painting/svgviewer/svgviewer.pro
@@ -29,3 +29,5 @@ symbian: {
addFiles.path = .
DEPLOYMENT += addFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/painting/transformations/main.cpp b/examples/painting/transformations/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/painting/transformations/main.cpp
+++ b/examples/painting/transformations/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/painting/transformations/transformations.desktop b/examples/painting/transformations/transformations.desktop
new file mode 100644
index 0000000000..2f53891069
--- /dev/null
+++ b/examples/painting/transformations/transformations.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Transformations
+Exec=/opt/usr/bin/transformations
+Icon=transformations
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/painting/transformations/transformations.pro b/examples/painting/transformations/transformations.pro
index 91470f77a4..846fccbfc3 100644
--- a/examples/painting/transformations/transformations.pro
+++ b/examples/painting/transformations/transformations.pro
@@ -14,3 +14,8 @@ symbian {
TARGET.UID3 = 0xA000A64D
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/phonon/capabilities/capabilities.desktop b/examples/phonon/capabilities/capabilities.desktop
new file mode 100644
index 0000000000..e6e87d1ed2
--- /dev/null
+++ b/examples/phonon/capabilities/capabilities.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Capabilities
+Exec=/opt/usr/bin/capabilities
+Icon=capabilities
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/phonon/capabilities/capabilities.pro b/examples/phonon/capabilities/capabilities.pro
index d05e5ec080..82c895d34d 100644
--- a/examples/phonon/capabilities/capabilities.pro
+++ b/examples/phonon/capabilities/capabilities.pro
@@ -11,7 +11,14 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
INSTALLS += target sources
wince*{
-DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
+ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
-symbian:TARGET.UID3 = 0xA000CF69
+symbian {
+ TARGET.UID3 = 0xA000CF69
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/phonon/capabilities/main.cpp b/examples/phonon/capabilities/main.cpp
index 94e9cbc198..37d0a7701b 100644
--- a/examples/phonon/capabilities/main.cpp
+++ b/examples/phonon/capabilities/main.cpp
@@ -49,7 +49,11 @@ int main(int argv, char **args)
app.setApplicationName("Phonon Capabilities Example");
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/phonon/capabilities/window.cpp b/examples/phonon/capabilities/window.cpp
index 39ecf86637..f5321078fc 100644
--- a/examples/phonon/capabilities/window.cpp
+++ b/examples/phonon/capabilities/window.cpp
@@ -121,19 +121,43 @@ void Window::updateWidgets()
void Window::setupUi()
{
- setupBackendBox();
- QLayout *layout = new QVBoxLayout;
- layout->addWidget(backendBox);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ devicesListView = new QListView;
+ mimeListWidget = new QListWidget;
- setLayout(layout);
- setWindowTitle(tr("Backend Capabilities Example"));
-}
+ QStringList headerLabels;
+ headerLabels << tr("Type") << tr("Name") << tr("Description") <<
+ tr("Value Type") << tr("Default/Min/Max Values");
-void Window::setupBackendBox()
-{
- backendBox = new QGroupBox(tr("Backend Capabilities"));
+ effectsTreeWidget = new QTreeWidget;
+ effectsTreeWidget->setHeaderLabels(headerLabels);
+ effectsTreeWidget->setColumnCount(5);
+ QTabWidget *tabWidget = new QTabWidget;
+
+ QWidget *widgetDevices = new QWidget;
+ QVBoxLayout *devicesLayout = new QVBoxLayout;
+ devicesLayout->addWidget(devicesListView);
+ widgetDevices->setLayout(devicesLayout);
+
+ QWidget *widgetMimes = new QWidget;
+ QVBoxLayout *mimesLayout = new QVBoxLayout;
+ mimesLayout->addWidget(mimeListWidget);
+ widgetMimes->setLayout(mimesLayout);
+
+ QWidget *widgetEffects = new QWidget;
+ QVBoxLayout *effectsLayout = new QVBoxLayout;
+ effectsLayout->addWidget(effectsTreeWidget);
+ widgetEffects->setLayout(effectsLayout);
+
+ tabWidget->addTab(widgetDevices, tr("Audio Devices"));
+ tabWidget->addTab(widgetMimes, tr("MIME Types"));
+ tabWidget->addTab(widgetEffects, tr("Audio Effects"));
+
+ QLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(tabWidget);
+#else
devicesLabel = new QLabel(tr("Available Audio Devices:"));
devicesListView = new QListView;
@@ -151,6 +175,7 @@ void Window::setupBackendBox()
effectsTreeWidget->setColumnCount(5);
QGridLayout *layout = new QGridLayout;
+
layout->addWidget(devicesLabel, 0, 0);
layout->addWidget(devicesListView, 1, 0);
layout->addWidget(mimeTypesLabel, 0, 1);
@@ -161,5 +186,12 @@ void Window::setupBackendBox()
backendBox = new QGroupBox(tr("Backend Capabilities"));
backendBox->setLayout(layout);
-}
+ QLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(backendBox);
+#endif
+
+ setLayout(mainLayout);
+ setWindowTitle(tr("Backend Capabilities Example"));
+
+}
diff --git a/examples/phonon/capabilities/window.h b/examples/phonon/capabilities/window.h
index ce4e7d3481..9ef908f7e3 100644
--- a/examples/phonon/capabilities/window.h
+++ b/examples/phonon/capabilities/window.h
@@ -78,7 +78,6 @@ private slots:
private:
void setupUi();
- void setupBackendBox();
QGroupBox *backendBox;
diff --git a/examples/phonon/phonon.pro b/examples/phonon/phonon.pro
index c6a0bffe99..f74bcc1dba 100644
--- a/examples/phonon/phonon.pro
+++ b/examples/phonon/phonon.pro
@@ -12,4 +12,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS phonon.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/phonon/qmusicplayer/main.cpp b/examples/phonon/qmusicplayer/main.cpp
index 708135ff85..2c05692e9f 100644
--- a/examples/phonon/qmusicplayer/main.cpp
+++ b/examples/phonon/qmusicplayer/main.cpp
@@ -49,7 +49,11 @@ int main(int argv, char **args)
app.setQuitOnLastWindowClosed(true);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/phonon/qmusicplayer/qmusicplayer.desktop b/examples/phonon/qmusicplayer/qmusicplayer.desktop
new file mode 100644
index 0000000000..9ca0a19675
--- /dev/null
+++ b/examples/phonon/qmusicplayer/qmusicplayer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Music Player
+Exec=/opt/usr/bin/qmusicplayer
+Icon=qmusicplayer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/phonon/qmusicplayer/qmusicplayer.pro b/examples/phonon/qmusicplayer/qmusicplayer.pro
index 25ab7eb055..bc1808836c 100644
--- a/examples/phonon/qmusicplayer/qmusicplayer.pro
+++ b/examples/phonon/qmusicplayer/qmusicplayer.pro
@@ -11,7 +11,14 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/qmusicplayer
INSTALLS += target sources
wince*{
-DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
+ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
-symbian:TARGET.UID3 = 0xA000CF6A
+symbian {
+ TARGET.UID3 = 0xA000CF6A
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/qt.png b/examples/qt.png
new file mode 100644
index 0000000000..d27e30e154
--- /dev/null
+++ b/examples/qt.png
Binary files differ
diff --git a/examples/qt.svg b/examples/qt.svg
new file mode 100644
index 0000000000..566acfada0
--- /dev/null
+++ b/examples/qt.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/qtconcurrent/imagescaling/imagescaling.desktop b/examples/qtconcurrent/imagescaling/imagescaling.desktop
new file mode 100644
index 0000000000..289f56c51d
--- /dev/null
+++ b/examples/qtconcurrent/imagescaling/imagescaling.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QtConcurrent Image Scaling
+Exec=/opt/usr/bin/imagescaling
+Icon=imagescaling
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro
index c70013dbe5..78405020c0 100644
--- a/examples/qtconcurrent/imagescaling/imagescaling.pro
+++ b/examples/qtconcurrent/imagescaling/imagescaling.pro
@@ -15,3 +15,6 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qtconcurrent/imagescaling/main.cpp b/examples/qtconcurrent/imagescaling/main.cpp
index de64116f1c..d6ca7e57f0 100644
--- a/examples/qtconcurrent/imagescaling/main.cpp
+++ b/examples/qtconcurrent/imagescaling/main.cpp
@@ -48,16 +48,33 @@ int main(int argc, char *argv[])
QApplication app(argc,argv);
Images imageView;
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ imageView.showMaximized();
+#else
imageView.show();
+#endif
return app.exec();
}
#else
-int main()
+int main(int argc, char *argv[])
{
- qDebug() << "Qt Concurrent is not supported on this platform";
+ QApplication app(argc, argv);
+ QString text("Qt Concurrent is not supported on this platform");
+
+ QLabel *label = new QLabel(text);
+ label->setWordWrap(true);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ label->showMaximized();
+#else
+ label->show();
+#endif
+ qDebug() << text;
+
+ app.exec();
}
#endif
diff --git a/examples/qtconcurrent/map/main.cpp b/examples/qtconcurrent/map/main.cpp
index bb6c5c657a..76b14476f3 100644
--- a/examples/qtconcurrent/map/main.cpp
+++ b/examples/qtconcurrent/map/main.cpp
@@ -73,9 +73,24 @@ int main(int argc, char *argv[])
#else
-int main()
+#include <QLabel>
+
+int main(int argc, char *argv[])
{
- qDebug() << "Qt Concurrent is not yet supported on this platform";
+ QApplication app(argc, argv);
+ QString text("Qt Concurrent is not yet supported on this platform");
+
+ QLabel *label = new QLabel(text);
+ label->setWordWrap(true);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ label->showMaximized();
+#else
+ label->show();
+#endif
+ qDebug() << text;
+
+ app.exec();
}
#endif
diff --git a/examples/qtconcurrent/map/map.desktop b/examples/qtconcurrent/map/map.desktop
new file mode 100644
index 0000000000..7d8bba9e4b
--- /dev/null
+++ b/examples/qtconcurrent/map/map.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QtConcurrent Map
+Exec=/opt/usr/bin/map
+Icon=map
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtconcurrent/map/map.pro b/examples/qtconcurrent/map/map.pro
index e0b87f4e9b..6a81fc79a2 100644
--- a/examples/qtconcurrent/map/map.pro
+++ b/examples/qtconcurrent/map/map.pro
@@ -14,3 +14,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/map
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qtconcurrent/progressdialog/main.cpp b/examples/qtconcurrent/progressdialog/main.cpp
index 307baed45b..d302366380 100644
--- a/examples/qtconcurrent/progressdialog/main.cpp
+++ b/examples/qtconcurrent/progressdialog/main.cpp
@@ -90,9 +90,22 @@ int main(int argc, char **argv)
#else
-int main()
+int main(int argc, char *argv[])
{
- qDebug() << "Qt Concurrent is not yet supported on this platform";
+ QApplication app(argc, argv);
+ QString text("Qt Concurrent is not yet supported on this platform");
+
+ QLabel *label = new QLabel(text);
+ label->setWordWrap(true);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ label->showMaximized();
+#else
+ label->show();
+#endif
+ qDebug() << text;
+
+ app.exec();
}
#endif
diff --git a/examples/qtconcurrent/progressdialog/progressdialog.desktop b/examples/qtconcurrent/progressdialog/progressdialog.desktop
new file mode 100644
index 0000000000..5179471236
--- /dev/null
+++ b/examples/qtconcurrent/progressdialog/progressdialog.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QtConcurrent Progress Dialog
+Exec=/opt/usr/bin/progressdialog
+Icon=progressdialog
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtconcurrent/progressdialog/progressdialog.pro b/examples/qtconcurrent/progressdialog/progressdialog.pro
index ffdb4c73ba..19fc18c1d2 100644
--- a/examples/qtconcurrent/progressdialog/progressdialog.pro
+++ b/examples/qtconcurrent/progressdialog/progressdialog.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
@@ -14,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/progressdialog
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index 1157d25652..ea458e7c01 100644
--- a/examples/qtconcurrent/qtconcurrent.pro
+++ b/examples/qtconcurrent/qtconcurrent.pro
@@ -14,4 +14,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtconcurrent.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/qtconcurrent/runfunction/main.cpp b/examples/qtconcurrent/runfunction/main.cpp
index 1e448bb71d..86fdf80aa4 100644
--- a/examples/qtconcurrent/runfunction/main.cpp
+++ b/examples/qtconcurrent/runfunction/main.cpp
@@ -64,9 +64,24 @@ int main(int argc, char **argv)
#else
-int main()
+#include <QLabel>
+
+int main(int argc, char *argv[])
{
- qDebug() << "Qt Concurrent is not yet supported on this platform";
+ QApplication app(argc, argv);
+ QString text("Qt Concurrent is not yet supported on this platform");
+
+ QLabel *label = new QLabel(text);
+ label->setWordWrap(true);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ label->showMaximized();
+#else
+ label->show();
+#endif
+ qDebug() << text;
+
+ app.exec();
}
#endif
diff --git a/examples/qtconcurrent/runfunction/runfunction.desktop b/examples/qtconcurrent/runfunction/runfunction.desktop
new file mode 100644
index 0000000000..0c36f89586
--- /dev/null
+++ b/examples/qtconcurrent/runfunction/runfunction.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QtConcurrent Run Function
+Exec=/opt/usr/bin/runfunction
+Icon=runfunction
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro
index d312e2bbf7..ddd60f8eda 100644
--- a/examples/qtconcurrent/runfunction/runfunction.pro
+++ b/examples/qtconcurrent/runfunction/runfunction.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
@@ -14,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/runfunction
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp
index 035207c410..56be795c60 100644
--- a/examples/qtconcurrent/wordcount/main.cpp
+++ b/examples/qtconcurrent/wordcount/main.cpp
@@ -124,7 +124,11 @@ int main(int argc, char** argv)
{
QApplication app(argc, argv);
qDebug() << "finding files...";
+#ifdef Q_WS_MAEMO_5
+ QStringList files = findFiles("/usr/", QStringList() << "*.sh");
+#else
QStringList files = findFiles("../../", QStringList() << "*.cpp" << "*.h");
+#endif
qDebug() << files.count() << "files";
qDebug() << "warmup";
@@ -158,9 +162,24 @@ int main(int argc, char** argv)
#else
-int main()
+#include <QLabel>
+
+int main(int argc, char *argv[])
{
- qDebug() << "Qt Concurrent is not yet supported on this platform";
+ QApplication app(argc, argv);
+ QString text("Qt Concurrent is not yet supported on this platform");
+
+ QLabel *label = new QLabel(text);
+ label->setWordWrap(true);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ label->showMaximized();
+#else
+ label->show();
+#endif
+ qDebug() << text;
+
+ app.exec();
}
#endif
diff --git a/examples/qtconcurrent/wordcount/wordcount.desktop b/examples/qtconcurrent/wordcount/wordcount.desktop
new file mode 100644
index 0000000000..382d573583
--- /dev/null
+++ b/examples/qtconcurrent/wordcount/wordcount.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QtConcurrent Word Count
+Exec=/opt/usr/bin/wordcount
+Icon=wordcount
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtconcurrent/wordcount/wordcount.pro b/examples/qtconcurrent/wordcount/wordcount.pro
index 8cd0392165..000c90639a 100644
--- a/examples/qtconcurrent/wordcount/wordcount.pro
+++ b/examples/qtconcurrent/wordcount/wordcount.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
@@ -14,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/wordcount
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qtestlib/qtestlib.pro b/examples/qtestlib/qtestlib.pro
index 79bed8c401..2b79c0608b 100644
--- a/examples/qtestlib/qtestlib.pro
+++ b/examples/qtestlib/qtestlib.pro
@@ -7,4 +7,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtestlib.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/qtestlib/tutorial1/tutorial1.desktop b/examples/qtestlib/tutorial1/tutorial1.desktop
new file mode 100644
index 0000000000..4b0b5850f7
--- /dev/null
+++ b/examples/qtestlib/tutorial1/tutorial1.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Writing a Unit Test
+Exec=/opt/usr/bin/tutorial1
+Icon=tutorial1
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro
index 93b0ec608f..901ba94621 100644
--- a/examples/qtestlib/tutorial1/tutorial1.pro
+++ b/examples/qtestlib/tutorial1/tutorial1.pro
@@ -11,3 +11,8 @@ symbian {
TARGET.UID3 = 0xA000C60B
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/qtestlib/tutorial2/tutorial2.desktop b/examples/qtestlib/tutorial2/tutorial2.desktop
new file mode 100644
index 0000000000..df8e7817a1
--- /dev/null
+++ b/examples/qtestlib/tutorial2/tutorial2.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Data Driven Testing
+Exec=/opt/usr/bin/tutorial2
+Icon=tutorial2
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro
index eb79038fc4..903c39095b 100644
--- a/examples/qtestlib/tutorial2/tutorial2.pro
+++ b/examples/qtestlib/tutorial2/tutorial2.pro
@@ -11,3 +11,8 @@ symbian {
TARGET.UID3 = 0xA000C60C
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/qtestlib/tutorial3/tutorial3.desktop b/examples/qtestlib/tutorial3/tutorial3.desktop
new file mode 100644
index 0000000000..0522ca5f53
--- /dev/null
+++ b/examples/qtestlib/tutorial3/tutorial3.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simulating GUI Events
+Exec=/opt/usr/bin/tutorial3
+Icon=tutorial3
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro
index 603afd17f2..4329bfb180 100644
--- a/examples/qtestlib/tutorial3/tutorial3.pro
+++ b/examples/qtestlib/tutorial3/tutorial3.pro
@@ -11,3 +11,8 @@ symbian {
TARGET.UID3 = 0xA000C60D
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/qtestlib/tutorial4/tutorial4.desktop b/examples/qtestlib/tutorial4/tutorial4.desktop
new file mode 100644
index 0000000000..05b5678009
--- /dev/null
+++ b/examples/qtestlib/tutorial4/tutorial4.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Replaying GUI Events
+Exec=/opt/usr/bin/tutorial4
+Icon=tutorial4
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro
index 86958492d3..65dfe1589e 100644
--- a/examples/qtestlib/tutorial4/tutorial4.pro
+++ b/examples/qtestlib/tutorial4/tutorial4.pro
@@ -11,3 +11,8 @@ symbian {
TARGET.UID3 = 0xA000C60E
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/qtestlib/tutorial5/tutorial5.desktop b/examples/qtestlib/tutorial5/tutorial5.desktop
new file mode 100644
index 0000000000..9e8e6cf609
--- /dev/null
+++ b/examples/qtestlib/tutorial5/tutorial5.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Writing a Benchmark
+Exec=/opt/usr/bin/tutorial5
+Icon=tutorial5
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro
index 7f5e695abd..6670fbefd9 100644
--- a/examples/qtestlib/tutorial5/tutorial5.pro
+++ b/examples/qtestlib/tutorial5/tutorial5.pro
@@ -11,3 +11,8 @@ symbian {
TARGET.UID3 = 0xA000C60F
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/qws/dbscreen/dbscreen.desktop b/examples/qws/dbscreen/dbscreen.desktop
new file mode 100644
index 0000000000..1726e6cb8d
--- /dev/null
+++ b/examples/qws/dbscreen/dbscreen.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Double Buffered Graphics Driver
+Exec=/opt/usr/bin/dbscreen
+Icon=dbscreen
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro
index 172a02a5e7..faa05260ad 100644
--- a/examples/qws/dbscreen/dbscreen.pro
+++ b/examples/qws/dbscreen/dbscreen.pro
@@ -9,3 +9,7 @@ HEADERS = dbscreen.h
SOURCES = dbscreendriverplugin.cpp \
dbscreen.cpp
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qws/framebuffer/framebuffer.desktop b/examples/qws/framebuffer/framebuffer.desktop
new file mode 100644
index 0000000000..030f264cad
--- /dev/null
+++ b/examples/qws/framebuffer/framebuffer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Linux Framebuffer
+Exec=/opt/usr/bin/framebuffer
+Icon=framebuffer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro
index f9fe850aa9..6f5d6f63b8 100644
--- a/examples/qws/framebuffer/framebuffer.pro
+++ b/examples/qws/framebuffer/framebuffer.pro
@@ -9,3 +9,9 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qws/mousecalibration/mousecalibration.desktop b/examples/qws/mousecalibration/mousecalibration.desktop
new file mode 100644
index 0000000000..07c231e97c
--- /dev/null
+++ b/examples/qws/mousecalibration/mousecalibration.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Mouse Calibration
+Exec=/opt/usr/bin/mousecalibration
+Icon=mousecalibration
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro
index bd318537a3..4a0394b9a1 100644
--- a/examples/qws/mousecalibration/mousecalibration.pro
+++ b/examples/qws/mousecalibration/mousecalibration.pro
@@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qws/simpledecoration/simpledecoration.desktop b/examples/qws/simpledecoration/simpledecoration.desktop
new file mode 100644
index 0000000000..9cd588eb1d
--- /dev/null
+++ b/examples/qws/simpledecoration/simpledecoration.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple Decoration
+Exec=/opt/usr/bin/simpledecoration
+Icon=simpledecoration
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qws/simpledecoration/simpledecoration.pro b/examples/qws/simpledecoration/simpledecoration.pro
index b40987815c..a4e4afb71f 100644
--- a/examples/qws/simpledecoration/simpledecoration.pro
+++ b/examples/qws/simpledecoration/simpledecoration.pro
@@ -10,3 +10,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/simpledecoration
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/simpledecoration
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/qws/svgalib/svgalib.desktop b/examples/qws/svgalib/svgalib.desktop
new file mode 100644
index 0000000000..94ea92fd52
--- /dev/null
+++ b/examples/qws/svgalib/svgalib.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Accelerated Graphics Driver
+Exec=/opt/usr/bin/svgalib
+Icon=svgalib
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro
index 8a47c1d1d0..8bc53950d5 100644
--- a/examples/qws/svgalib/svgalib.pro
+++ b/examples/qws/svgalib/svgalib.pro
@@ -17,3 +17,9 @@ SOURCES = svgalibscreen.cpp \
svgalibpaintdevice.cpp \
svgalibplugin.cpp
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/richtext/calendar/calendar.desktop b/examples/richtext/calendar/calendar.desktop
new file mode 100644
index 0000000000..41ba6dd95a
--- /dev/null
+++ b/examples/richtext/calendar/calendar.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Calendar
+Exec=/opt/usr/bin/calendar
+Icon=calendar
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/richtext/calendar/calendar.pro b/examples/richtext/calendar/calendar.pro
index efb99b44ca..6df4376561 100644
--- a/examples/richtext/calendar/calendar.pro
+++ b/examples/richtext/calendar/calendar.pro
@@ -2,6 +2,9 @@ HEADERS = mainwindow.h
SOURCES = main.cpp \
mainwindow.cpp
+# App cannot be with name "calendar" in Symbian due to same named system component.
+symbian: TARGET = calendarapp
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/richtext/calendar
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendar.pro
@@ -9,3 +12,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/calendar
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/richtext/calendar/main.cpp b/examples/richtext/calendar/main.cpp
index b23e883e24..9c1141f0d1 100644
--- a/examples/richtext/calendar/main.cpp
+++ b/examples/richtext/calendar/main.cpp
@@ -46,7 +46,13 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ window.show();
+#else
window.resize(640, 256);
window.show();
+#endif
return app.exec();
}
diff --git a/examples/richtext/calendar/mainwindow.cpp b/examples/richtext/calendar/mainwindow.cpp
index 5117c03ae4..60d7c51595 100644
--- a/examples/richtext/calendar/mainwindow.cpp
+++ b/examples/richtext/calendar/mainwindow.cpp
@@ -70,7 +70,6 @@ MainWindow::MainWindow()
QLabel *fontSizeLabel = new QLabel(tr("Font size:"));
QSpinBox *fontSizeSpinBox = new QSpinBox;
fontSizeSpinBox->setRange(1, 64);
- fontSizeSpinBox->setValue(10);
editor = new QTextBrowser;
insertCalendar();
@@ -83,6 +82,12 @@ MainWindow::MainWindow()
this, SLOT(setFontSize(int)));
//! [3]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ fontSizeSpinBox->setValue(4);
+#else
+ fontSizeSpinBox->setValue(10);
+#endif
+
//! [4]
QHBoxLayout *controlsLayout = new QHBoxLayout;
controlsLayout->addWidget(dateLabel);
diff --git a/examples/richtext/orderform/detailsdialog.cpp b/examples/richtext/orderform/detailsdialog.cpp
index 9aa8535c5b..b12de14d30 100644
--- a/examples/richtext/orderform/detailsdialog.cpp
+++ b/examples/richtext/orderform/detailsdialog.cpp
@@ -53,8 +53,13 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent)
nameEdit = new QLineEdit;
addressEdit = new QTextEdit;
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ offersCheckBox = new QCheckBox(tr("Send information about\n"
+ "products and special offers"));
+#else
offersCheckBox = new QCheckBox(tr("Send information about products and "
"special offers"));
+#endif
setupItemsTable();
@@ -66,6 +71,30 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent)
//! [0]
//! [1]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QWidget *widgetSubscriber = new QWidget;
+ QGridLayout *subscriberLayout = new QGridLayout;
+ subscriberLayout->addWidget(nameLabel, 0, 0);
+ subscriberLayout->addWidget(nameEdit, 0, 1);
+ subscriberLayout->addWidget(addressLabel, 1, 0);
+ subscriberLayout->addWidget(addressEdit, 1, 1);
+ subscriberLayout->addWidget(offersCheckBox, 2, 0, 1, 2);
+ widgetSubscriber->setLayout(subscriberLayout);
+
+ QWidget *widgetOrder = new QWidget;
+ QVBoxLayout *orderLayout = new QVBoxLayout;
+ orderLayout->addWidget(itemsTable);
+ widgetOrder->setLayout(orderLayout);
+
+ QTabWidget *tabWidget = new QTabWidget;
+ tabWidget->addTab(widgetSubscriber, "Subscriber");
+ tabWidget->addTab(widgetOrder, "Order");
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(tabWidget);
+ mainLayout->addWidget(buttonBox);
+ setLayout(mainLayout);
+#else
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget(nameLabel, 0, 0);
mainLayout->addWidget(nameEdit, 0, 1);
@@ -75,6 +104,7 @@ DetailsDialog::DetailsDialog(const QString &title, QWidget *parent)
mainLayout->addWidget(offersCheckBox, 2, 1, 1, 2);
mainLayout->addWidget(buttonBox, 3, 0, 1, 3);
setLayout(mainLayout);
+#endif
setWindowTitle(title);
}
diff --git a/examples/richtext/orderform/main.cpp b/examples/richtext/orderform/main.cpp
index 3ad32b8e4e..a89aa76015 100644
--- a/examples/richtext/orderform/main.cpp
+++ b/examples/richtext/orderform/main.cpp
@@ -47,8 +47,14 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ windows.show();
+#else
window.resize(640, 480);
window.show();
+#endif
window.createSample();
return app.exec();
}
diff --git a/examples/richtext/orderform/orderform.desktop b/examples/richtext/orderform/orderform.desktop
new file mode 100644
index 0000000000..4690cbc876
--- /dev/null
+++ b/examples/richtext/orderform/orderform.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Order Form
+Exec=/opt/usr/bin/orderform
+Icon=orderform
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/richtext/orderform/orderform.pro b/examples/richtext/orderform/orderform.pro
index dee2855dfc..ebe2eceb0b 100644
--- a/examples/richtext/orderform/orderform.pro
+++ b/examples/richtext/orderform/orderform.pro
@@ -11,3 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/orderform
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/richtext/richtext.pro b/examples/richtext/richtext.pro
index 1440de2dd3..d4ac3780c0 100644
--- a/examples/richtext/richtext.pro
+++ b/examples/richtext/richtext.pro
@@ -11,4 +11,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS richtext.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/richtext/syntaxhighlighter/main.cpp b/examples/richtext/syntaxhighlighter/main.cpp
index eecfb12bdc..e0e5e4f407 100644
--- a/examples/richtext/syntaxhighlighter/main.cpp
+++ b/examples/richtext/syntaxhighlighter/main.cpp
@@ -46,7 +46,13 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ window.show();
+#else
window.resize(640, 512);
window.show();
+#endif
return app.exec();
}
diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.desktop b/examples/richtext/syntaxhighlighter/syntaxhighlighter.desktop
new file mode 100644
index 0000000000..2e3c833f0e
--- /dev/null
+++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Syntax Highlighter
+Exec=/opt/usr/bin/syntaxhighlighter
+Icon=syntaxhighlighter
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 67aa1ffedc..f2834bd1cc 100644
--- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -17,3 +17,5 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/richtext/textobject/main.cpp b/examples/richtext/textobject/main.cpp
index 2b95252238..1d1d4337d8 100644
--- a/examples/richtext/textobject/main.cpp
+++ b/examples/richtext/textobject/main.cpp
@@ -47,8 +47,10 @@ int main(int argv, char **args)
QApplication app(argv, args);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
-
+#endif
return app.exec();
}
-
diff --git a/examples/richtext/textobject/resources.qrc b/examples/richtext/textobject/resources.qrc
new file mode 100644
index 0000000000..39b2f5de4c
--- /dev/null
+++ b/examples/richtext/textobject/resources.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>files/heart.svg</file>
+ </qresource>
+</RCC>
diff --git a/examples/richtext/textobject/textobject.desktop b/examples/richtext/textobject/textobject.desktop
new file mode 100644
index 0000000000..1b0980fa32
--- /dev/null
+++ b/examples/richtext/textobject/textobject.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Text Object
+Exec=/opt/usr/bin/textobject
+Icon=textobject
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro
index 222b0fe34c..422770b096 100644
--- a/examples/richtext/textobject/textobject.pro
+++ b/examples/richtext/textobject/textobject.pro
@@ -6,13 +6,16 @@ SOURCES = main.cpp \
QT += svg
+RESOURCES = resources.qrc
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject
INSTALLS += target sources
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
filesToDeploy.files = files/*.svg
filesToDeploy.path = files
DEPLOYMENT += filesToDeploy
-
diff --git a/examples/richtext/textobject/window.cpp b/examples/richtext/textobject/window.cpp
index 7feb9185dc..e43ac284e1 100644
--- a/examples/richtext/textobject/window.cpp
+++ b/examples/richtext/textobject/window.cpp
@@ -96,7 +96,7 @@ void Window::setupGui()
fileNameLineEdit = new QLineEdit;
insertTextObjectButton = new QPushButton(tr("Insert Image"));
- fileNameLineEdit->setText("./files/heart.svg");
+ fileNameLineEdit->setText(":/files/heart.svg");
connect(insertTextObjectButton, SIGNAL(clicked()),
this, SLOT(insertTextObject()));
diff --git a/examples/script/calculator/calculator.desktop b/examples/script/calculator/calculator.desktop
new file mode 100644
index 0000000000..64d6f33463
--- /dev/null
+++ b/examples/script/calculator/calculator.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QtScript Calculator
+Exec=/opt/usr/bin/calculator
+Icon=calculator
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/calculator/calculator.pro b/examples/script/calculator/calculator.pro
index f328fc36cb..314b6b835a 100644
--- a/examples/script/calculator/calculator.pro
+++ b/examples/script/calculator/calculator.pro
@@ -13,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/calculator
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/script/calculator/calculator.ui b/examples/script/calculator/calculator.ui
index bb519ba2a6..42e612d9cf 100644
--- a/examples/script/calculator/calculator.ui
+++ b/examples/script/calculator/calculator.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>Calculator</class>
- <widget class="QWidget" name="Calculator" >
- <property name="geometry" >
+ <widget class="QWidget" name="Calculator">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,397 +10,406 @@
<height>301</height>
</rect>
</property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize" >
+ <property name="minimumSize">
<size>
<width>314</width>
<height>301</height>
</size>
</property>
- <property name="maximumSize" >
+ <property name="maximumSize">
<size>
- <width>314</width>
- <height>301</height>
+ <width>1024</width>
+ <height>768</height>
</size>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Calculator</string>
</property>
- <widget class="QToolButton" name="backspaceButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>50</y>
- <width>91</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>Backspace</string>
- </property>
- </widget>
- <widget class="QToolButton" name="clearButton" >
- <property name="geometry" >
- <rect>
- <x>110</x>
- <y>50</y>
- <width>91</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>Clear</string>
- </property>
- </widget>
- <widget class="QToolButton" name="clearAllButton" >
- <property name="geometry" >
- <rect>
- <x>210</x>
- <y>50</y>
- <width>91</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>Clear All</string>
- </property>
- </widget>
- <widget class="QToolButton" name="clearMemoryButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>100</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>MC</string>
- </property>
- </widget>
- <widget class="QToolButton" name="readMemoryButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>150</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>MR</string>
- </property>
- </widget>
- <widget class="QToolButton" name="setMemoryButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>200</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>MS</string>
- </property>
- </widget>
- <widget class="QToolButton" name="addToMemoryButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>250</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>M+</string>
- </property>
- </widget>
- <widget class="QToolButton" name="sevenButton" >
- <property name="geometry" >
- <rect>
- <x>60</x>
- <y>100</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>7</string>
- </property>
- </widget>
- <widget class="QToolButton" name="eightButton" >
- <property name="geometry" >
- <rect>
- <x>110</x>
- <y>100</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>8</string>
- </property>
- </widget>
- <widget class="QToolButton" name="nineButton" >
- <property name="geometry" >
- <rect>
- <x>160</x>
- <y>100</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>9</string>
- </property>
- </widget>
- <widget class="QToolButton" name="fourButton" >
- <property name="geometry" >
- <rect>
- <x>60</x>
- <y>150</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>4</string>
- </property>
- </widget>
- <widget class="QToolButton" name="fiveButton" >
- <property name="geometry" >
- <rect>
- <x>110</x>
- <y>150</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>5</string>
- </property>
- </widget>
- <widget class="QToolButton" name="sixButton" >
- <property name="geometry" >
- <rect>
- <x>160</x>
- <y>150</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>6</string>
- </property>
- </widget>
- <widget class="QToolButton" name="oneButton" >
- <property name="geometry" >
- <rect>
- <x>60</x>
- <y>200</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>1</string>
- </property>
- </widget>
- <widget class="QToolButton" name="twoButton" >
- <property name="geometry" >
- <rect>
- <x>110</x>
- <y>200</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>2</string>
- </property>
- </widget>
- <widget class="QToolButton" name="threeButton" >
- <property name="geometry" >
- <rect>
- <x>160</x>
- <y>200</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>3</string>
- </property>
- </widget>
- <widget class="QToolButton" name="zeroButton" >
- <property name="geometry" >
- <rect>
- <x>60</x>
- <y>250</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>0</string>
- </property>
- </widget>
- <widget class="QToolButton" name="pointButton" >
- <property name="geometry" >
- <rect>
- <x>110</x>
- <y>250</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>.</string>
- </property>
- </widget>
- <widget class="QToolButton" name="changeSignButton" >
- <property name="geometry" >
- <rect>
- <x>160</x>
- <y>250</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>+-</string>
- </property>
- </widget>
- <widget class="QToolButton" name="plusButton" >
- <property name="geometry" >
- <rect>
- <x>210</x>
- <y>250</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>+</string>
- </property>
- </widget>
- <widget class="QToolButton" name="divisionButton" >
- <property name="geometry" >
- <rect>
- <x>210</x>
- <y>100</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>/</string>
- </property>
- </widget>
- <widget class="QToolButton" name="timesButton" >
- <property name="geometry" >
- <rect>
- <x>210</x>
- <y>150</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>*</string>
- </property>
- </widget>
- <widget class="QToolButton" name="minusButton" >
- <property name="geometry" >
- <rect>
- <x>210</x>
- <y>200</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>-</string>
- </property>
- </widget>
- <widget class="QToolButton" name="squareRootButton" >
- <property name="geometry" >
- <rect>
- <x>260</x>
- <y>100</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>Sqrt</string>
- </property>
- </widget>
- <widget class="QToolButton" name="powerButton" >
- <property name="geometry" >
- <rect>
- <x>260</x>
- <y>150</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>x^2</string>
- </property>
- </widget>
- <widget class="QToolButton" name="reciprocalButton" >
- <property name="geometry" >
- <rect>
- <x>260</x>
- <y>200</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>1/x</string>
- </property>
- </widget>
- <widget class="QToolButton" name="equalButton" >
- <property name="geometry" >
- <rect>
- <x>260</x>
- <y>250</y>
- <width>41</width>
- <height>41</height>
- </rect>
- </property>
- <property name="text" >
- <string>=</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="display" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>10</y>
- <width>291</width>
- <height>31</height>
- </rect>
- </property>
- <property name="maxLength" >
- <number>15</number>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="spacing">
+ <number>10</number>
+ </property>
+ <item row="1" column="0" colspan="2">
+ <widget class="QToolButton" name="backspaceButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Backspace</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QToolButton" name="clearMemoryButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>MC</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QToolButton" name="sevenButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>7</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QToolButton" name="eightButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>8</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QToolButton" name="nineButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>9</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QToolButton" name="divisionButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>/</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5">
+ <widget class="QToolButton" name="squareRootButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Sqrt</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" colspan="2">
+ <widget class="QToolButton" name="clearButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Clear</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" colspan="2">
+ <widget class="QToolButton" name="clearAllButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Clear All</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="6">
+ <widget class="QLineEdit" name="display">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxLength">
+ <number>15</number>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QToolButton" name="readMemoryButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>MR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QToolButton" name="fourButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>4</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="QToolButton" name="fiveButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>5</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="QToolButton" name="sixButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>6</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="4">
+ <widget class="QToolButton" name="timesButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>*</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="5">
+ <widget class="QToolButton" name="powerButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>x^2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QToolButton" name="setMemoryButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>MS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QToolButton" name="oneButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2">
+ <widget class="QToolButton" name="twoButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="3">
+ <widget class="QToolButton" name="threeButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>3</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="4">
+ <widget class="QToolButton" name="minusButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>-</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="5">
+ <widget class="QToolButton" name="reciprocalButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>1/x</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QToolButton" name="addToMemoryButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>M+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QToolButton" name="zeroButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="2">
+ <widget class="QToolButton" name="pointButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="3">
+ <widget class="QToolButton" name="changeSignButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>+-</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="4">
+ <widget class="QToolButton" name="plusButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="5">
+ <widget class="QToolButton" name="equalButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>=</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
</widget>
<resources/>
<connections/>
diff --git a/examples/script/context2d/context2d.desktop b/examples/script/context2d/context2d.desktop
new file mode 100644
index 0000000000..16f7df276f
--- /dev/null
+++ b/examples/script/context2d/context2d.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Context2D
+Exec=/opt/usr/bin/context2d
+Icon=context2d
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/context2d/context2d.pro b/examples/script/context2d/context2d.pro
index 6a0e397368..85901d621a 100644
--- a/examples/script/context2d/context2d.pro
+++ b/examples/script/context2d/context2d.pro
@@ -30,3 +30,5 @@ symbian:{
contextScripts.files = scripts
DEPLOYMENT += contextScripts
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp
index 3d56910102..20df178869 100644
--- a/examples/script/context2d/main.cpp
+++ b/examples/script/context2d/main.cpp
@@ -48,7 +48,12 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
Window win;
+#ifdef Q_OS_SYMBIAN
+ bool smallScreen = true;
+#else
bool smallScreen = QApplication::arguments().contains("-small-screen");
+#endif
+
if (!smallScreen) {
win.show();
} else {
diff --git a/examples/script/context2d/qcontext2dcanvas.cpp b/examples/script/context2d/qcontext2dcanvas.cpp
index bb08b79837..f6799e8513 100644
--- a/examples/script/context2d/qcontext2dcanvas.cpp
+++ b/examples/script/context2d/qcontext2dcanvas.cpp
@@ -84,8 +84,8 @@ void QContext2DCanvas::contentsChanged(const QImage &image)
void QContext2DCanvas::paintEvent(QPaintEvent *e)
{
QPainter p(this);
-#ifdef Q_WS_S60
-// Draw white rect first since in with some themes the js-file content will produce black-on-black.
+#ifdef Q_OS_SYMBIAN
+ // Draw white rect first since in with some themes the js-file content will produce black-on-black.
QBrush whiteBgBrush(Qt::white);
p.fillRect(e->rect(), whiteBgBrush);
#endif
diff --git a/examples/script/customclass/customclass.desktop b/examples/script/customclass/customclass.desktop
new file mode 100644
index 0000000000..2e3ffa6c26
--- /dev/null
+++ b/examples/script/customclass/customclass.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Custom Script Class
+Exec=/opt/usr/bin/customclass
+Icon=customclass
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/customclass/customclass.pro b/examples/script/customclass/customclass.pro
index 3302d54965..b8b4c169e5 100644
--- a/examples/script/customclass/customclass.pro
+++ b/examples/script/customclass/customclass.pro
@@ -13,3 +13,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/customclass
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/script/defaultprototypes/code.js b/examples/script/defaultprototypes/code.js
index 048e1319df..5f776fbbf8 100644
--- a/examples/script/defaultprototypes/code.js
+++ b/examples/script/defaultprototypes/code.js
@@ -16,5 +16,3 @@ listWidget.currentItemChanged.connect(
}
);
//! [1]
-
-listWidget.show();
diff --git a/examples/script/defaultprototypes/defaultprototypes.desktop b/examples/script/defaultprototypes/defaultprototypes.desktop
new file mode 100644
index 0000000000..63815468dd
--- /dev/null
+++ b/examples/script/defaultprototypes/defaultprototypes.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Default Prototypes
+Exec=/opt/usr/bin/defaultprototypes
+Icon=defaultprototypes
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/defaultprototypes/defaultprototypes.pro b/examples/script/defaultprototypes/defaultprototypes.pro
index 7cf44d2a54..98954afd83 100644
--- a/examples/script/defaultprototypes/defaultprototypes.pro
+++ b/examples/script/defaultprototypes/defaultprototypes.pro
@@ -10,3 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/script/defaultprototypes/main.cpp b/examples/script/defaultprototypes/main.cpp
index 688bcd3980..8fc17e3510 100644
--- a/examples/script/defaultprototypes/main.cpp
+++ b/examples/script/defaultprototypes/main.cpp
@@ -79,5 +79,10 @@ int main(int argc, char **argv)
qWarning() << "line" << lineNo << ":" << result.toString();
}
+#if defined(Q_OS_SYMBIAN)
+ listWidget.showMaximized();
+#else
+ listWidget.show();
+#endif
return app.exec();
}
diff --git a/examples/script/defaultprototypes/prototypes.cpp b/examples/script/defaultprototypes/prototypes.cpp
index 5a3065bd2e..15c2661773 100644
--- a/examples/script/defaultprototypes/prototypes.cpp
+++ b/examples/script/defaultprototypes/prototypes.cpp
@@ -43,6 +43,7 @@
#include <QtGui/QListWidget>
#include <QtScript/QScriptValue>
#include <QtScript/QScriptEngine>
+#include <QDebug>
Q_DECLARE_METATYPE(QListWidgetItem*)
Q_DECLARE_METATYPE(QListWidget*)
@@ -100,10 +101,16 @@ void ListWidgetPrototype::setBackgroundColor(const QString &colorName)
{
QListWidget *widget = qscriptvalue_cast<QListWidget*>(thisObject());
if (widget) {
+#ifdef Q_WS_MAEMO_5
+ QString style = QString("QListWidget::item {background-color: %1;}").arg(colorName);
+ style += "QListWidget::item {selection-color: black;}";
+ widget->setStyleSheet(style);
+#else
QPalette palette = widget->palette();
QColor color(colorName);
palette.setBrush(QPalette::Base, color);
widget->setPalette(palette);
+#endif
}
}
//! [1]
diff --git a/examples/script/helloscript/helloscript.desktop b/examples/script/helloscript/helloscript.desktop
new file mode 100644
index 0000000000..7dafad9192
--- /dev/null
+++ b/examples/script/helloscript/helloscript.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Hello Script
+Exec=/opt/usr/bin/helloscript
+Icon=helloscript
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/helloscript/helloscript.pro b/examples/script/helloscript/helloscript.pro
index 850629e0bc..714218c08e 100644
--- a/examples/script/helloscript/helloscript.pro
+++ b/examples/script/helloscript/helloscript.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/script/helloscript/main.cpp b/examples/script/helloscript/main.cpp
index 3bf91a0c90..9c5b6315c1 100644
--- a/examples/script/helloscript/main.cpp
+++ b/examples/script/helloscript/main.cpp
@@ -78,6 +78,10 @@ int main(int argc, char *argv[])
scriptFile.close();
//! [3]
+#ifdef Q_OS_SYMBIAN
+ contents.replace("button.show()", "button.showMaximized()");
+#endif
+
//! [4]
QScriptValue result = engine.evaluate(contents, fileName);
//! [4]
diff --git a/examples/script/marshal/marshal.desktop b/examples/script/marshal/marshal.desktop
new file mode 100644
index 0000000000..8abed70ef2
--- /dev/null
+++ b/examples/script/marshal/marshal.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Qt Script Marshalling
+Exec=/opt/usr/bin/marshal
+Icon=marshal
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/marshal/marshal.pro b/examples/script/marshal/marshal.pro
index 4a1fc27fb5..b2784230cb 100644
--- a/examples/script/marshal/marshal.pro
+++ b/examples/script/marshal/marshal.pro
@@ -9,3 +9,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/marshal
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/script/qscript/qscript.desktop b/examples/script/qscript/qscript.desktop
new file mode 100644
index 0000000000..d580981ef8
--- /dev/null
+++ b/examples/script/qscript/qscript.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Qt Script Interpreter
+Exec=/opt/usr/bin/qscript
+Icon=qscript
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/qscript/qscript.pro b/examples/script/qscript/qscript.pro
index 4f334598ff..d88dcaa629 100644
--- a/examples/script/qscript/qscript.pro
+++ b/examples/script/qscript/qscript.pro
@@ -14,3 +14,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/qscript
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/script/qsdbg/qsdbg.desktop b/examples/script/qsdbg/qsdbg.desktop
new file mode 100644
index 0000000000..359b93c55b
--- /dev/null
+++ b/examples/script/qsdbg/qsdbg.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Qt Script Debugger
+Exec=/opt/usr/bin/qsdbg
+Icon=qsdbg
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/qsdbg/qsdbg.pro b/examples/script/qsdbg/qsdbg.pro
index 424e0fbd6d..3f03a4a61d 100644
--- a/examples/script/qsdbg/qsdbg.pro
+++ b/examples/script/qsdbg/qsdbg.pro
@@ -1,5 +1,4 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += script
@@ -17,3 +16,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/script/qsdbg
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/script/qstetrix/qstetrix.desktop b/examples/script/qstetrix/qstetrix.desktop
new file mode 100644
index 0000000000..4795b139fd
--- /dev/null
+++ b/examples/script/qstetrix/qstetrix.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Qt Script Tetrix
+Exec=/opt/usr/bin/qstetrix
+Icon=qstetrix
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/script/qstetrix/qstetrix.pro b/examples/script/qstetrix/qstetrix.pro
index 65d5a67194..345e919ff4 100644
--- a/examples/script/qstetrix/qstetrix.pro
+++ b/examples/script/qstetrix/qstetrix.pro
@@ -14,3 +14,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/qstetrix
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qstetrix.pro *.js
sources.path = $$[QT_INSTALL_EXAMPLES]/script/qstetrix
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/script/script.pro b/examples/script/script.pro
index a95ad132b1..690a69f9ba 100644
--- a/examples/script/script.pro
+++ b/examples/script/script.pro
@@ -14,4 +14,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS script.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/script
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/sql/cachedtable/cachedtable.desktop b/examples/sql/cachedtable/cachedtable.desktop
new file mode 100644
index 0000000000..aeec353e69
--- /dev/null
+++ b/examples/sql/cachedtable/cachedtable.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Cached Table
+Exec=/opt/usr/bin/cachedtable
+Icon=cachedtable
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/cachedtable/cachedtable.pro b/examples/sql/cachedtable/cachedtable.pro
index 288ec284e9..7059a1bb25 100644
--- a/examples/sql/cachedtable/cachedtable.pro
+++ b/examples/sql/cachedtable/cachedtable.pro
@@ -11,3 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/sql/cachedtable
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/sql/cachedtable/main.cpp b/examples/sql/cachedtable/main.cpp
index 26ddc42c54..ecbf565bab 100644
--- a/examples/sql/cachedtable/main.cpp
+++ b/examples/sql/cachedtable/main.cpp
@@ -51,7 +51,11 @@ int main(int argc, char *argv[])
return 1;
TableEditor editor("person");
+#if defined(Q_OS_SYMBIAN)
+ editor.showMaximized();
+#else
editor.show();
- return editor.exec();
+#endif
+ return app.exec();
}
//! [0]
diff --git a/examples/sql/cachedtable/tableeditor.cpp b/examples/sql/cachedtable/tableeditor.cpp
index 216f729d6f..083e5abb82 100644
--- a/examples/sql/cachedtable/tableeditor.cpp
+++ b/examples/sql/cachedtable/tableeditor.cpp
@@ -45,7 +45,7 @@
//! [0]
TableEditor::TableEditor(const QString &tableName, QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
model = new QSqlTableModel(this);
model->setTable(tableName);
@@ -59,6 +59,7 @@ TableEditor::TableEditor(const QString &tableName, QWidget *parent)
//! [0] //! [1]
QTableView *view = new QTableView;
view->setModel(model);
+ view->resizeColumnsToContents();
//! [1]
//! [2]
diff --git a/examples/sql/cachedtable/tableeditor.h b/examples/sql/cachedtable/tableeditor.h
index 14d9986c63..f13bd3d5bf 100644
--- a/examples/sql/cachedtable/tableeditor.h
+++ b/examples/sql/cachedtable/tableeditor.h
@@ -50,7 +50,7 @@ class QSqlTableModel;
QT_END_NAMESPACE
//! [0]
-class TableEditor : public QDialog
+class TableEditor : public QWidget
{
Q_OBJECT
diff --git a/examples/sql/drilldown/drilldown.desktop b/examples/sql/drilldown/drilldown.desktop
new file mode 100644
index 0000000000..b0f3ce0a9c
--- /dev/null
+++ b/examples/sql/drilldown/drilldown.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Drill Down
+Exec=/opt/usr/bin/drilldown
+Icon=drilldown
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro
index 5c97e88974..aaa3b84e8e 100644
--- a/examples/sql/drilldown/drilldown.pro
+++ b/examples/sql/drilldown/drilldown.pro
@@ -19,3 +19,6 @@ symbian {
TARGET.UID3 = 0xA000C612
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp
index 3f43a5901f..351b98dd0f 100644
--- a/examples/sql/drilldown/informationwindow.cpp
+++ b/examples/sql/drilldown/informationwindow.cpp
@@ -96,7 +96,11 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
locationId = id;
displayedImage = imageFileEditor->currentText();
- setWindowFlags(Qt::Window);
+ // Commented the following line. Now the window will look like dialog and the Qt will place the QDialogBox buttons to menu area in Symbian.
+ // Too bad that the revert button is missing, Should the Qt place the buttons under Option menu in the menu area?!
+ // If the Qt::Window flag was used, the background of window is white in symbian and the QLabels can't be regognized from the background.
+
+ //setWindowFlags(Qt::Window);
enableButtons(false);
setWindowTitle(tr("Office: %1").arg(locationText->text()));
}
diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp
index e3c8fa7cce..9bfa57cbc9 100644
--- a/examples/sql/drilldown/main.cpp
+++ b/examples/sql/drilldown/main.cpp
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
#ifndef Q_OS_SYMBIAN
view.show();
#else
- view.showFullScreen();
+ view.showMaximized();
#endif
#ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);
diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp
index 68fe06a8e2..883b28b094 100644
--- a/examples/sql/drilldown/view.cpp
+++ b/examples/sql/drilldown/view.cpp
@@ -62,7 +62,7 @@ View::View(const QString &offices, const QString &images, QWidget *parent)
QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png"));
logo->setPos(30, 515);
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
setMinimumSize(470, 620);
setMaximumSize(470, 620);
#else
diff --git a/examples/sql/masterdetail/main.cpp b/examples/sql/masterdetail/main.cpp
index fe3dd9db50..55151ebba8 100644
--- a/examples/sql/masterdetail/main.cpp
+++ b/examples/sql/masterdetail/main.cpp
@@ -54,6 +54,10 @@ int main(int argc, char *argv[])
QFile *albumDetails = new QFile("albumdetails.xml");
MainWindow window("artists", "albums", albumDetails);
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/sql/masterdetail/mainwindow.cpp b/examples/sql/masterdetail/mainwindow.cpp
index 24771bad09..522ee6ce02 100644
--- a/examples/sql/masterdetail/mainwindow.cpp
+++ b/examples/sql/masterdetail/mainwindow.cpp
@@ -77,8 +77,10 @@ MainWindow::MainWindow(const QString &artistTable, const QString &albumTable,
layout->addWidget(artists, 0, 0);
layout->addWidget(albums, 1, 0);
layout->addWidget(details, 0, 1, 2, 1);
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
layout->setColumnStretch(1, 1);
layout->setColumnMinimumWidth(0, 500);
+#endif
QWidget *widget = new QWidget;
widget->setLayout(layout);
@@ -86,7 +88,9 @@ MainWindow::MainWindow(const QString &artistTable, const QString &albumTable,
createMenuBar();
showImageLabel();
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
resize(850, 400);
+#endif
setWindowTitle(tr("Music Archive"));
}
diff --git a/examples/sql/masterdetail/masterdetail.desktop b/examples/sql/masterdetail/masterdetail.desktop
new file mode 100644
index 0000000000..6f8c3e5acd
--- /dev/null
+++ b/examples/sql/masterdetail/masterdetail.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Master Detail
+Exec=/opt/usr/bin/masterdetail
+Icon=masterdetail
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro
index 41a0274e02..43ddb2b84b 100644
--- a/examples/sql/masterdetail/masterdetail.pro
+++ b/examples/sql/masterdetail/masterdetail.pro
@@ -19,3 +19,8 @@ symbian {
TARGET.UID3 = 0xA000D7CF
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/sql/querymodel/main.cpp b/examples/sql/querymodel/main.cpp
index b6507e92c4..ac1a33f781 100644
--- a/examples/sql/querymodel/main.cpp
+++ b/examples/sql/querymodel/main.cpp
@@ -52,16 +52,23 @@ void initializeModel(QSqlQueryModel *model)
model->setHeaderData(2, Qt::Horizontal, QObject::tr("Last name"));
}
-void createView(const QString &title, QSqlQueryModel *model)
+QTableView* createView(QSqlQueryModel *model, const QString &title = "")
{
- static int offset = 0;
-
QTableView *view = new QTableView;
view->setModel(model);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ Q_UNUSED(title);
+ view->resizeColumnsToContents();
+#else
+ static int offset = 0;
+
view->setWindowTitle(title);
view->move(100 + offset, 100 + offset);
offset += 20;
view->show();
+#endif
+
+ return view;
}
int main(int argc, char *argv[])
@@ -78,9 +85,17 @@ int main(int argc, char *argv[])
initializeModel(&editableModel);
initializeModel(&customModel);
- createView(QObject::tr("Plain Query Model"), &plainModel);
- createView(QObject::tr("Editable Query Model"), &editableModel);
- createView(QObject::tr("Custom Query Model"), &customModel);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QTabWidget *tabWidget = new QTabWidget;
+ tabWidget->addTab(createView(&plainModel), QObject::tr("Plain"));
+ tabWidget->addTab(createView(&editableModel), QObject::tr("Editable"));
+ tabWidget->addTab(createView(&customModel), QObject::tr("Custom"));
+ tabWidget->showMaximized();
+#else
+ createView(&plainModel, QObject::tr("Plain Query Model"));
+ createView(&editableModel, QObject::tr("Editable Query Model"));
+ createView(&customModel, QObject::tr("Custom Query Model"));
+#endif
return app.exec();
}
diff --git a/examples/sql/querymodel/querymodel.desktop b/examples/sql/querymodel/querymodel.desktop
new file mode 100644
index 0000000000..8bba971814
--- /dev/null
+++ b/examples/sql/querymodel/querymodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Query Model
+Exec=/opt/usr/bin/querymodel
+Icon=querymodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/querymodel/querymodel.pro b/examples/sql/querymodel/querymodel.pro
index 32c217d2f5..3f3c707ebf 100644
--- a/examples/sql/querymodel/querymodel.pro
+++ b/examples/sql/querymodel/querymodel.pro
@@ -13,3 +13,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/sql/querymodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.cpp b/examples/sql/relationaltablemodel/relationaltablemodel.cpp
index ecb985e6b5..8b8ceff4d2 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.cpp
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.cpp
@@ -108,7 +108,11 @@ int main(int argc, char *argv[])
initializeModel(&model);
QTableView *view = createView(QObject::tr("Relational Table Model"), &model);
+#if defined(Q_OS_SYMBIAN)
+ view->showMaximized();
+#else
view->show();
+#endif
return app.exec();
}
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.desktop b/examples/sql/relationaltablemodel/relationaltablemodel.desktop
new file mode 100644
index 0000000000..8d5437d30c
--- /dev/null
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Relational Table Model
+Exec=/opt/usr/bin/relationaltablemodel
+Icon=relationaltablemodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.pro b/examples/sql/relationaltablemodel/relationaltablemodel.pro
index 32c04b6155..e3a2bd4b58 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.pro
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/sql/relationaltablemodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro
index 331a210573..ba88516a90 100644
--- a/examples/sql/sql.pro
+++ b/examples/sql/sql.pro
@@ -17,4 +17,3 @@ sources.files = connection.h sql.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/sql
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/sql/sqlwidgetmapper/main.cpp b/examples/sql/sqlwidgetmapper/main.cpp
index 41e756d8ad..9e45edefac 100644
--- a/examples/sql/sqlwidgetmapper/main.cpp
+++ b/examples/sql/sqlwidgetmapper/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.desktop b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.desktop
new file mode 100644
index 0000000000..c02e6bcb16
--- /dev/null
+++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=SQL Widget Mapper
+Exec=/opt/usr/bin/sqlwidgetmapper
+Icon=sqlwidgetmapper
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro
index c216a30b14..5b660f95d6 100644
--- a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro
+++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro
@@ -11,3 +11,6 @@ INSTALLS += target sources
wince*: DEPLOYMENT_PLUGIN += qsqlite
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/sql/tablemodel/tablemodel.cpp b/examples/sql/tablemodel/tablemodel.cpp
index 41a42bc31e..a107da07b0 100644
--- a/examples/sql/tablemodel/tablemodel.cpp
+++ b/examples/sql/tablemodel/tablemodel.cpp
@@ -54,11 +54,15 @@ void initializeModel(QSqlTableModel *model)
model->setHeaderData(2, Qt::Horizontal, QObject::tr("Last name"));
}
-QTableView *createView(const QString &title, QSqlTableModel *model)
+QTableView *createView(QSqlTableModel *model, const QString &title = "")
{
QTableView *view = new QTableView;
view->setModel(model);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ Q_UNUSED(title)
+#else
view->setWindowTitle(title);
+#endif
return view;
}
@@ -72,12 +76,20 @@ int main(int argc, char *argv[])
initializeModel(&model);
- QTableView *view1 = createView(QObject::tr("Table Model (View 1)"), &model);
- QTableView *view2 = createView(QObject::tr("Table Model (View 2)"), &model);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ QTabWidget *tabWidget = new QTabWidget;
+ tabWidget->addTab(createView(&model), "View 1");
+ tabWidget->addTab(createView(&model), "View 2");
+
+ tabWidget->showMaximized();
+#else
+ QTableView *view1 = createView(&model, QObject::tr("Table Model (View 1)"));
+ QTableView *view2 = createView(&model, QObject::tr("Table Model (View 2)"));
view1->show();
view2->move(view1->x() + view1->width() + 20, view1->y());
view2->show();
+#endif
return app.exec();
}
diff --git a/examples/sql/tablemodel/tablemodel.desktop b/examples/sql/tablemodel/tablemodel.desktop
new file mode 100644
index 0000000000..821fbd996f
--- /dev/null
+++ b/examples/sql/tablemodel/tablemodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Table Model
+Exec=/opt/usr/bin/tablemodel
+Icon=tablemodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/sql/tablemodel/tablemodel.pro b/examples/sql/tablemodel/tablemodel.pro
index 700029cecb..4785897fcb 100644
--- a/examples/sql/tablemodel/tablemodel.pro
+++ b/examples/sql/tablemodel/tablemodel.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/sql/tablemodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/statemachine/eventtransitions/eventtransitions.desktop b/examples/statemachine/eventtransitions/eventtransitions.desktop
new file mode 100644
index 0000000000..c1bceb2240
--- /dev/null
+++ b/examples/statemachine/eventtransitions/eventtransitions.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Event Transitions
+Exec=/opt/usr/bin/eventtransitions
+Icon=eventtransitions
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/eventtransitions/eventtransitions.pro b/examples/statemachine/eventtransitions/eventtransitions.pro
index 7e92cf2cff..c8b2213d67 100644
--- a/examples/statemachine/eventtransitions/eventtransitions.pro
+++ b/examples/statemachine/eventtransitions/eventtransitions.pro
@@ -5,3 +5,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/eventtransitions
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS eventtransitions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/eventtransitions
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/statemachine/eventtransitions/main.cpp b/examples/statemachine/eventtransitions/main.cpp
index 5391057992..5c0eb8218b 100644
--- a/examples/statemachine/eventtransitions/main.cpp
+++ b/examples/statemachine/eventtransitions/main.cpp
@@ -48,7 +48,12 @@ public:
: QWidget(parent)
{
QPushButton *button = new QPushButton(this);
- button->setGeometry(QRect(100, 100, 100, 100));
+ button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(button);
+ layout->setContentsMargins(80, 80, 80, 80);
+ setLayout(layout);
//! [0]
//! [1]
@@ -103,7 +108,11 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
Window window;
window.resize(300, 300);
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/statemachine/factorial/factorial.desktop b/examples/statemachine/factorial/factorial.desktop
new file mode 100644
index 0000000000..41b27227f9
--- /dev/null
+++ b/examples/statemachine/factorial/factorial.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Factorial States
+Exec=/opt/usr/bin/factorial
+Icon=factorial
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/factorial/factorial.pro b/examples/statemachine/factorial/factorial.pro
index 14a6833f08..aaab352b38 100644
--- a/examples/statemachine/factorial/factorial.pro
+++ b/examples/statemachine/factorial/factorial.pro
@@ -9,3 +9,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/factorial
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS factorial.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/factorial
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/statemachine/pingpong/pingpong.desktop b/examples/statemachine/pingpong/pingpong.desktop
new file mode 100644
index 0000000000..79646a2cc8
--- /dev/null
+++ b/examples/statemachine/pingpong/pingpong.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Ping Pong States
+Exec=/opt/usr/bin/pingpong
+Icon=pingpong
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/pingpong/pingpong.pro b/examples/statemachine/pingpong/pingpong.pro
index 42eab6c2cf..8a2417e7cf 100644
--- a/examples/statemachine/pingpong/pingpong.pro
+++ b/examples/statemachine/pingpong/pingpong.pro
@@ -9,3 +9,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pingpong.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/pingpong
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/statemachine/rogue/main.cpp b/examples/statemachine/rogue/main.cpp
index 71c2c69470..dc8783c67e 100644
--- a/examples/statemachine/rogue/main.cpp
+++ b/examples/statemachine/rogue/main.cpp
@@ -47,7 +47,11 @@ int main(int argv, char **args)
QApplication app(argv, args);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h
index 1153b7508d..be15e38647 100644
--- a/examples/statemachine/rogue/movementtransition.h
+++ b/examples/statemachine/rogue/movementtransition.h
@@ -68,7 +68,8 @@ protected:
int key = keyEvent->key();
return key == Qt::Key_2 || key == Qt::Key_8 || key == Qt::Key_6 ||
- key == Qt::Key_4;
+ key == Qt::Key_4 || key == Qt::Key_Down || key == Qt::Key_Up ||
+ key == Qt::Key_Right || key == Qt::Key_Left;
}
return false;
}
@@ -81,15 +82,19 @@ protected:
int key = keyEvent->key();
switch (key) {
+ case Qt::Key_Left:
case Qt::Key_4:
window->movePlayer(Window::Left);
break;
+ case Qt::Key_Up:
case Qt::Key_8:
window->movePlayer(Window::Up);
break;
+ case Qt::Key_Right:
case Qt::Key_6:
window->movePlayer(Window::Right);
break;
+ case Qt::Key_Down:
case Qt::Key_2:
window->movePlayer(Window::Down);
break;
diff --git a/examples/statemachine/rogue/rogue.desktop b/examples/statemachine/rogue/rogue.desktop
new file mode 100644
index 0000000000..71ca4b6511
--- /dev/null
+++ b/examples/statemachine/rogue/rogue.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Rogue
+Exec=/opt/usr/bin/rogue
+Icon=rogue
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/rogue/rogue.pro b/examples/statemachine/rogue/rogue.pro
index 15718540d8..9ef156423b 100644
--- a/examples/statemachine/rogue/rogue.pro
+++ b/examples/statemachine/rogue/rogue.pro
@@ -9,3 +9,6 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/rogue
INSTALLS += target sources
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/statemachine/rogue/window.cpp b/examples/statemachine/rogue/window.cpp
index 39f5aa65d9..f40b7a020e 100644
--- a/examples/statemachine/rogue/window.cpp
+++ b/examples/statemachine/rogue/window.cpp
@@ -52,16 +52,22 @@ Window::Window()
QFontDatabase database;
QFont font;
- if (database.families().contains("Monospace"))
- font = QFont("Monospace", 12);
+ if (database.families().contains("Monospace")) {
+ font = QFont("Monospace");
+ }
else {
foreach (QString family, database.families()) {
if (database.isFixedPitch(family)) {
- font = QFont(family, 12);
+ font = QFont(family);
break;
}
}
}
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ font.setPointSize(5);
+#else
+ font.setPointSize(12);
+#endif
setFont(font);
//![1]
diff --git a/examples/statemachine/rogue/window.h b/examples/statemachine/rogue/window.h
index 025ec79600..bdadad463d 100644
--- a/examples/statemachine/rogue/window.h
+++ b/examples/statemachine/rogue/window.h
@@ -49,8 +49,13 @@ class QStateMachine;
class QTransition;
QT_END_NAMESPACE
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+#define WIDTH 43
+#define HEIGHT 14
+#else
#define WIDTH 35
#define HEIGHT 20
+#endif
//![0]
class Window : public QWidget
diff --git a/examples/statemachine/trafficlight/main.cpp b/examples/statemachine/trafficlight/main.cpp
index 23cd34833a..c20e05926f 100644
--- a/examples/statemachine/trafficlight/main.cpp
+++ b/examples/statemachine/trafficlight/main.cpp
@@ -88,6 +88,9 @@ public:
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
+#ifdef Q_WS_MAEMO_5
+ vbox->setContentsMargins(320, 0, 320, 0);
+#endif
m_red = new LightWidget(Qt::red);
vbox->addWidget(m_red);
m_yellow = new LightWidget(Qt::yellow);
@@ -174,8 +177,14 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
TrafficLight widget;
+#if defined(Q_OS_SYMBIAN)
+ widget.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ widget.show();
+#else
widget.resize(110, 300);
widget.show();
+#endif
return app.exec();
}
diff --git a/examples/statemachine/trafficlight/trafficlight.desktop b/examples/statemachine/trafficlight/trafficlight.desktop
new file mode 100644
index 0000000000..8a5cc1673b
--- /dev/null
+++ b/examples/statemachine/trafficlight/trafficlight.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Traffic Light
+Exec=/opt/usr/bin/trafficlight
+Icon=trafficlight
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/trafficlight/trafficlight.pro b/examples/statemachine/trafficlight/trafficlight.pro
index 684575ac1f..e85fef8242 100644
--- a/examples/statemachine/trafficlight/trafficlight.pro
+++ b/examples/statemachine/trafficlight/trafficlight.pro
@@ -5,3 +5,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/trafficlight
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS trafficlight.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/trafficlight
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/statemachine/twowaybutton/main.cpp b/examples/statemachine/twowaybutton/main.cpp
index 6b9ce1fe55..47343ce494 100644
--- a/examples/statemachine/twowaybutton/main.cpp
+++ b/examples/statemachine/twowaybutton/main.cpp
@@ -74,8 +74,14 @@ int main(int argc, char **argv)
//! [4]
//! [5]
+#if defined(Q_OS_SYMBIAN)
+ button.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ button.show();
+#else
button.resize(100, 50);
button.show();
+#endif
return app.exec();
}
//! [5]
diff --git a/examples/statemachine/twowaybutton/twowaybutton.desktop b/examples/statemachine/twowaybutton/twowaybutton.desktop
new file mode 100644
index 0000000000..9dd0918937
--- /dev/null
+++ b/examples/statemachine/twowaybutton/twowaybutton.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Two-way Button
+Exec=/opt/usr/bin/twowaybutton
+Icon=twowaybutton
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/twowaybutton/twowaybutton.pro b/examples/statemachine/twowaybutton/twowaybutton.pro
index f6cbc57533..e6ea518fa9 100644
--- a/examples/statemachine/twowaybutton/twowaybutton.pro
+++ b/examples/statemachine/twowaybutton/twowaybutton.pro
@@ -5,3 +5,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/twowaybutton
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS twowaybutton.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/twowaybutton
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/symbianpkgrules.pri b/examples/symbianpkgrules.pri
index fe9b487d55..fceb6016de 100644
--- a/examples/symbianpkgrules.pri
+++ b/examples/symbianpkgrules.pri
@@ -17,4 +17,3 @@ DEPLOYMENT += examples_deployment
isEmpty(ICON):contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG, qt):!contains(CONFIG, "no_icon") {
ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
}
-
diff --git a/examples/threads/mandelbrot/main.cpp b/examples/threads/mandelbrot/main.cpp
index 610534d4a3..5211c2051c 100644
--- a/examples/threads/mandelbrot/main.cpp
+++ b/examples/threads/mandelbrot/main.cpp
@@ -47,7 +47,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MandelbrotWidget widget;
+#if defined(Q_WS_S60)
+ widget.showMaximized();
+#else
widget.show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/threads/mandelbrot/mandelbrot.desktop b/examples/threads/mandelbrot/mandelbrot.desktop
new file mode 100644
index 0000000000..3e70e1aa06
--- /dev/null
+++ b/examples/threads/mandelbrot/mandelbrot.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Mandelbrot
+Exec=/opt/usr/bin/mandelbrot
+Icon=mandelbrot
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro
index 2db886b800..aa14b46d80 100644
--- a/examples/threads/mandelbrot/mandelbrot.pro
+++ b/examples/threads/mandelbrot/mandelbrot.pro
@@ -13,3 +13,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/threads/mandelbrot/mandelbrotwidget.cpp b/examples/threads/mandelbrot/mandelbrotwidget.cpp
index 8dc1f5d811..47eb473425 100644
--- a/examples/threads/mandelbrot/mandelbrotwidget.cpp
+++ b/examples/threads/mandelbrot/mandelbrotwidget.cpp
@@ -44,6 +44,7 @@
#include "mandelbrotwidget.h"
+
//! [0]
const double DefaultCenterX = -0.637011f;
const double DefaultCenterY = -0.0395159f;
@@ -72,6 +73,21 @@ MandelbrotWidget::MandelbrotWidget(QWidget *parent)
setCursor(Qt::CrossCursor);
#endif
resize(550, 400);
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ ZoomButton *zoomIn = new ZoomButton(tr("Zoom In"), ZoomInFactor, this);
+ ZoomButton *zoomOut = new ZoomButton(tr("Zoom Out"), ZoomOutFactor, this);
+
+ QGridLayout *layout = new QGridLayout(this);
+ layout->addWidget(zoomIn, 0, 1);
+ layout->addWidget(zoomOut, 1, 1);
+ layout->setColumnStretch(0, 10);
+ layout->setRowStretch(2, 10);
+ setLayout(layout);
+
+ connect(zoomIn, SIGNAL(zoom(double)), this, SLOT(zoom(double)));
+ connect(zoomOut, SIGNAL(zoom(double)), this, SLOT(zoom(double)));
+#endif
}
//! [1]
@@ -113,6 +129,7 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
}
//! [8] //! [9]
+#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
QString text = tr("Use mouse wheel or the '+' and '-' keys to zoom. "
"Press and hold left mouse button to scroll.");
QFontMetrics metrics = painter.fontMetrics();
@@ -125,6 +142,7 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
painter.setPen(Qt::white);
painter.drawText((width() - textWidth) / 2,
metrics.leading() + metrics.ascent(), text);
+#endif
}
//! [9]
diff --git a/examples/threads/mandelbrot/mandelbrotwidget.h b/examples/threads/mandelbrot/mandelbrotwidget.h
index 5af3a8dffd..53bbeb6469 100644
--- a/examples/threads/mandelbrot/mandelbrotwidget.h
+++ b/examples/threads/mandelbrot/mandelbrotwidget.h
@@ -43,9 +43,35 @@
#include <QPixmap>
#include <QWidget>
-
#include "renderthread.h"
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+#include <QPushButton>
+
+class ZoomButton : public QPushButton
+{
+ Q_OBJECT
+public:
+ ZoomButton(const QString &text, double zoomFactor, QWidget *parent = NULL)
+ : QPushButton(text, parent), m_ZoomFactor(zoomFactor)
+ {
+ connect(this, SIGNAL(clicked()), this, SLOT(handleClick()));
+ }
+
+signals:
+ void zoom(double zoomFactor);
+
+private slots:
+ void handleClick()
+ {
+ emit zoom(m_ZoomFactor);
+ }
+
+private:
+ const double m_ZoomFactor;
+};
+#endif
+
//! [0]
class MandelbrotWidget : public QWidget
{
@@ -65,9 +91,9 @@ protected:
private slots:
void updatePixmap(const QImage &image, double scaleFactor);
+ void zoom(double zoomFactor);
private:
- void zoom(double zoomFactor);
void scroll(int deltaX, int deltaY);
RenderThread thread;
diff --git a/examples/threads/queuedcustomtype/main.cpp b/examples/threads/queuedcustomtype/main.cpp
index d70a88a095..356352a326 100644
--- a/examples/threads/queuedcustomtype/main.cpp
+++ b/examples/threads/queuedcustomtype/main.cpp
@@ -119,7 +119,11 @@ int main(int argc, char *argv[])
qsrand(QTime::currentTime().elapsed());
Window window;
+#if defined(Q_WS_S60)
+ window.showMaximized();
+#else
window.show();
+#endif
window.loadImage(createImage(256, 256));
//! [main finish]
diff --git a/examples/threads/queuedcustomtype/queuedcustomtype.desktop b/examples/threads/queuedcustomtype/queuedcustomtype.desktop
new file mode 100644
index 0000000000..fa5ed7aa35
--- /dev/null
+++ b/examples/threads/queuedcustomtype/queuedcustomtype.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Queued Custom Type
+Exec=/opt/usr/bin/queuedcustomtype
+Icon=queuedcustomtype
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/threads/queuedcustomtype/queuedcustomtype.pro b/examples/threads/queuedcustomtype/queuedcustomtype.pro
index 6f39121df7..9c9357892e 100644
--- a/examples/threads/queuedcustomtype/queuedcustomtype.pro
+++ b/examples/threads/queuedcustomtype/queuedcustomtype.pro
@@ -5,3 +5,13 @@ SOURCES = main.cpp \
block.cpp \
renderthread.cpp \
window.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/threads/semaphores/semaphores.cpp b/examples/threads/semaphores/semaphores.cpp
index 88630def09..3632895c61 100644
--- a/examples/threads/semaphores/semaphores.cpp
+++ b/examples/threads/semaphores/semaphores.cpp
@@ -38,13 +38,18 @@
**
****************************************************************************/
-#include <QtCore>
+#include <QtGui>
#include <stdio.h>
#include <stdlib.h>
//! [0]
+#ifdef Q_WS_S60
+const int DataSize = 300;
+#else
const int DataSize = 100000;
+#endif
+
const int BufferSize = 8192;
char buffer[BufferSize];
@@ -57,43 +62,70 @@ class Producer : public QThread
//! [1] //! [2]
{
public:
- void run();
-};
-
-void Producer::run()
-{
- qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
- for (int i = 0; i < DataSize; ++i) {
- freeBytes.acquire();
- buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4];
- usedBytes.release();
+ void run()
+ {
+ qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
+ for (int i = 0; i < DataSize; ++i) {
+ freeBytes.acquire();
+ buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4];
+ usedBytes.release();
+ }
}
-}
+};
//! [2]
//! [3]
class Consumer : public QThread
//! [3] //! [4]
{
+ Q_OBJECT
public:
- void run();
-};
-
-void Consumer::run()
-{
- for (int i = 0; i < DataSize; ++i) {
- usedBytes.acquire();
- fprintf(stderr, "%c", buffer[i % BufferSize]);
- freeBytes.release();
+ void run()
+ {
+ for (int i = 0; i < DataSize; ++i) {
+ usedBytes.acquire();
+ #ifdef Q_WS_S60
+ QString text(buffer[i % BufferSize]);
+ freeBytes.release();
+ emit stringConsumed(text);
+ #else
+ fprintf(stderr, "%c", buffer[i % BufferSize]);
+ freeBytes.release();
+ #endif
+ }
+ fprintf(stderr, "\n");
}
- fprintf(stderr, "\n");
-}
+
+signals:
+ void stringConsumed(const QString &text);
+
+protected:
+ bool finish;
+};
//! [4]
//! [5]
int main(int argc, char *argv[])
//! [5] //! [6]
{
+#ifdef Q_WS_S60
+ // Self made console for Symbian
+ QApplication app(argc, argv);
+ QPlainTextEdit console;
+ console.setReadOnly(true);
+ console.setTextInteractionFlags(Qt::NoTextInteraction);
+ console.showMaximized();
+
+ Producer producer;
+ Consumer consumer;
+
+ QObject::connect(&consumer, SIGNAL(stringConsumed(const QString&)), &console, SLOT(insertPlainText(QString)), Qt::BlockingQueuedConnection);
+
+ producer.start();
+ consumer.start();
+
+ app.exec();
+#else
QCoreApplication app(argc, argv);
Producer producer;
Consumer consumer;
@@ -102,5 +134,8 @@ int main(int argc, char *argv[])
producer.wait();
consumer.wait();
return 0;
+#endif
}
//! [6]
+
+#include "semaphores.moc"
diff --git a/examples/threads/semaphores/semaphores.desktop b/examples/threads/semaphores/semaphores.desktop
new file mode 100644
index 0000000000..a7dc46722f
--- /dev/null
+++ b/examples/threads/semaphores/semaphores.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Semaphores
+Exec=/opt/usr/bin/semaphores
+Icon=semaphores
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/threads/semaphores/semaphores.pro b/examples/threads/semaphores/semaphores.pro
index 85f73110ef..1cc3aceebb 100644
--- a/examples/threads/semaphores/semaphores.pro
+++ b/examples/threads/semaphores/semaphores.pro
@@ -1,5 +1,6 @@
SOURCES += semaphores.cpp
-QT = core
+QT = core gui
+
CONFIG -= app_bundle
CONFIG += console
@@ -10,3 +11,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/threads/semaphores
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/threads/threads.pro b/examples/threads/threads.pro
index feb72f0e0d..a23577f330 100644
--- a/examples/threads/threads.pro
+++ b/examples/threads/threads.pro
@@ -10,4 +10,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threads.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/threads
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/threads/waitconditions/waitconditions.cpp b/examples/threads/waitconditions/waitconditions.cpp
index 5c8cb7149f..0063db5b91 100644
--- a/examples/threads/waitconditions/waitconditions.cpp
+++ b/examples/threads/waitconditions/waitconditions.cpp
@@ -38,13 +38,18 @@
**
****************************************************************************/
-#include <QtCore>
+#include <QtGui>
#include <stdio.h>
#include <stdlib.h>
//! [0]
+#ifdef Q_WS_S60
+const int DataSize = 300;
+#else
const int DataSize = 100000;
+#endif
+
const int BufferSize = 8192;
char buffer[BufferSize];
@@ -59,60 +64,110 @@ class Producer : public QThread
//! [1] //! [2]
{
public:
- void run();
-};
+ Producer(QObject *parent = NULL) : QThread(parent)
+ {
+ }
-void Producer::run()
-{
- qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
-
- for (int i = 0; i < DataSize; ++i) {
- mutex.lock();
- if (numUsedBytes == BufferSize)
- bufferNotFull.wait(&mutex);
- mutex.unlock();
-
- buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4];
-
- mutex.lock();
- ++numUsedBytes;
- bufferNotEmpty.wakeAll();
- mutex.unlock();
+ void run()
+ {
+ qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
+
+ for (int i = 0; i < DataSize; ++i) {
+ mutex.lock();
+ if (numUsedBytes == BufferSize)
+ bufferNotFull.wait(&mutex);
+ mutex.unlock();
+
+ buffer[i % BufferSize] = "ACGT"[(int)qrand() % 4];
+
+ mutex.lock();
+ ++numUsedBytes;
+ bufferNotEmpty.wakeAll();
+ mutex.unlock();
+ }
}
-}
+};
//! [2]
//! [3]
class Consumer : public QThread
//! [3] //! [4]
{
+ Q_OBJECT
public:
- void run();
+ Consumer(QObject *parent = NULL) : QThread(parent)
+ {
+ }
+
+ void run()
+ {
+ for (int i = 0; i < DataSize; ++i) {
+ mutex.lock();
+ if (numUsedBytes == 0)
+ bufferNotEmpty.wait(&mutex);
+ mutex.unlock();
+
+ #ifdef Q_WS_S60
+ emit stringConsumed(QString(buffer[i % BufferSize]));
+ #else
+ fprintf(stderr, "%c", buffer[i % BufferSize]);
+ #endif
+
+ mutex.lock();
+ --numUsedBytes;
+ bufferNotFull.wakeAll();
+ mutex.unlock();
+ }
+ fprintf(stderr, "\n");
+ }
+
+signals:
+ void stringConsumed(const QString &text);
};
+//! [4]
-void Consumer::run()
+#ifdef Q_WS_S60
+class PlainTextEdit : public QPlainTextEdit
{
- for (int i = 0; i < DataSize; ++i) {
- mutex.lock();
- if (numUsedBytes == 0)
- bufferNotEmpty.wait(&mutex);
- mutex.unlock();
-
- fprintf(stderr, "%c", buffer[i % BufferSize]);
-
- mutex.lock();
- --numUsedBytes;
- bufferNotFull.wakeAll();
- mutex.unlock();
+ Q_OBJECT
+public:
+ PlainTextEdit(QWidget *parent = NULL) : QPlainTextEdit(parent), producer(NULL), consumer(NULL)
+ {
+ setTextInteractionFlags(Qt::NoTextInteraction);
+
+ producer = new Producer(this);
+ consumer = new Consumer(this);
+
+ QObject::connect(consumer, SIGNAL(stringConsumed(const QString &)), SLOT(insertPlainText(const QString &)), Qt::BlockingQueuedConnection);
+
+ QTimer::singleShot(0, this, SLOT(startThreads()));
}
- fprintf(stderr, "\n");
-}
-//! [4]
+
+protected:
+ Producer *producer;
+ Consumer *consumer;
+
+protected slots:
+ void startThreads()
+ {
+ producer->start();
+ consumer->start();
+ }
+};
+#endif
//! [5]
int main(int argc, char *argv[])
//! [5] //! [6]
{
+#ifdef Q_WS_S60
+ QApplication app(argc, argv);
+
+ PlainTextEdit console;
+ console.showMaximized();
+
+ return app.exec();
+#else
QCoreApplication app(argc, argv);
Producer producer;
Consumer consumer;
@@ -121,5 +176,8 @@ int main(int argc, char *argv[])
producer.wait();
consumer.wait();
return 0;
+#endif
}
//! [6]
+
+#include "waitconditions.moc"
diff --git a/examples/threads/waitconditions/waitconditions.desktop b/examples/threads/waitconditions/waitconditions.desktop
new file mode 100644
index 0000000000..4fbc3047d7
--- /dev/null
+++ b/examples/threads/waitconditions/waitconditions.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Wait Conditions
+Exec=/opt/usr/bin/waitconditions
+Icon=waitconditions
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro
index 4f5d1d472f..5329286a45 100644
--- a/examples/threads/waitconditions/waitconditions.pro
+++ b/examples/threads/waitconditions/waitconditions.pro
@@ -3,8 +3,8 @@
######################################################################
TEMPLATE = app
+QT = core gui
CONFIG -= moc app_bundle
-QT -= gui
DEPENDPATH += .
INCLUDEPATH += .
@@ -19,3 +19,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/codecs/codecs.desktop b/examples/tools/codecs/codecs.desktop
new file mode 100644
index 0000000000..bba62207f8
--- /dev/null
+++ b/examples/tools/codecs/codecs.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Codecs
+Exec=/opt/usr/bin/codecs
+Icon=codecs
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/codecs/codecs.pro b/examples/tools/codecs/codecs.pro
index 0c06997b62..a288e0f239 100644
--- a/examples/tools/codecs/codecs.pro
+++ b/examples/tools/codecs/codecs.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/codecs
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/completer/completer.desktop b/examples/tools/completer/completer.desktop
new file mode 100644
index 0000000000..f7e2d155d8
--- /dev/null
+++ b/examples/tools/completer/completer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Completer
+Exec=/opt/usr/bin/completer
+Icon=completer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/completer/completer.pro b/examples/tools/completer/completer.pro
index 14521b2b0d..be38a3fd1b 100644
--- a/examples/tools/completer/completer.pro
+++ b/examples/tools/completer/completer.pro
@@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/completer
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/contiguouscache/contiguouscache.desktop b/examples/tools/contiguouscache/contiguouscache.desktop
new file mode 100644
index 0000000000..e89e2067f4
--- /dev/null
+++ b/examples/tools/contiguouscache/contiguouscache.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Contiguous Cache
+Exec=/opt/usr/bin/contiguouscache
+Icon=contiguouscache
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/contiguouscache/contiguouscache.pro b/examples/tools/contiguouscache/contiguouscache.pro
index f840514f57..c4b69dc651 100644
--- a/examples/tools/contiguouscache/contiguouscache.pro
+++ b/examples/tools/contiguouscache/contiguouscache.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/contiguouscache
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS contiguouscache.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/contiguouscache
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/customcompleter/customcompleter.desktop b/examples/tools/customcompleter/customcompleter.desktop
new file mode 100644
index 0000000000..bbc21112ad
--- /dev/null
+++ b/examples/tools/customcompleter/customcompleter.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Custom Completer
+Exec=/opt/usr/bin/customcompleter
+Icon=customcompleter
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/customcompleter/customcompleter.pro b/examples/tools/customcompleter/customcompleter.pro
index 5ab784955d..07838b7065 100644
--- a/examples/tools/customcompleter/customcompleter.pro
+++ b/examples/tools/customcompleter/customcompleter.pro
@@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/customtype/customtype.desktop b/examples/tools/customtype/customtype.desktop
new file mode 100644
index 0000000000..ff15e19cb6
--- /dev/null
+++ b/examples/tools/customtype/customtype.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Custom Type
+Exec=/opt/usr/bin/customtype
+Icon=customtype
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/customtype/customtype.pro b/examples/tools/customtype/customtype.pro
index 3079964946..0871151237 100644
--- a/examples/tools/customtype/customtype.pro
+++ b/examples/tools/customtype/customtype.pro
@@ -1,3 +1,16 @@
HEADERS = message.h
SOURCES = main.cpp \
message.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro resources
+sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/customtypesending/customtypesending.desktop b/examples/tools/customtypesending/customtypesending.desktop
new file mode 100644
index 0000000000..dd59b4393a
--- /dev/null
+++ b/examples/tools/customtypesending/customtypesending.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Custom Type Sending
+Exec=/opt/usr/bin/customtypesending
+Icon=customtypesending
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/customtypesending/customtypesending.pro b/examples/tools/customtypesending/customtypesending.pro
index b8b2aaf5fe..0ad9aaaea8 100644
--- a/examples/tools/customtypesending/customtypesending.pro
+++ b/examples/tools/customtypesending/customtypesending.pro
@@ -3,3 +3,16 @@ HEADERS = message.h \
SOURCES = main.cpp \
message.cpp \
window.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro resources
+sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
+INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/echoplugin/echoplugin.pro b/examples/tools/echoplugin/echoplugin.pro
index 700e9e02c9..37529b4524 100644
--- a/examples/tools/echoplugin/echoplugin.pro
+++ b/examples/tools/echoplugin/echoplugin.pro
@@ -10,4 +10,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS echoplugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/tools/echoplugin/echowindow/echowindow.desktop b/examples/tools/echoplugin/echowindow/echowindow.desktop
new file mode 100644
index 0000000000..7b36de401d
--- /dev/null
+++ b/examples/tools/echoplugin/echowindow/echowindow.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Echo Window
+Exec=/opt/usr/bin/echowindow
+Icon=echowindow
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/echoplugin/echowindow/echowindow.pro b/examples/tools/echoplugin/echowindow/echowindow.pro
index 67c52378ad..a519679789 100644
--- a/examples/tools/echoplugin/echowindow/echowindow.pro
+++ b/examples/tools/echoplugin/echowindow/echowindow.pro
@@ -19,3 +19,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/echowindow
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/echoplugin/plugin/plugin.desktop b/examples/tools/echoplugin/plugin/plugin.desktop
new file mode 100644
index 0000000000..5aba4d1c87
--- /dev/null
+++ b/examples/tools/echoplugin/plugin/plugin.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Echo Plugin
+Exec=/opt/usr/bin/plugin
+Icon=plugin
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/echoplugin/plugin/plugin.pro b/examples/tools/echoplugin/plugin/plugin.pro
index cfc8a5fc7c..af531e32ef 100644
--- a/examples/tools/echoplugin/plugin/plugin.pro
+++ b/examples/tools/echoplugin/plugin/plugin.pro
@@ -14,6 +14,12 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/plugin
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.EPOCALLOWDLLDATA = 1
+}
-symbian:TARGET.EPOCALLOWDLLDATA = 1
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/i18n/i18n.desktop b/examples/tools/i18n/i18n.desktop
new file mode 100644
index 0000000000..e1632c4d04
--- /dev/null
+++ b/examples/tools/i18n/i18n.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=I18N
+Exec=/opt/usr/bin/i18n
+Icon=i18n
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/i18n/i18n.pro b/examples/tools/i18n/i18n.pro
index 69d7f045de..2435cea252 100644
--- a/examples/tools/i18n/i18n.pro
+++ b/examples/tools/i18n/i18n.pro
@@ -26,3 +26,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/i18n
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/inputpanel/inputpanel.desktop b/examples/tools/inputpanel/inputpanel.desktop
new file mode 100644
index 0000000000..3cc9bd078a
--- /dev/null
+++ b/examples/tools/inputpanel/inputpanel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Input Panel
+Exec=/opt/usr/bin/inputpanel
+Icon=inputpanel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/inputpanel/inputpanel.pro b/examples/tools/inputpanel/inputpanel.pro
index 3b3767fdff..f16c3a58cd 100644
--- a/examples/tools/inputpanel/inputpanel.pro
+++ b/examples/tools/inputpanel/inputpanel.pro
@@ -15,3 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/inputpanel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/plugandpaint/plugandpaint.desktop b/examples/tools/plugandpaint/plugandpaint.desktop
new file mode 100644
index 0000000000..e39d512225
--- /dev/null
+++ b/examples/tools/plugandpaint/plugandpaint.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Plug appnameplaceholder Paint
+Exec=/opt/usr/bin/plugandpaint
+Icon=plugandpaint
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/plugandpaint/plugandpaint.pro b/examples/tools/plugandpaint/plugandpaint.pro
index 9616eb8e2a..b14eec93d6 100644
--- a/examples/tools/plugandpaint/plugandpaint.pro
+++ b/examples/tools/plugandpaint/plugandpaint.pro
@@ -26,3 +26,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/plugandpaintplugins/basictools/basictools.pro b/examples/tools/plugandpaintplugins/basictools/basictools.pro
index 0ab9d90ff3..230c323f80 100644
--- a/examples/tools/plugandpaintplugins/basictools/basictools.pro
+++ b/examples/tools/plugandpaintplugins/basictools/basictools.pro
@@ -15,3 +15,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins/basictools
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
index e480dc1240..be4be0d9af 100644
--- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
@@ -17,3 +17,4 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
symbian:TARGET.EPOCALLOWDLLDATA = 1
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
index e157b66b79..efa9fb75f9 100644
--- a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
+++ b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/tools/regexp/regexp.desktop b/examples/tools/regexp/regexp.desktop
new file mode 100644
index 0000000000..b3ae14e360
--- /dev/null
+++ b/examples/tools/regexp/regexp.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Regular Expressions
+Exec=/opt/usr/bin/regexp
+Icon=regexp
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/regexp/regexp.pro b/examples/tools/regexp/regexp.pro
index 35756dad59..adc771c6ce 100644
--- a/examples/tools/regexp/regexp.pro
+++ b/examples/tools/regexp/regexp.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/regexp
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/settingseditor/settingseditor.desktop b/examples/tools/settingseditor/settingseditor.desktop
new file mode 100644
index 0000000000..b8561a6f3a
--- /dev/null
+++ b/examples/tools/settingseditor/settingseditor.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Settings Editor
+Exec=/opt/usr/bin/settingseditor
+Icon=settingseditor
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/settingseditor/settingseditor.pro b/examples/tools/settingseditor/settingseditor.pro
index 2ebdfe6520..c6471b56ba 100644
--- a/examples/tools/settingseditor/settingseditor.pro
+++ b/examples/tools/settingseditor/settingseditor.pro
@@ -15,3 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/settingseditor
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro
index 54e266c8af..d41dc5d433 100644
--- a/examples/tools/styleplugin/plugin/plugin.pro
+++ b/examples/tools/styleplugin/plugin/plugin.pro
@@ -23,3 +23,4 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
symbian:TARGET.EPOCALLOWDLLDATA = 1
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/tools/styleplugin/styleplugin.pro b/examples/tools/styleplugin/styleplugin.pro
index 1b9831e953..38e9cfc106 100644
--- a/examples/tools/styleplugin/styleplugin.pro
+++ b/examples/tools/styleplugin/styleplugin.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/tools/styleplugin/stylewindow/stylewindow.pro b/examples/tools/styleplugin/stylewindow/stylewindow.pro
index 8ed1541e00..353e7b22b5 100644
--- a/examples/tools/styleplugin/stylewindow/stylewindow.pro
+++ b/examples/tools/styleplugin/stylewindow/stylewindow.pro
@@ -17,3 +17,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/stylewindow
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/tools/tools.pro b/examples/tools/tools.pro
index 08d44e35af..6b31c12a56 100644
--- a/examples/tools/tools.pro
+++ b/examples/tools/tools.pro
@@ -23,4 +23,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tools.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tools
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/tools/treemodelcompleter/treemodelcompleter.desktop b/examples/tools/treemodelcompleter/treemodelcompleter.desktop
new file mode 100644
index 0000000000..a54aa7b66e
--- /dev/null
+++ b/examples/tools/treemodelcompleter/treemodelcompleter.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Tree Model Completer
+Exec=/opt/usr/bin/treemodelcompleter
+Icon=treemodelcompleter
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/treemodelcompleter/treemodelcompleter.pro b/examples/tools/treemodelcompleter/treemodelcompleter.pro
index 39c83f32bc..e06c12698f 100644
--- a/examples/tools/treemodelcompleter/treemodelcompleter.pro
+++ b/examples/tools/treemodelcompleter/treemodelcompleter.pro
@@ -12,3 +12,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/treemodelcompleter
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tools/undoframework/undoframework.desktop b/examples/tools/undoframework/undoframework.desktop
new file mode 100644
index 0000000000..24b7f320f4
--- /dev/null
+++ b/examples/tools/undoframework/undoframework.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Undo Framework
+Exec=/opt/usr/bin/undoframework
+Icon=undoframework
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tools/undoframework/undoframework.pro b/examples/tools/undoframework/undoframework.pro
index 5b7b666abd..2dd94049df 100644
--- a/examples/tools/undoframework/undoframework.pro
+++ b/examples/tools/undoframework/undoframework.pro
@@ -16,3 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tools/undoframework
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/touch/dials/dials.desktop b/examples/touch/dials/dials.desktop
new file mode 100644
index 0000000000..1536099914
--- /dev/null
+++ b/examples/touch/dials/dials.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Touch Dials
+Exec=/opt/usr/bin/dials
+Icon=dials
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/touch/dials/dials.pro b/examples/touch/dials/dials.pro
index 896315380c..c1f341cda2 100644
--- a/examples/touch/dials/dials.pro
+++ b/examples/touch/dials/dials.pro
@@ -6,3 +6,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/touch/dials
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dials.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/touch/dials
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/touch/fingerpaint/fingerpaint.desktop b/examples/touch/fingerpaint/fingerpaint.desktop
new file mode 100644
index 0000000000..a0bcf3128e
--- /dev/null
+++ b/examples/touch/fingerpaint/fingerpaint.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Finger Paint
+Exec=/opt/usr/bin/fingerpaint
+Icon=fingerpaint
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro
index f1c9d4c2df..893d0a53e2 100644
--- a/examples/touch/fingerpaint/fingerpaint.pro
+++ b/examples/touch/fingerpaint/fingerpaint.pro
@@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/touch/fingerpaint
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fingerpaint.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/touch/fingerpaint
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/touch/knobs/knobs.desktop b/examples/touch/knobs/knobs.desktop
new file mode 100644
index 0000000000..bf2fe32b24
--- /dev/null
+++ b/examples/touch/knobs/knobs.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Touch Knobs
+Exec=/opt/usr/bin/knobs
+Icon=knobs
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/touch/knobs/knobs.pro b/examples/touch/knobs/knobs.pro
index ef01c9a8bf..856a5ab280 100644
--- a/examples/touch/knobs/knobs.pro
+++ b/examples/touch/knobs/knobs.pro
@@ -6,3 +6,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/touch/knobs
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS knobs.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/touch/knobs
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/touch/pinchzoom/pinchzoom.desktop b/examples/touch/pinchzoom/pinchzoom.desktop
new file mode 100644
index 0000000000..727e626eed
--- /dev/null
+++ b/examples/touch/pinchzoom/pinchzoom.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Pinch Zoom
+Exec=/opt/usr/bin/pinchzoom
+Icon=pinchzoom
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/touch/pinchzoom/pinchzoom.pro b/examples/touch/pinchzoom/pinchzoom.pro
index 804536baa3..d500c9efe8 100644
--- a/examples/touch/pinchzoom/pinchzoom.pro
+++ b/examples/touch/pinchzoom/pinchzoom.pro
@@ -14,3 +14,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/touch/pinchzoom
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pinchzoom.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/touch/pinchzoom
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/addressbook-fr.pro b/examples/tutorials/addressbook-fr/addressbook-fr.pro
index 2cdd4587c4..7f46a955a2 100644
--- a/examples/tutorials/addressbook-fr/addressbook-fr.pro
+++ b/examples/tutorials/addressbook-fr/addressbook-fr.pro
@@ -6,3 +6,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook-fr
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS addressbook-fr.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook-fr
INSTALLS += target sources
+
diff --git a/examples/tutorials/addressbook-fr/part1/part1.desktop b/examples/tutorials/addressbook-fr/part1/part1.desktop
new file mode 100644
index 0000000000..0cf4115f33
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part1/part1.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=1 Address Book FR
+Exec=/opt/usr/bin/part1
+Icon=part1
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part1/part1.pro b/examples/tutorials/addressbook-fr/part1/part1.pro
index bb181dd392..0cb07c4577 100644
--- a/examples/tutorials/addressbook-fr/part1/part1.pro
+++ b/examples/tutorials/addressbook-fr/part1/part1.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part1.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/part2/part2.desktop b/examples/tutorials/addressbook-fr/part2/part2.desktop
new file mode 100644
index 0000000000..681c6a1e4d
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part2/part2.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=2 Address Book FR
+Exec=/opt/usr/bin/part2
+Icon=part2
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part2/part2.pro b/examples/tutorials/addressbook-fr/part2/part2.pro
index 01ce34465f..085b4d5f1c 100644
--- a/examples/tutorials/addressbook-fr/part2/part2.pro
+++ b/examples/tutorials/addressbook-fr/part2/part2.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/part3/part3.desktop b/examples/tutorials/addressbook-fr/part3/part3.desktop
new file mode 100644
index 0000000000..3c97d51f4e
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part3/part3.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=3 Address Book FR
+Exec=/opt/usr/bin/part3
+Icon=part3
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part3/part3.pro b/examples/tutorials/addressbook-fr/part3/part3.pro
index 128c0380e9..7a44905a28 100644
--- a/examples/tutorials/addressbook-fr/part3/part3.pro
+++ b/examples/tutorials/addressbook-fr/part3/part3.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part3.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/part4/part4.desktop b/examples/tutorials/addressbook-fr/part4/part4.desktop
new file mode 100644
index 0000000000..7726989689
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part4/part4.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=4 Address Book FR
+Exec=/opt/usr/bin/part4
+Icon=part4
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part4/part4.pro b/examples/tutorials/addressbook-fr/part4/part4.pro
index 23ce3e6008..72eb48e9a7 100644
--- a/examples/tutorials/addressbook-fr/part4/part4.pro
+++ b/examples/tutorials/addressbook-fr/part4/part4.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part4.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/part5/part5.desktop b/examples/tutorials/addressbook-fr/part5/part5.desktop
new file mode 100644
index 0000000000..0efcb1550c
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part5/part5.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=5 Address Book FR
+Exec=/opt/usr/bin/part5
+Icon=part5
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part5/part5.pro b/examples/tutorials/addressbook-fr/part5/part5.pro
index 95123d000e..5bd5bbd515 100644
--- a/examples/tutorials/addressbook-fr/part5/part5.pro
+++ b/examples/tutorials/addressbook-fr/part5/part5.pro
@@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part5.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/part6/part6.desktop b/examples/tutorials/addressbook-fr/part6/part6.desktop
new file mode 100644
index 0000000000..144025924a
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part6/part6.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=6 Address Book FR
+Exec=/opt/usr/bin/part6
+Icon=part6
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part6/part6.pro b/examples/tutorials/addressbook-fr/part6/part6.pro
index dc8956132a..51013232a6 100644
--- a/examples/tutorials/addressbook-fr/part6/part6.pro
+++ b/examples/tutorials/addressbook-fr/part6/part6.pro
@@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part6.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook-fr/part7/part7.desktop b/examples/tutorials/addressbook-fr/part7/part7.desktop
new file mode 100644
index 0000000000..f78ff4b221
--- /dev/null
+++ b/examples/tutorials/addressbook-fr/part7/part7.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=7 Address Book FR
+Exec=/opt/usr/bin/part7
+Icon=part7
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook-fr/part7/part7.pro b/examples/tutorials/addressbook-fr/part7/part7.pro
index a726d91003..461325bf0f 100644
--- a/examples/tutorials/addressbook-fr/part7/part7.pro
+++ b/examples/tutorials/addressbook-fr/part7/part7.pro
@@ -9,3 +9,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part7.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/addressbook.pro b/examples/tutorials/addressbook/addressbook.pro
index 70abcbba44..1069c41b87 100644
--- a/examples/tutorials/addressbook/addressbook.pro
+++ b/examples/tutorials/addressbook/addressbook.pro
@@ -7,4 +7,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS addressbook.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/tutorials/addressbook/part1/part1.desktop b/examples/tutorials/addressbook/part1/part1.desktop
new file mode 100644
index 0000000000..69946edf46
--- /dev/null
+++ b/examples/tutorials/addressbook/part1/part1.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=1 Address Book
+Exec=/opt/usr/bin/part1
+Icon=part1
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part1/part1.pro b/examples/tutorials/addressbook/part1/part1.pro
index 03d7f143dc..0cb07c4577 100644
--- a/examples/tutorials/addressbook/part1/part1.pro
+++ b/examples/tutorials/addressbook/part1/part1.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/part2/part2.desktop b/examples/tutorials/addressbook/part2/part2.desktop
new file mode 100644
index 0000000000..5c87ef807b
--- /dev/null
+++ b/examples/tutorials/addressbook/part2/part2.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=2 Address Book
+Exec=/opt/usr/bin/part2
+Icon=part2
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part2/part2.pro b/examples/tutorials/addressbook/part2/part2.pro
index e540b0b520..085b4d5f1c 100644
--- a/examples/tutorials/addressbook/part2/part2.pro
+++ b/examples/tutorials/addressbook/part2/part2.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/part3/part3.desktop b/examples/tutorials/addressbook/part3/part3.desktop
new file mode 100644
index 0000000000..882a242b44
--- /dev/null
+++ b/examples/tutorials/addressbook/part3/part3.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=3 Address Book
+Exec=/opt/usr/bin/part3
+Icon=part3
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part3/part3.pro b/examples/tutorials/addressbook/part3/part3.pro
index 35bfac96a5..7a44905a28 100644
--- a/examples/tutorials/addressbook/part3/part3.pro
+++ b/examples/tutorials/addressbook/part3/part3.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/part4/part4.desktop b/examples/tutorials/addressbook/part4/part4.desktop
new file mode 100644
index 0000000000..27802b10f2
--- /dev/null
+++ b/examples/tutorials/addressbook/part4/part4.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=4 Address Book
+Exec=/opt/usr/bin/part4
+Icon=part4
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part4/part4.pro b/examples/tutorials/addressbook/part4/part4.pro
index 7187d0dc2b..72eb48e9a7 100644
--- a/examples/tutorials/addressbook/part4/part4.pro
+++ b/examples/tutorials/addressbook/part4/part4.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/part5/part5.desktop b/examples/tutorials/addressbook/part5/part5.desktop
new file mode 100644
index 0000000000..e8b151c40f
--- /dev/null
+++ b/examples/tutorials/addressbook/part5/part5.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=5 Address Book
+Exec=/opt/usr/bin/part5
+Icon=part5
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part5/part5.pro b/examples/tutorials/addressbook/part5/part5.pro
index e7b7199292..5bd5bbd515 100644
--- a/examples/tutorials/addressbook/part5/part5.pro
+++ b/examples/tutorials/addressbook/part5/part5.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/part6/part6.desktop b/examples/tutorials/addressbook/part6/part6.desktop
new file mode 100644
index 0000000000..dd49260597
--- /dev/null
+++ b/examples/tutorials/addressbook/part6/part6.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=6 Address Book
+Exec=/opt/usr/bin/part6
+Icon=part6
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part6/part6.pro b/examples/tutorials/addressbook/part6/part6.pro
index f6ba4118b7..51013232a6 100644
--- a/examples/tutorials/addressbook/part6/part6.pro
+++ b/examples/tutorials/addressbook/part6/part6.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/addressbook/part7/part7.desktop b/examples/tutorials/addressbook/part7/part7.desktop
new file mode 100644
index 0000000000..26d3fdd292
--- /dev/null
+++ b/examples/tutorials/addressbook/part7/part7.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=7 Address Book
+Exec=/opt/usr/bin/part7
+Icon=part7
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/addressbook/part7/part7.pro b/examples/tutorials/addressbook/part7/part7.pro
index d2b089eece..461325bf0f 100644
--- a/examples/tutorials/addressbook/part7/part7.pro
+++ b/examples/tutorials/addressbook/part7/part7.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
index 03f0384b25..add6a63b99 100644
--- a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
@@ -54,4 +54,4 @@ void DialogPlugin::registerTypes(const char *uri){
}
//FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs
-Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin); \ No newline at end of file
+Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
index 338c742f2c..fe1be107be 100644
--- a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
@@ -216,4 +216,4 @@ void Directory::refresh(){
}
m_fileList.append(file);
}
-} \ No newline at end of file
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
index afbb33083f..2844274b24 100644
--- a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
@@ -53,4 +53,4 @@ void File::setName(const QString &str){
m_name = str;
emit nameChanged();
}
-} \ No newline at end of file
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
index 09bd03960e..200d6fbfa1 100644
--- a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
@@ -64,4 +64,4 @@ class File : public QObject{
QString m_name;
};
-#endif \ No newline at end of file
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQt/part1/part1.pro b/examples/tutorials/gettingStarted/gsQt/part1/part1.pro
new file mode 100755
index 0000000000..f52a6331b5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQt/part1/part1.pro
@@ -0,0 +1,8 @@
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/gettingStarted/gsQt/part1
+sources.files = $$SOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/tutorial/gettingStarted/gsQt/part1
+INSTALLS += target sources
+
diff --git a/examples/tutorials/gettingStarted/gsQt/part2/part2.pro b/examples/tutorials/gettingStarted/gsQt/part2/part2.pro
new file mode 100755
index 0000000000..383c3ce5ba
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQt/part2/part2.pro
@@ -0,0 +1,9 @@
+
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/gettingStarted/gsQt/part2
+sources.files = $$SOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/tutorial/gettingStarted/gsQt/part2
+INSTALLS += target sources
+
diff --git a/examples/tutorials/gettingStarted/gsQt/part3/part3.pro b/examples/tutorials/gettingStarted/gsQt/part3/part3.pro
new file mode 100755
index 0000000000..d194acb2e2
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQt/part3/part3.pro
@@ -0,0 +1,9 @@
+
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/gettingStarted/gsQt/part3
+sources.files = $$SOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/tutorial/gettingStarted/gsQt/part3
+INSTALLS += target sources
+
diff --git a/examples/tutorials/gettingStarted/gsQt/part4/part4.pro b/examples/tutorials/gettingStarted/gsQt/part4/part4.pro
new file mode 100755
index 0000000000..3de03accc0
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQt/part4/part4.pro
@@ -0,0 +1,9 @@
+
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/gettingStarted/gsQt/part4
+sources.files = $$SOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/tutorial/gettingStarted/gsQt/part4
+INSTALLS += target sources
+
diff --git a/examples/tutorials/gettingStarted/gsQt/part5/part5.pro b/examples/tutorials/gettingStarted/gsQt/part5/part5.pro
new file mode 100755
index 0000000000..711cac212a
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQt/part5/part5.pro
@@ -0,0 +1,9 @@
+
+SOURCES = main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/gettingStarted/gsQt/part5
+sources.files = $$SOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/tutorial/gettingStarted/gsQt/part5
+INSTALLS += target sources
+
diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.desktop b/examples/tutorials/modelview/1_readonly/1_readonly.desktop
new file mode 100644
index 0000000000..137f56eacd
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/1_readonly.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=1 Model View
+Exec=/opt/usr/bin/1_readonly
+Icon=1_readonly
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro
index 3ecebc2de2..1178aade0b 100755
--- a/examples/tutorials/modelview/1_readonly/1_readonly.pro
+++ b/examples/tutorials/modelview/1_readonly/1_readonly.pro
@@ -15,3 +15,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/1_readonly
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.desktop b/examples/tutorials/modelview/2_formatting/2_formatting.desktop
new file mode 100644
index 0000000000..a3950001ba
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/2_formatting.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=2 Model View
+Exec=/opt/usr/bin/2_formatting
+Icon=2_formatting
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.pro b/examples/tutorials/modelview/2_formatting/2_formatting.pro
index c6ad27c906..98caab7277 100755
--- a/examples/tutorials/modelview/2_formatting/2_formatting.pro
+++ b/examples/tutorials/modelview/2_formatting/2_formatting.pro
@@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/2_formatting
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.desktop b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.desktop
new file mode 100644
index 0000000000..3e053c94b1
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=3 Model View
+Exec=/opt/usr/bin/3_changingmodel
+Icon=3_changingmodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
index e977731971..3b338ddbad 100755
--- a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
+++ b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
@@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/3_changingmodel
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/4_headers/4_headers.desktop b/examples/tutorials/modelview/4_headers/4_headers.desktop
new file mode 100644
index 0000000000..f17fe456f2
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/4_headers.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=4 Model View
+Exec=/opt/usr/bin/4_headers
+Icon=4_headers
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/4_headers/4_headers.pro b/examples/tutorials/modelview/4_headers/4_headers.pro
index f6c60b275f..6f93c621be 100755
--- a/examples/tutorials/modelview/4_headers/4_headers.pro
+++ b/examples/tutorials/modelview/4_headers/4_headers.pro
@@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/4_headers
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/5_edit/5_edit.desktop b/examples/tutorials/modelview/5_edit/5_edit.desktop
new file mode 100644
index 0000000000..4402c0a379
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/5_edit.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=5 Model View
+Exec=/opt/usr/bin/5_edit
+Icon=5_edit
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/5_edit/5_edit.pro b/examples/tutorials/modelview/5_edit/5_edit.pro
index 2ef343f078..6d273064c3 100755
--- a/examples/tutorials/modelview/5_edit/5_edit.pro
+++ b/examples/tutorials/modelview/5_edit/5_edit.pro
@@ -16,3 +16,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/5_edit
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.desktop b/examples/tutorials/modelview/6_treeview/6_treeview.desktop
new file mode 100644
index 0000000000..e0b872bf9c
--- /dev/null
+++ b/examples/tutorials/modelview/6_treeview/6_treeview.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=6 Model View
+Exec=/opt/usr/bin/6_treeview
+Icon=6_treeview
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.pro b/examples/tutorials/modelview/6_treeview/6_treeview.pro
index e79ef200d4..0acd8c12a7 100755
--- a/examples/tutorials/modelview/6_treeview/6_treeview.pro
+++ b/examples/tutorials/modelview/6_treeview/6_treeview.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/6_treeview
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/7_selections/7_selections.desktop b/examples/tutorials/modelview/7_selections/7_selections.desktop
new file mode 100644
index 0000000000..afba38361f
--- /dev/null
+++ b/examples/tutorials/modelview/7_selections/7_selections.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=7 Model View
+Exec=/opt/usr/bin/7_selections
+Icon=7_selections
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/modelview/7_selections/7_selections.pro b/examples/tutorials/modelview/7_selections/7_selections.pro
index 6945bf77b3..4a90751137 100755
--- a/examples/tutorials/modelview/7_selections/7_selections.pro
+++ b/examples/tutorials/modelview/7_selections/7_selections.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview/7_selections
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/modelview/modelview.pro b/examples/tutorials/modelview/modelview.pro
index 50f5c3ae77..1ee7574e73 100755
--- a/examples/tutorials/modelview/modelview.pro
+++ b/examples/tutorials/modelview/modelview.pro
@@ -13,4 +13,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS modelview.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/modelview
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/tutorials/tutorials.pro b/examples/tutorials/tutorials.pro
index 1b4667ea8f..ba1769deb4 100644
--- a/examples/tutorials/tutorials.pro
+++ b/examples/tutorials/tutorials.pro
@@ -10,4 +10,3 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials
INSTALLS += sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/tutorials/widgets/childwidget/childwidget.desktop b/examples/tutorials/widgets/childwidget/childwidget.desktop
new file mode 100644
index 0000000000..81bc7c16f1
--- /dev/null
+++ b/examples/tutorials/widgets/childwidget/childwidget.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Child Widgets
+Exec=/opt/usr/bin/childwidget
+Icon=childwidget
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/widgets/childwidget/childwidget.pro b/examples/tutorials/widgets/childwidget/childwidget.pro
index 37ae98e085..9e63c837b0 100644
--- a/examples/tutorials/widgets/childwidget/childwidget.pro
+++ b/examples/tutorials/widgets/childwidget/childwidget.pro
@@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/childwidget
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS childwidget.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/childwidget
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.desktop b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.desktop
new file mode 100644
index 0000000000..9ff737d079
--- /dev/null
+++ b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Nested Layouts
+Exec=/opt/usr/bin/nestedlayouts
+Icon=nestedlayouts
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro
index a7f141c98c..4c036cda62 100644
--- a/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro
+++ b/examples/tutorials/widgets/nestedlayouts/nestedlayouts.pro
@@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/nestedlayouts
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS nestedlayouts.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/nestedlayouts
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/widgets/toplevel/toplevel.desktop b/examples/tutorials/widgets/toplevel/toplevel.desktop
new file mode 100644
index 0000000000..5626297c67
--- /dev/null
+++ b/examples/tutorials/widgets/toplevel/toplevel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Creating a Window
+Exec=/opt/usr/bin/toplevel
+Icon=toplevel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/widgets/toplevel/toplevel.pro b/examples/tutorials/widgets/toplevel/toplevel.pro
index 58d59c5c8a..36fcf12a1e 100644
--- a/examples/tutorials/widgets/toplevel/toplevel.pro
+++ b/examples/tutorials/widgets/toplevel/toplevel.pro
@@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/toplevel
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS toplevel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/toplevel
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/tutorials/widgets/windowlayout/windowlayout.desktop b/examples/tutorials/widgets/windowlayout/windowlayout.desktop
new file mode 100644
index 0000000000..4a007952fd
--- /dev/null
+++ b/examples/tutorials/widgets/windowlayout/windowlayout.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Using Layouts
+Exec=/opt/usr/bin/windowlayout
+Icon=windowlayout
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/tutorials/widgets/windowlayout/windowlayout.pro b/examples/tutorials/widgets/windowlayout/windowlayout.pro
index 408f6ef9c0..624c27ecad 100644
--- a/examples/tutorials/widgets/windowlayout/windowlayout.pro
+++ b/examples/tutorials/widgets/windowlayout/windowlayout.pro
@@ -5,3 +5,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/windowlayout
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS windowlayout.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/widgets/windowlayout
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/uitools/multipleinheritance/main.cpp b/examples/uitools/multipleinheritance/main.cpp
index f61c92c1c4..56ba8efe53 100644
--- a/examples/uitools/multipleinheritance/main.cpp
+++ b/examples/uitools/multipleinheritance/main.cpp
@@ -46,7 +46,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
CalculatorForm calculator;
+#if defined(Q_OS_SYMBIAN)
+ calculator.showMaximized();
+#else
calculator.show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/uitools/multipleinheritance/multipleinheritance.desktop b/examples/uitools/multipleinheritance/multipleinheritance.desktop
new file mode 100644
index 0000000000..7e652f972b
--- /dev/null
+++ b/examples/uitools/multipleinheritance/multipleinheritance.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Multiple Inheritance
+Exec=/opt/usr/bin/multipleinheritance
+Icon=multipleinheritance
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro
index 9b76d33e8b..be9fcad572 100644
--- a/examples/uitools/multipleinheritance/multipleinheritance.pro
+++ b/examples/uitools/multipleinheritance/multipleinheritance.pro
@@ -14,3 +14,5 @@ symbian {
TARGET.UID3 = 0xA000D7C1
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/uitools/textfinder/textfinder.desktop b/examples/uitools/textfinder/textfinder.desktop
new file mode 100644
index 0000000000..e1911cc61c
--- /dev/null
+++ b/examples/uitools/textfinder/textfinder.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Text Finder
+Exec=/opt/usr/bin/textfinder
+Icon=textfinder
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/uitools/textfinder/textfinder.pro b/examples/uitools/textfinder/textfinder.pro
index 91df91dd69..d237f2c852 100644
--- a/examples/uitools/textfinder/textfinder.pro
+++ b/examples/uitools/textfinder/textfinder.pro
@@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/uitools/textfinder
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/uitools/uitools.pro b/examples/uitools/uitools.pro
index 4a643e6123..6532094569 100644
--- a/examples/uitools/uitools.pro
+++ b/examples/uitools/uitools.pro
@@ -9,4 +9,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS uitools.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/webkit/domtraversal/domtraversal.desktop b/examples/webkit/domtraversal/domtraversal.desktop
new file mode 100644
index 0000000000..e44d725db4
--- /dev/null
+++ b/examples/webkit/domtraversal/domtraversal.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=DOM Traversal
+Exec=/opt/usr/bin/domtraversal
+Icon=domtraversal
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/domtraversal/domtraversal.pro b/examples/webkit/domtraversal/domtraversal.pro
index ba5f2d8884..2e1b3aa4d8 100644
--- a/examples/webkit/domtraversal/domtraversal.pro
+++ b/examples/webkit/domtraversal/domtraversal.pro
@@ -1,5 +1,6 @@
QT += webkit network
-FORMS = window.ui
+FORMS = window.ui \
+ window_mobiles.ui
HEADERS = window.h
SOURCES = main.cpp \
window.cpp
@@ -12,5 +13,10 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000D7CB
+ TARGET.CAPABILITY = NetworkServices
+ TARGET.EPOCHEAPSIZE = 0x100000 0x2000000
+ TARGET.EPOCSTACKSIZE = 0x14000
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/webkit/domtraversal/main.cpp b/examples/webkit/domtraversal/main.cpp
index c705bbc137..6d5650c445 100644
--- a/examples/webkit/domtraversal/main.cpp
+++ b/examples/webkit/domtraversal/main.cpp
@@ -45,7 +45,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
- window.show();
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ window.showMaximized();
+ #else
+ window.show();
+ #endif
window.setUrl(QUrl("http://qt.nokia.com/"));
return app.exec();
}
diff --git a/examples/webkit/domtraversal/window.h b/examples/webkit/domtraversal/window.h
index 68287837bd..eb3b4ea3df 100644
--- a/examples/webkit/domtraversal/window.h
+++ b/examples/webkit/domtraversal/window.h
@@ -50,7 +50,11 @@ class QTreeWidgetItem;
QT_END_NAMESPACE
//! [Window class definition]
-#include "ui_window.h"
+#if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ #include "ui_window_mobiles.h"
+#else
+ #include "ui_window.h"
+#endif
class Window : public QMainWindow, private Ui::Window
{
diff --git a/examples/webkit/domtraversal/window_mobiles.ui b/examples/webkit/domtraversal/window_mobiles.ui
new file mode 100644
index 0000000000..d6b6d11fa1
--- /dev/null
+++ b/examples/webkit/domtraversal/window_mobiles.ui
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Window</class>
+ <widget class="QMainWindow" name="Window">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>404</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Web Element DOM Traversal</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="topMargin">
+ <number>4</number>
+ </property>
+ <property name="bottomMargin">
+ <number>4</number>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Web View</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QWebView" name="webView">
+ <property name="url">
+ <url>
+ <string>http://qt.nokia.com/</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Document Structure</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QTreeWidget" name="treeWidget">
+ <attribute name="headerVisible">
+ <bool>false</bool>
+ </attribute>
+ <column>
+ <property name="text">
+ <string notr="true">1</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ <zorder>treeWidget</zorder>
+ <zorder>treeWidget</zorder>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>404</width>
+ <height>20</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKit/QWebView</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/webkit/fancybrowser/fancybrowser.desktop b/examples/webkit/fancybrowser/fancybrowser.desktop
new file mode 100644
index 0000000000..975eb0c71f
--- /dev/null
+++ b/examples/webkit/fancybrowser/fancybrowser.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Fancy Browser
+Exec=/opt/usr/bin/fancybrowser
+Icon=fancybrowser
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/fancybrowser/fancybrowser.pro b/examples/webkit/fancybrowser/fancybrowser.pro
index df4dbe3da2..1ed212e5ea 100644
--- a/examples/webkit/fancybrowser/fancybrowser.pro
+++ b/examples/webkit/fancybrowser/fancybrowser.pro
@@ -13,6 +13,8 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF6C
TARGET.EPOCHEAPSIZE = 0020000 04000000
- TARGET.CAPABILITY += Location NetworkServices
+ TARGET.CAPABILITY += NetworkServices
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/webkit/fancybrowser/main.cpp b/examples/webkit/fancybrowser/main.cpp
index bd5c236f60..b18d1909a8 100644
--- a/examples/webkit/fancybrowser/main.cpp
+++ b/examples/webkit/fancybrowser/main.cpp
@@ -50,6 +50,10 @@ int main(int argc, char * argv[])
else
url = QUrl("http://www.google.com/ncr");
MainWindow *browser = new MainWindow(url);
- browser->show();
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ browser->showMaximized();
+ #else
+ browser->show();
+ #endif
return app.exec();
}
diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp
index c1417bad13..4f2b25b1dc 100644
--- a/examples/webkit/formextractor/formextractor.cpp
+++ b/examples/webkit/formextractor/formextractor.cpp
@@ -78,6 +78,11 @@ void FormExtractor::submit()
ui.updatesEdit->setText("Yes");
else
ui.updatesEdit->setText("No");
+
+ // In mobile devices, change the tab when the data has been submitted
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ ui.tabWidget->setCurrentWidget(ui.tabData);
+ #endif
}
void FormExtractor::populateJavaScriptWindowObject()
diff --git a/examples/webkit/formextractor/formextractor.desktop b/examples/webkit/formextractor/formextractor.desktop
new file mode 100644
index 0000000000..5c670972d8
--- /dev/null
+++ b/examples/webkit/formextractor/formextractor.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Form Extractor
+Exec=/opt/usr/bin/formextractor
+Icon=formextractor
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/formextractor/formextractor.h b/examples/webkit/formextractor/formextractor.h
index 9fd17b17c4..8958708a91 100644
--- a/examples/webkit/formextractor/formextractor.h
+++ b/examples/webkit/formextractor/formextractor.h
@@ -43,7 +43,11 @@
#include <QtGui/QWidget>
#include <QWebFrame>
-#include "ui_formextractor.h"
+#if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ #include "ui_formextractor_mobiles.h"
+#else
+ #include "ui_formextractor.h"
+#endif
class FormExtractor : public QWidget
{
diff --git a/examples/webkit/formextractor/formextractor.pro b/examples/webkit/formextractor/formextractor.pro
index 51e0c45f24..a41ed0ff15 100644
--- a/examples/webkit/formextractor/formextractor.pro
+++ b/examples/webkit/formextractor/formextractor.pro
@@ -6,7 +6,8 @@ SOURCES += main.cpp \
mainwindow.cpp
HEADERS += formextractor.h \
mainwindow.h
-FORMS += formextractor.ui
+FORMS += formextractor.ui \
+ formextractor_mobiles.ui
RESOURCES += formextractor.qrc
# install
@@ -18,4 +19,6 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF6D
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/webkit/formextractor/formextractor_mobiles.ui b/examples/webkit/formextractor/formextractor_mobiles.ui
new file mode 100644
index 0000000000..4b81bc7da1
--- /dev/null
+++ b/examples/webkit/formextractor/formextractor_mobiles.ui
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>242</width>
+ <height>313</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tabWebForm">
+ <attribute name="title">
+ <string>Web Form</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QWebView" name="webView">
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabData">
+ <attribute name="title">
+ <string>Extracted Data</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="firstNameLabel">
+ <property name="text">
+ <string>First Name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="firstNameEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lastNameLabel">
+ <property name="text">
+ <string>Last Name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="lastNameEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="genderLabel">
+ <property name="text">
+ <string>Gender</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="genderEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="updatesLabel">
+ <property name="text">
+ <string>Receive Updates</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="updatesEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKit/QWebView</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/webkit/framecapture/framecapture.desktop b/examples/webkit/framecapture/framecapture.desktop
new file mode 100644
index 0000000000..14d74e49b5
--- /dev/null
+++ b/examples/webkit/framecapture/framecapture.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=WebKit Frame Capture
+Exec=/opt/usr/bin/framecapture
+Icon=framecapture
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/framecapture/framecapture.pro b/examples/webkit/framecapture/framecapture.pro
index 11960b9464..f23522459d 100644
--- a/examples/webkit/framecapture/framecapture.pro
+++ b/examples/webkit/framecapture/framecapture.pro
@@ -9,3 +9,13 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/framecapture
sources.files = $$SOURCES $$HEADERS
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/framecapture
INSTALLS += target sources
+
+symbian {
+ TARGET.CAPABILITY = NetworkServices
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/webkit/googlechat/googlechat.desktop b/examples/webkit/googlechat/googlechat.desktop
new file mode 100644
index 0000000000..b19b74bad0
--- /dev/null
+++ b/examples/webkit/googlechat/googlechat.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Google Chat
+Exec=/opt/usr/bin/googlechat
+Icon=googlechat
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/googlechat/googlechat.pro b/examples/webkit/googlechat/googlechat.pro
index 3d32c1b803..5d998f7ebd 100644
--- a/examples/webkit/googlechat/googlechat.pro
+++ b/examples/webkit/googlechat/googlechat.pro
@@ -13,4 +13,10 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF6E
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+maemo5: warning(This example does not work on Maemo platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/webkit/previewer/main.cpp b/examples/webkit/previewer/main.cpp
index 03aa831039..89e9f39399 100644
--- a/examples/webkit/previewer/main.cpp
+++ b/examples/webkit/previewer/main.cpp
@@ -46,7 +46,11 @@ int main(int argc, char * argv[])
{
QApplication app(argc, argv);
MainWindow mainWindow;
- mainWindow.show();
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ mainWindow.showMaximized();
+ #else
+ mainWindow.show();
+ #endif
return app.exec();
}
//! [0]
diff --git a/examples/webkit/previewer/previewer.cpp b/examples/webkit/previewer/previewer.cpp
index 40c5da4b59..06cba16136 100644
--- a/examples/webkit/previewer/previewer.cpp
+++ b/examples/webkit/previewer/previewer.cpp
@@ -60,5 +60,10 @@ void Previewer::on_previewButton_clicked()
// Update the contents in web viewer
QString text = plainTextEdit->toPlainText();
webView->setHtml(text, baseUrl);
+
+ // In mobile devices, change the tab
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ tabWidget->setCurrentWidget(tabHTMLPreview);
+ #endif
}
//! [1]
diff --git a/examples/webkit/previewer/previewer.desktop b/examples/webkit/previewer/previewer.desktop
new file mode 100644
index 0000000000..51c570d13d
--- /dev/null
+++ b/examples/webkit/previewer/previewer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Previewer
+Exec=/opt/usr/bin/previewer
+Icon=previewer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/previewer/previewer.h b/examples/webkit/previewer/previewer.h
index f59efbfee1..771b21f4e1 100644
--- a/examples/webkit/previewer/previewer.h
+++ b/examples/webkit/previewer/previewer.h
@@ -41,7 +41,11 @@
#ifndef PREVIEWER_H
#define PREVIEWER_H
-#include "ui_previewer.h"
+#if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ #include "ui_previewer_mobiles.h"
+#else
+ #include "ui_previewer.h"
+#endif
//! [0]
class Previewer : public QWidget, public Ui::Form
diff --git a/examples/webkit/previewer/previewer.pro b/examples/webkit/previewer/previewer.pro
index 525dbb2144..371695ebf9 100644
--- a/examples/webkit/previewer/previewer.pro
+++ b/examples/webkit/previewer/previewer.pro
@@ -4,7 +4,8 @@ HEADERS = previewer.h \
SOURCES = main.cpp \
previewer.cpp \
mainwindow.cpp
-FORMS = previewer.ui
+FORMS = previewer.ui \
+ previewer_mobiles.ui
# install
target.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer
@@ -15,4 +16,6 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF6F
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/webkit/previewer/previewer_mobiles.ui b/examples/webkit/previewer/previewer_mobiles.ui
new file mode 100644
index 0000000000..b65a88e540
--- /dev/null
+++ b/examples/webkit/previewer/previewer_mobiles.ui
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>259</width>
+ <height>177</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tabHTMLPreview">
+ <attribute name="title">
+ <string>HTML Preview</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QWebView" name="webView">
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabHTMLEditor">
+ <attribute name="title">
+ <string>HTML Editor</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QPlainTextEdit" name="plainTextEdit"/>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="clearButton">
+ <property name="text">
+ <string>Clear</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="previewButton">
+ <property name="text">
+ <string>Preview</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKit/QWebView</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>clearButton</sender>
+ <signal>clicked()</signal>
+ <receiver>plainTextEdit</receiver>
+ <slot>clear()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>56</x>
+ <y>653</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>98</x>
+ <y>551</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/examples/webkit/simpleselector/main.cpp b/examples/webkit/simpleselector/main.cpp
index 959f15d95a..cdd1123097 100644
--- a/examples/webkit/simpleselector/main.cpp
+++ b/examples/webkit/simpleselector/main.cpp
@@ -47,7 +47,11 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
Window window;
window.setUrl(QUrl("http://www.webkit.org"));
- window.show();
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ window.showMaximized();
+ #else
+ window.show();
+ #endif
return app.exec();
}
//! [main program]
diff --git a/examples/webkit/simpleselector/simpleselector.desktop b/examples/webkit/simpleselector/simpleselector.desktop
new file mode 100644
index 0000000000..2f9fde12f7
--- /dev/null
+++ b/examples/webkit/simpleselector/simpleselector.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Simple Selector
+Exec=/opt/usr/bin/simpleselector
+Icon=simpleselector
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/simpleselector/simpleselector.pro b/examples/webkit/simpleselector/simpleselector.pro
index 3ddd6db035..f5c1018125 100644
--- a/examples/webkit/simpleselector/simpleselector.pro
+++ b/examples/webkit/simpleselector/simpleselector.pro
@@ -13,4 +13,7 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000D7CC
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/webkit/simplewebplugin/csvfactory.cpp b/examples/webkit/simplewebplugin/csvfactory.cpp
new file mode 100644
index 0000000000..56b4558fe7
--- /dev/null
+++ b/examples/webkit/simplewebplugin/csvfactory.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtNetwork>
+#include <QWebPluginFactory>
+#include "csvfactory.h"
+#include "csvview.h"
+
+//! [constructor]
+CSVFactory::CSVFactory(QObject *parent)
+ : QWebPluginFactory(parent)
+{
+ manager = new QNetworkAccessManager(this);
+};
+//! [constructor]
+
+//! [begin create]
+QObject *CSVFactory::create(const QString &mimeType, const QUrl &url,
+ const QStringList &argumentNames,
+ const QStringList &argumentValues) const
+{
+ if (mimeType != "text/csv")
+ return 0;
+
+ CSVView *view = new CSVView(argumentValues[argumentNames.indexOf("type")]);
+//! [begin create]
+
+//! [submit request]
+ QNetworkRequest request(url);
+ QNetworkReply *reply = manager->get(request);
+ connect(reply, SIGNAL(finished()), view, SLOT(updateModel()));
+ connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater()));
+
+ return view;
+}
+//! [submit request]
+
+//! [plugins]
+QList<QWebPluginFactory::Plugin> CSVFactory::plugins() const
+{
+ QWebPluginFactory::MimeType mimeType;
+ mimeType.name = "text/csv";
+ mimeType.description = "Comma-separated values";
+ mimeType.fileExtensions = QStringList() << "csv";
+
+ QWebPluginFactory::Plugin plugin;
+ plugin.name = "CSV file viewer";
+ plugin.description = "A CSV file Web plugin.";
+ plugin.mimeTypes = QList<MimeType>() << mimeType;
+
+ return QList<QWebPluginFactory::Plugin>() << plugin;
+}
+//! [plugins]
diff --git a/examples/webkit/simplewebplugin/csvfactory.h b/examples/webkit/simplewebplugin/csvfactory.h
new file mode 100644
index 0000000000..0b046c5168
--- /dev/null
+++ b/examples/webkit/simplewebplugin/csvfactory.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CSVFACTORY_H
+#define CSVFACTORY_H
+
+#include <QNetworkRequest>
+#include <QWebPluginFactory>
+
+class QNetworkAccessManager;
+class QNetworkReply;
+
+//! [plugin factory]
+class CSVFactory : public QWebPluginFactory
+{
+ Q_OBJECT
+
+public:
+ CSVFactory(QObject *parent = 0);
+ QObject *create(const QString &mimeType, const QUrl &url,
+ const QStringList &argumentNames,
+ const QStringList &argumentValues) const;
+ QList<QWebPluginFactory::Plugin> plugins() const;
+
+private:
+ QNetworkAccessManager *manager;
+};
+//! [plugin factory]
+
+#endif
diff --git a/examples/webkit/simplewebplugin/csvview.cpp b/examples/webkit/simplewebplugin/csvview.cpp
new file mode 100644
index 0000000000..3d87daaf04
--- /dev/null
+++ b/examples/webkit/simplewebplugin/csvview.cpp
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtNetwork>
+#include "csvview.h"
+
+//! [constructor]
+CSVView::CSVView(const QString &mimeType, QWidget *parent)
+ : QTableView(parent)
+{
+ this->mimeType = mimeType;
+}
+//! [constructor]
+
+//! [update model begin]
+void CSVView::updateModel()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+
+ if (reply->error() != QNetworkReply::NoError)
+ return;
+
+ bool hasHeader = false;
+ QString charset = "latin1";
+//! [update model begin]
+
+ foreach (QString piece, mimeType.split(";")) {
+ piece = piece.trimmed();
+ if (piece.contains("=")) {
+ int index = piece.indexOf("=");
+ QString left = piece.left(index).trimmed();
+ QString right = piece.mid(index + 1).trimmed();
+ if (left == "header")
+ hasHeader = (right == "present");
+ else if (left == "charset")
+ charset = right;
+ }
+ }
+
+//! [read data begin]
+ QTextStream stream(reply);
+ stream.setCodec(QTextCodec::codecForName(charset.toLatin1()));
+
+ QStandardItemModel *model = new QStandardItemModel(this);
+//! [read data begin]
+ QList<QStandardItem *> items;
+ bool firstLine = hasHeader;
+ bool wasQuote = false;
+ bool wasCR = false;
+ bool quoted = false;
+ QString text;
+
+ while (!stream.atEnd()) {
+
+ QString ch = stream.read(1);
+
+ if (wasQuote) {
+ if (ch == "\"") {
+ if (quoted) {
+ text += ch; // quoted "" are inserted as "
+ wasQuote = false; // no quotes are pending
+ } else {
+ quoted = true; // unquoted "" starts quoting
+ wasQuote = true; // with a pending quote
+ }
+ continue; // process the next character
+
+ } else {
+ quoted = !quoted; // process the pending quote
+ wasQuote = false; // no quotes are pending
+ } // process the current character
+
+ } else if (wasCR) {
+ wasCR = false;
+
+ if (ch == "\n") { // CR LF represents the end of a row
+ if (!text.isEmpty())
+ items.append(new QStandardItem(QString(text)));
+
+ addRow(firstLine, model, items);
+ items.clear();
+ text = "";
+ firstLine = false;
+ continue; // process the next character
+ } else
+ text += "\r"; // CR on its own is inserted
+ } // process the current character
+
+ // wasQuote is never true here.
+ // wasCR is never true here.
+
+ if (ch == "\"")
+ wasQuote = true; // handle the pending quote later
+
+ else if (ch == ",") {
+ if (quoted)
+ text += ch;
+ else {
+ items.append(new QStandardItem(QString(text)));
+ text = "";
+ }
+ }
+
+ else if (ch == "\r") {
+ if (!quoted)
+ wasCR = true;
+ else
+ text += ch;
+ }
+
+ else if (ch == "\n")
+ text += ch;
+ else
+ text += ch;
+
+ }
+
+ if (items.count() > 0)
+ addRow(firstLine, model, items);
+
+//! [update model]
+ reply->close();
+
+ setModel(model);
+ resizeColumnsToContents();
+ horizontalHeader()->setStretchLastSection(true);
+}
+//! [update model]
+
+void CSVView::addRow(bool firstLine, QStandardItemModel *model,
+ const QList<QStandardItem *> &items)
+{
+ if (firstLine) {
+ for (int j = 0; j < items.count(); ++j)
+ model->setHorizontalHeaderItem(j, items[j]);
+ } else
+ model->appendRow(items);
+}
diff --git a/examples/webkit/simplewebplugin/csvview.h b/examples/webkit/simplewebplugin/csvview.h
new file mode 100644
index 0000000000..0a136f3667
--- /dev/null
+++ b/examples/webkit/simplewebplugin/csvview.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CSVVIEW_H
+#define CSVVIEW_H
+
+#include <QNetworkRequest>
+#include <QStandardItemModel>
+#include <QTableView>
+#include <QWebPluginFactory>
+
+class QNetworkAccessManager;
+class QNetworkReply;
+
+//! [definition]
+class CSVView : public QTableView
+{
+ Q_OBJECT
+
+public:
+ CSVView(const QString &mimeType, QWidget *parent = 0);
+
+public slots:
+ void updateModel();
+
+private:
+ void addRow(bool firstLine, QStandardItemModel *model,
+ const QList<QStandardItem *> &items);
+
+ QString mimeType;
+};
+//! [definition]
+
+#endif
diff --git a/examples/webkit/simplewebplugin/data/accounts.csv b/examples/webkit/simplewebplugin/data/accounts.csv
new file mode 100644
index 0000000000..2ea3bd69b0
--- /dev/null
+++ b/examples/webkit/simplewebplugin/data/accounts.csv
@@ -0,0 +1,11 @@
+"Name","Address","Quantity"
+"Kristian Quan","123 Company Place, Big City","4"
+"Matthew Rand","The Orchard, Little Village","2"
+"Eirik Asaki","497 Park Skyway, Future City","29"
+"Jarek Hanssen","1023 Riviera Drive, Southern Precinct","45"
+"Carlos Hartmann","The Manor House, Country Estate","1"
+"Bea King","Floor 201, Sun Tower, Central City","32"
+"Stian Hinton","Mechanical workshop, Fishing Village, North River","0"
+"Shane Bowland","P.O. Box 419, Beach Resort","1"
+"Gavin Holm","19 Library Road, University Campus, near Large Town","16"
+"Adrienna Randles","98 Tapestry Road, Market Town, The Shires","1"
diff --git a/examples/webkit/simplewebplugin/main.cpp b/examples/webkit/simplewebplugin/main.cpp
new file mode 100644
index 0000000000..8e823b1e4a
--- /dev/null
+++ b/examples/webkit/simplewebplugin/main.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include "mainwindow.h"
+
+//! [main]
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow window;
+ window.show();
+ return app.exec();
+}
+//! [main]
diff --git a/examples/webkit/simplewebplugin/mainwindow.cpp b/examples/webkit/simplewebplugin/mainwindow.cpp
new file mode 100644
index 0000000000..60bdd8b9f4
--- /dev/null
+++ b/examples/webkit/simplewebplugin/mainwindow.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFile>
+#include <QWebView>
+#include "csvfactory.h"
+#include "mainwindow.h"
+
+//! [constructor]
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ QWebSettings::globalSettings()->setAttribute(
+ QWebSettings::PluginsEnabled, true);
+
+ QWebView *webView = new QWebView;
+ CSVFactory *factory = new CSVFactory(this);
+ webView->page()->setPluginFactory(factory);
+ QFile file(":/pages/index.html");
+ file.open(QFile::ReadOnly);
+ webView->setHtml(file.readAll());
+
+ setCentralWidget(webView);
+ setWindowTitle(tr("Simple Web Plugin Example"));
+}
+//! [constructor]
diff --git a/examples/webkit/simplewebplugin/mainwindow.h b/examples/webkit/simplewebplugin/mainwindow.h
new file mode 100644
index 0000000000..12c8306c02
--- /dev/null
+++ b/examples/webkit/simplewebplugin/mainwindow.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+};
+
+#endif
diff --git a/examples/webkit/simplewebplugin/pages/index.html b/examples/webkit/simplewebplugin/pages/index.html
new file mode 100644
index 0000000000..9581a8e46d
--- /dev/null
+++ b/examples/webkit/simplewebplugin/pages/index.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<title>Simple Web Plugin</title>
+</head>
+
+<body>
+<h1>Simple Web Plugin</h1>
+
+<p>
+ This plugin displays comma-separated value (CSV) files in Web pages using
+ a subclass of Qt's
+ <a href="http://doc.trolltech.com/4.4/qtableview.html">QTableView</a>
+ widget.
+</p>
+
+<!-- [embedded object] -->
+<object type="text/csv;header=present;charset=utf8"
+ data="qrc:/data/accounts.csv"
+ width="100%" height="300"></object>
+<!-- [embedded object] -->
+
+<p>
+ The above table shows some sample data rendered by the plugin.
+</p>
+
+</body>
+</html>
diff --git a/examples/webkit/simplewebplugin/simplewebplugin.pro b/examples/webkit/simplewebplugin/simplewebplugin.pro
new file mode 100644
index 0000000000..c16302d74c
--- /dev/null
+++ b/examples/webkit/simplewebplugin/simplewebplugin.pro
@@ -0,0 +1,23 @@
+QT += webkit network
+
+HEADERS = csvfactory.h \
+ csvview.h \
+ mainwindow.h
+
+SOURCES = csvfactory.cpp \
+ csvview.cpp \
+ main.cpp \
+ mainwindow.cpp
+
+RESOURCES = simplewebplugin.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/webkit/simplewebplugin
+sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/simplewebplugin
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000EFFF
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/webkit/simplewebplugin/simplewebplugin.qrc b/examples/webkit/simplewebplugin/simplewebplugin.qrc
new file mode 100644
index 0000000000..14f80e7ac0
--- /dev/null
+++ b/examples/webkit/simplewebplugin/simplewebplugin.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>pages/index.html</file>
+ <file>data/accounts.csv</file>
+ </qresource>
+</RCC>
diff --git a/examples/webkit/webftpclient/downloader.cpp b/examples/webkit/webftpclient/downloader.cpp
new file mode 100644
index 0000000000..71858520a0
--- /dev/null
+++ b/examples/webkit/webftpclient/downloader.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include "downloader.h"
+
+Downloader::Downloader(QWidget *parentWidget, QNetworkAccessManager *manager)
+ : QObject(parentWidget), manager(manager), parentWidget(parentWidget)
+{
+}
+
+QString Downloader::chooseSaveFile(const QUrl &url)
+{
+ QString fileName = url.path().split("/").last();
+ if (!path.isEmpty())
+ fileName = QDir(path).filePath(fileName);
+
+ return QFileDialog::getSaveFileName(parentWidget, tr("Save File"), fileName);
+}
+
+void Downloader::startDownload(const QNetworkRequest &request)
+{
+ downloads[request.url().toString()] = chooseSaveFile(request.url());
+
+ QNetworkReply *reply = manager->get(request);
+ connect(reply, SIGNAL(finished()), this, SLOT(finishDownload()));
+}
+
+void Downloader::saveFile(QNetworkReply *reply)
+{
+ QString newPath = downloads[reply->url().toString()];
+
+ if (newPath.isEmpty())
+ newPath = chooseSaveFile(reply->url());
+
+ if (!newPath.isEmpty()) {
+ QFile file(newPath);
+ if (file.open(QIODevice::WriteOnly)) {
+ file.write(reply->readAll());
+ file.close();
+ path = QDir(newPath).dirName();
+ QMessageBox::information(parentWidget, tr("Download Completed"),
+ tr("Saved '%1'.").arg(newPath));
+ } else
+ QMessageBox::warning(parentWidget, tr("Download Failed"),
+ tr("Failed to save the file."));
+ }
+}
+
+void Downloader::finishDownload()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+ saveFile(reply);
+ downloads.remove(reply->url().toString());
+ reply->deleteLater();
+}
diff --git a/examples/webkit/webftpclient/downloader.h b/examples/webkit/webftpclient/downloader.h
new file mode 100644
index 0000000000..8201cead63
--- /dev/null
+++ b/examples/webkit/webftpclient/downloader.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DOWNLOADER_H
+#define DOWNLOADER_H
+
+#include <QDir>
+#include <QHash>
+#include <QObject>
+#include <QUrl>
+
+class QNetworkAccessManager;
+class QNetworkRequest;
+class QNetworkReply;
+class QWidget;
+
+class Downloader : public QObject
+{
+ Q_OBJECT
+
+public:
+ Downloader(QWidget *parentWidget, QNetworkAccessManager *manager);
+
+public slots:
+ QString chooseSaveFile(const QUrl &url);
+ void startDownload(const QNetworkRequest &request);
+ void saveFile(QNetworkReply *reply);
+ void finishDownload();
+
+private:
+ QNetworkAccessManager *manager;
+ QNetworkReply *reply;
+ QHash<QString, QString> downloads;
+ QString path;
+ QWidget *parentWidget;
+};
+
+#endif
diff --git a/examples/webkit/webftpclient/ftpreply.cpp b/examples/webkit/webftpclient/ftpreply.cpp
new file mode 100644
index 0000000000..d3b7aa7bd2
--- /dev/null
+++ b/examples/webkit/webftpclient/ftpreply.cpp
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QTextDocument>
+#include <QtNetwork>
+#include "ftpreply.h"
+
+//! [constructor]
+FtpReply::FtpReply(const QUrl &url)
+ : QNetworkReply()
+{
+ ftp = new QFtp(this);
+ connect(ftp, SIGNAL(listInfo(QUrlInfo)), this, SLOT(processListInfo(QUrlInfo)));
+ connect(ftp, SIGNAL(readyRead()), this, SLOT(processData()));
+ connect(ftp, SIGNAL(commandFinished(int, bool)), this, SLOT(processCommand(int, bool)));
+
+ offset = 0;
+ units = QStringList() << tr("bytes") << tr("K") << tr("M") << tr("G")
+ << tr("Ti") << tr("Pi") << tr("Ei") << tr("Zi")
+ << tr("Yi");
+
+ setUrl(url);
+ ftp->connectToHost(url.host());
+}
+//! [constructor]
+
+//! [process command]
+void FtpReply::processCommand(int, bool err)
+{
+ if (err) {
+ setError(ContentNotFoundError, tr("Unknown command"));
+ emit error(ContentNotFoundError);
+ return;
+ }
+
+ switch (ftp->currentCommand()) {
+ case QFtp::ConnectToHost:
+ ftp->login();
+ break;
+
+ case QFtp::Login:
+ ftp->list(url().path());
+ break;
+
+ case QFtp::List:
+ if (items.size() == 1)
+ ftp->get(url().path());
+ else
+ setListContent();
+ break;
+
+ case QFtp::Get:
+ setContent();
+
+ default:
+ ;
+ }
+}
+//! [process command]
+
+//! [process list info]
+void FtpReply::processListInfo(const QUrlInfo &urlInfo)
+{
+ items.append(urlInfo);
+}
+//! [process list info]
+
+//! [process data]
+void FtpReply::processData()
+{
+ content += ftp->readAll();
+}
+//! [process data]
+
+//! [set content]
+void FtpReply::setContent()
+{
+ open(ReadOnly | Unbuffered);
+ setHeader(QNetworkRequest::ContentLengthHeader, QVariant(content.size()));
+ emit readyRead();
+ emit finished();
+ ftp->close();
+}
+//! [set content]
+
+//! [set list content]
+void FtpReply::setListContent()
+{
+ QUrl u = url();
+ if (!u.path().endsWith("/"))
+ u.setPath(u.path() + "/");
+
+ QString base_url = url().toString();
+ QString base_path = u.path();
+
+ open(ReadOnly | Unbuffered);
+ QString content(
+ "<html>\n"
+ "<head>\n"
+ " <title>" + Qt::escape(base_url) + "</title>\n"
+ " <style type=\"text/css\">\n"
+ " th { background-color: #aaaaaa; color: black }\n"
+ " table { border: solid 1px #aaaaaa }\n"
+ " tr.odd { background-color: #dddddd; color: black\n }\n"
+ " tr.even { background-color: white; color: black\n }\n"
+ " </style>\n"
+ "</head>\n\n"
+ "<body>\n"
+ "<h1>" + tr("Listing for %1").arg(base_path) + "</h1>\n\n"
+ "<table align=\"center\" cellspacing=\"0\" width=\"90%\">\n"
+ "<tr><th>Name</th><th>Size</th></tr>\n");
+
+ QUrl parent = u.resolved(QUrl(".."));
+
+ if (parent.isParentOf(u))
+
+ content += QString("<tr><td><strong><a href=\"" + parent.toString() + "\">"
+ + tr("Parent directory") + "</a></strong></td><td></td></tr>\n");
+
+ int i = 0;
+ foreach (const QUrlInfo &item, items) {
+
+ QUrl child = u.resolved(QUrl(item.name()));
+
+ if (i == 0)
+ content += QString("<tr class=\"odd\">");
+ else
+ content += QString("<tr class=\"even\">");
+
+ content += QString("<td><a href=\"" + child.toString() + "\">"
+ + Qt::escape(item.name()) + "</a></td>");
+
+ qint64 size = item.size();
+ int unit = 0;
+ while (size) {
+ qint64 new_size = size/1024;
+ if (new_size && unit < units.size()) {
+ size = new_size;
+ unit += 1;
+ } else
+ break;
+ }
+
+ if (item.isFile())
+ content += QString("<td>" + QString::number(size) + " "
+ + units[unit] + "</td></tr>\n");
+ else
+ content += QString("<td></td></tr>\n");
+
+ i = 1 - i;
+ }
+
+ content += QString("</table>\n"
+ "</body>\n"
+ "</html>\n");
+
+ this->content = content.toUtf8();
+
+ setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/html; charset=UTF-8"));
+ setHeader(QNetworkRequest::ContentLengthHeader, QVariant(this->content.size()));
+ emit readyRead();
+ emit finished();
+ ftp->close();
+}
+//! [set list content]
+
+// QIODevice methods
+
+//! [abort]
+void FtpReply::abort()
+{
+}
+//! [abort]
+
+//! [bytes available]
+qint64 FtpReply::bytesAvailable() const
+{
+ return content.size() - offset;
+}
+//! [bytes available]
+
+//! [is sequential]
+bool FtpReply::isSequential() const
+{
+ return true;
+}
+//! [is sequential]
+
+//! [read data]
+qint64 FtpReply::readData(char *data, qint64 maxSize)
+{
+ if (offset < content.size()) {
+ qint64 number = qMin(maxSize, content.size() - offset);
+ memcpy(data, content.constData() + offset, number);
+ offset += number;
+ return number;
+ } else
+ return -1;
+}
+//! [read data]
diff --git a/examples/webkit/webftpclient/ftpreply.h b/examples/webkit/webftpclient/ftpreply.h
new file mode 100644
index 0000000000..becd4e42b1
--- /dev/null
+++ b/examples/webkit/webftpclient/ftpreply.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FTPREPLY_H
+#define FTPREPLY_H
+
+#include <QNetworkReply>
+#include <QStringList>
+#include <QUrlInfo>
+
+class QFtp;
+
+//! [class definition]
+class FtpReply : public QNetworkReply
+{
+ Q_OBJECT
+
+public:
+ FtpReply(const QUrl &url);
+ void abort();
+ qint64 bytesAvailable() const;
+ bool isSequential() const;
+
+protected:
+ qint64 readData(char *data, qint64 maxSize);
+
+private slots:
+ void processCommand(int command, bool error);
+ void processListInfo(const QUrlInfo &urlInfo);
+ void processData();
+
+private:
+ void setContent();
+ void setListContent();
+
+ QFtp *ftp;
+ QList<QUrlInfo> items;
+ QByteArray content;
+ qint64 offset;
+ QStringList units;
+};
+//! [class definition]
+
+#endif
diff --git a/examples/webkit/webftpclient/ftpview.cpp b/examples/webkit/webftpclient/ftpview.cpp
new file mode 100644
index 0000000000..dd3fc8a92e
--- /dev/null
+++ b/examples/webkit/webftpclient/ftpview.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "downloader.h"
+#include "ftpview.h"
+#include "networkaccessmanager.h"
+
+//! [constructor]
+FtpView::FtpView()
+{
+ QNetworkAccessManager *oldManager = page()->networkAccessManager();
+ NetworkAccessManager *newManager = new NetworkAccessManager(oldManager, this);
+ page()->setNetworkAccessManager(newManager);
+
+ page()->setForwardUnsupportedContent(true);
+ downloader = new Downloader(this, newManager);
+
+ connect(page(), SIGNAL(unsupportedContent(QNetworkReply *)),
+ downloader, SLOT(saveFile(QNetworkReply *)));
+ connect(page(), SIGNAL(downloadRequested(const QNetworkRequest &)),
+ downloader, SLOT(startDownload(const QNetworkRequest &)));
+
+ connect(this, SIGNAL(urlChanged(const QUrl &)),
+ this, SLOT(updateWindowTitle(const QUrl &)));
+}
+//! [constructor]
+
+void FtpView::updateWindowTitle(const QUrl &url)
+{
+ setWindowTitle(tr("FTP Client - %1").arg(url.toString()));
+}
diff --git a/examples/webkit/webftpclient/ftpview.h b/examples/webkit/webftpclient/ftpview.h
new file mode 100644
index 0000000000..25388124b5
--- /dev/null
+++ b/examples/webkit/webftpclient/ftpview.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QWebView>
+
+class Downloader;
+class QNetworkAccessManager;
+
+class FtpView : public QWebView
+{
+ Q_OBJECT
+
+public:
+ FtpView();
+
+private slots:
+ void updateWindowTitle(const QUrl &url);
+
+private:
+ Downloader *downloader;
+};
diff --git a/examples/webkit/webftpclient/main.cpp b/examples/webkit/webftpclient/main.cpp
new file mode 100644
index 0000000000..ac42e36e31
--- /dev/null
+++ b/examples/webkit/webftpclient/main.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtWebKit>
+
+#include "ftpview.h"
+
+//! [main]
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ FtpView view;
+ view.setUrl(QUrl("ftp://ftp.qt.nokia.com"));
+ view.show();
+
+ return app.exec();
+}
+//! [main]
diff --git a/examples/webkit/webftpclient/networkaccessmanager.cpp b/examples/webkit/webftpclient/networkaccessmanager.cpp
new file mode 100644
index 0000000000..e52c7fe00b
--- /dev/null
+++ b/examples/webkit/webftpclient/networkaccessmanager.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtNetwork>
+#include "networkaccessmanager.h"
+#include "ftpreply.h"
+
+//! [constructor]
+NetworkAccessManager::NetworkAccessManager(QNetworkAccessManager *manager, QObject *parent)
+ : QNetworkAccessManager(parent)
+{
+ setCache(manager->cache());
+ setCookieJar(manager->cookieJar());
+ setProxy(manager->proxy());
+ setProxyFactory(manager->proxyFactory());
+}
+//! [constructor]
+
+//! [create request]
+QNetworkReply *NetworkAccessManager::createRequest(
+ QNetworkAccessManager::Operation operation, const QNetworkRequest &request,
+ QIODevice *device)
+{
+ if (request.url().scheme() != "ftp")
+ return QNetworkAccessManager::createRequest(operation, request, device);
+
+ if (operation == GetOperation)
+ // Handle ftp:// URLs separately by creating custom QNetworkReply
+ // objects.
+ return new FtpReply(request.url());
+ else
+ return QNetworkAccessManager::createRequest(operation, request, device);
+}
+//! [create request]
diff --git a/examples/webkit/webftpclient/networkaccessmanager.h b/examples/webkit/webftpclient/networkaccessmanager.h
new file mode 100644
index 0000000000..256ae825cc
--- /dev/null
+++ b/examples/webkit/webftpclient/networkaccessmanager.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef NETWORKACCESSMANAGER_H
+#define NETWORKACCESSMANAGER_H
+
+#include <QNetworkAccessManager>
+
+class NetworkAccessManager : public QNetworkAccessManager
+{
+ Q_OBJECT
+
+public:
+ NetworkAccessManager(QNetworkAccessManager *oldManager, QObject *parent = 0);
+
+protected:
+ QNetworkReply *createRequest(Operation operation, const QNetworkRequest &request, QIODevice *device);
+};
+
+#endif
diff --git a/examples/webkit/webftpclient/webftpclient.pro b/examples/webkit/webftpclient/webftpclient.pro
new file mode 100644
index 0000000000..6c17410057
--- /dev/null
+++ b/examples/webkit/webftpclient/webftpclient.pro
@@ -0,0 +1,22 @@
+HEADERS = downloader.h \
+ ftpreply.h \
+ ftpview.h \
+ networkaccessmanager.h
+SOURCES = downloader.cpp \
+ ftpreply.cpp \
+ ftpview.cpp \
+ main.cpp \
+ networkaccessmanager.cpp
+
+QT += network webkit
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/webkit/webftpclient
+sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/webftpclient
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000EFEF
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro
index 62d3762468..4ff2d9148a 100644
--- a/examples/webkit/webkit.pro
+++ b/examples/webkit/webkit.pro
@@ -6,6 +6,9 @@ SUBDIRS += domtraversal \
simpleselector \
imageanalyzer \
framecapture \
+ simplewebplugin \
+ webplugin \
+ webftpclient
contains(QT_CONFIG, openssl):SUBDIRS += googlechat
@@ -15,4 +18,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webkit.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/webkit/webplugin/csvfactory.cpp b/examples/webkit/webplugin/csvfactory.cpp
new file mode 100644
index 0000000000..b605a76c5b
--- /dev/null
+++ b/examples/webkit/webplugin/csvfactory.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtNetwork>
+#include <QtWebKit>
+#include "csvfactory.h"
+#include "csvview.h"
+
+CSVFactory::CSVFactory(QWebView *webView, QObject *parent)
+ : QWebPluginFactory(parent)
+{
+ manager = new QNetworkAccessManager(this);
+ this->webView = webView;
+};
+
+//! [begin create]
+QObject *CSVFactory::create(const QString &mimeType, const QUrl &url,
+ const QStringList &argumentNames,
+ const QStringList &argumentValues) const
+{
+ if (mimeType != "text/csv")
+ return 0;
+
+ QHash<QString, QString> arguments;
+ for (int i = 0; i < argumentNames.count(); ++i)
+ arguments[argumentNames[i]] = argumentValues[i];
+
+ CSVView *view = new CSVView(arguments["type"]);
+//! [begin create]
+
+//! [create connection]
+ QWebFrame *frame = webView->page()->mainFrame();
+ frame->addToJavaScriptWindowObject("view", view);
+ frame->evaluateJavaScript("view.rowSelected.connect(fillInTable);\n");
+//! [create connection]
+
+//! [submit request]
+ QNetworkRequest request(url);
+ QNetworkReply *reply = manager->get(request);
+ connect(reply, SIGNAL(finished()), view, SLOT(updateModel()));
+ connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater()));
+
+ return view;
+}
+//! [submit request]
+
+QList<QWebPluginFactory::Plugin> CSVFactory::plugins() const
+{
+ QWebPluginFactory::MimeType mimeType;
+ mimeType.name = "text/csv";
+ mimeType.description = "Comma-separated values";
+ mimeType.fileExtensions = QStringList() << "csv";
+
+ QWebPluginFactory::Plugin plugin;
+ plugin.name = "CSV file viewer";
+ plugin.description = "A CSV file Web plugin.";
+ plugin.mimeTypes = QList<MimeType>() << mimeType;
+
+ return QList<QWebPluginFactory::Plugin>() << plugin;
+}
diff --git a/examples/webkit/webplugin/csvfactory.h b/examples/webkit/webplugin/csvfactory.h
new file mode 100644
index 0000000000..5a44c50eff
--- /dev/null
+++ b/examples/webkit/webplugin/csvfactory.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CSVFACTORY_H
+#define CSVFACTORY_H
+
+#include <QNetworkRequest>
+#include <QWebPluginFactory>
+
+class QNetworkAccessManager;
+class QNetworkReply;
+class QWebView;
+
+class CSVFactory : public QWebPluginFactory
+{
+ Q_OBJECT
+
+public:
+ CSVFactory(QWebView *webView, QObject *parent = 0);
+ QObject *create(const QString &mimeType, const QUrl &url,
+ const QStringList &argumentNames,
+ const QStringList &argumentValues) const;
+ QList<QWebPluginFactory::Plugin> plugins() const;
+
+private:
+ QNetworkAccessManager *manager;
+ QWebView *webView;
+};
+
+#endif
diff --git a/examples/webkit/webplugin/csvview.cpp b/examples/webkit/webplugin/csvview.cpp
new file mode 100644
index 0000000000..0996f241e4
--- /dev/null
+++ b/examples/webkit/webplugin/csvview.cpp
@@ -0,0 +1,190 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtNetwork>
+#include "csvview.h"
+
+//! [constructor]
+CSVView::CSVView(const QString &mimeType, QWidget *parent)
+ : QTableView(parent)
+{
+ this->mimeType = mimeType;
+
+ setEditTriggers(NoEditTriggers);
+ setSelectionBehavior(SelectRows);
+ setSelectionMode(SingleSelection);
+}
+//! [constructor]
+
+void CSVView::updateModel()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+
+ if (reply->error() != QNetworkReply::NoError)
+ return;
+
+ bool hasHeader = false;
+ QString charset = "latin1";
+
+ foreach (QString piece, mimeType.split(";")) {
+ piece = piece.trimmed();
+ if (piece.contains("=")) {
+ int index = piece.indexOf("=");
+ QString left = piece.left(index).trimmed();
+ QString right = piece.mid(index + 1).trimmed();
+ if (left == "header")
+ hasHeader = (right == "present");
+ else if (left == "charset")
+ charset = right;
+ }
+ }
+
+ QTextStream stream(reply);
+ stream.setCodec(QTextCodec::codecForName(charset.toLatin1()));
+
+ QStandardItemModel *model = new QStandardItemModel(this);
+ QList<QStandardItem *> items;
+ bool firstLine = hasHeader;
+ bool wasQuote = false;
+ bool wasCR = false;
+ bool quoted = false;
+ QString text;
+
+ while (!stream.atEnd()) {
+
+ QString ch = stream.read(1);
+
+ if (wasQuote) {
+ if (ch == "\"") {
+ if (quoted) {
+ text += ch; // quoted "" are inserted as "
+ wasQuote = false; // no quotes are pending
+ } else {
+ quoted = true; // unquoted "" starts quoting
+ wasQuote = true; // with a pending quote
+ }
+ continue; // process the next character
+
+ } else {
+ quoted = !quoted; // process the pending quote
+ wasQuote = false; // no quotes are pending
+ } // process the current character
+
+ } else if (wasCR) {
+ wasCR = false;
+
+ if (ch == "\n") { // CR LF represents the end of a row
+ if (!text.isEmpty())
+ items.append(new QStandardItem(QString(text)));
+
+ addRow(firstLine, model, items);
+ items.clear();
+ text = "";
+ firstLine = false;
+ continue; // process the next character
+ } else
+ text += "\r"; // CR on its own is inserted
+ } // process the current character
+
+ // wasQuote is never true here.
+ // wasCR is never true here.
+
+ if (ch == "\"")
+ wasQuote = true; // handle the pending quote later
+
+ else if (ch == ",") {
+ if (quoted)
+ text += ch;
+ else {
+ items.append(new QStandardItem(QString(text)));
+ text = "";
+ }
+ }
+
+ else if (ch == "\r") {
+ if (!quoted)
+ wasCR = true;
+ else
+ text += ch;
+ }
+
+ else if (ch == "\n")
+ text += ch;
+ else
+ text += ch;
+
+ }
+
+ if (items.count() > 0)
+ addRow(firstLine, model, items);
+
+ reply->close();
+
+ setModel(model);
+
+ connect(selectionModel(),
+ SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
+ this, SLOT(exportRow(const QModelIndex &)));
+
+ resizeColumnsToContents();
+ horizontalHeader()->setStretchLastSection(true);
+}
+
+void CSVView::addRow(bool firstLine, QStandardItemModel *model,
+ const QList<QStandardItem *> &items)
+{
+ if (firstLine) {
+ for (int j = 0; j < items.count(); ++j)
+ model->setHorizontalHeaderItem(j, items[j]);
+ } else
+ model->appendRow(items);
+}
+
+//! [export row]
+void CSVView::exportRow(const QModelIndex &current)
+{
+ QString name = model()->index(current.row(), 0).data().toString();
+ QString address = model()->index(current.row(), 1).data().toString();
+ QString quantity = model()->index(current.row(), 2).data().toString();
+
+ emit rowSelected(name, address, quantity);
+}
+//! [export row]
diff --git a/examples/webkit/webplugin/csvview.h b/examples/webkit/webplugin/csvview.h
new file mode 100644
index 0000000000..bf8918bd1b
--- /dev/null
+++ b/examples/webkit/webplugin/csvview.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CSVVIEW_H
+#define CSVVIEW_H
+
+#include <QNetworkRequest>
+#include <QStandardItemModel>
+#include <QTableView>
+#include <QWebPluginFactory>
+
+class QNetworkAccessManager;
+class QNetworkReply;
+class QWebFrame;
+
+//! [definition]
+class CSVView : public QTableView
+{
+ Q_OBJECT
+
+public:
+ CSVView(const QString &mimeType, QWidget *parent = 0);
+
+signals:
+ void rowSelected(const QString &name, const QString &address,
+ const QString &quantity);
+
+public slots:
+ void updateModel();
+
+private slots:
+ void exportRow(const QModelIndex &current);
+
+private:
+ void addRow(bool firstLine, QStandardItemModel *model,
+ const QList<QStandardItem *> &items);
+
+ QString mimeType;
+};
+//! [definition]
+
+#endif
diff --git a/examples/webkit/webplugin/data/accounts.csv b/examples/webkit/webplugin/data/accounts.csv
new file mode 100644
index 0000000000..2ea3bd69b0
--- /dev/null
+++ b/examples/webkit/webplugin/data/accounts.csv
@@ -0,0 +1,11 @@
+"Name","Address","Quantity"
+"Kristian Quan","123 Company Place, Big City","4"
+"Matthew Rand","The Orchard, Little Village","2"
+"Eirik Asaki","497 Park Skyway, Future City","29"
+"Jarek Hanssen","1023 Riviera Drive, Southern Precinct","45"
+"Carlos Hartmann","The Manor House, Country Estate","1"
+"Bea King","Floor 201, Sun Tower, Central City","32"
+"Stian Hinton","Mechanical workshop, Fishing Village, North River","0"
+"Shane Bowland","P.O. Box 419, Beach Resort","1"
+"Gavin Holm","19 Library Road, University Campus, near Large Town","16"
+"Adrienna Randles","98 Tapestry Road, Market Town, The Shires","1"
diff --git a/examples/webkit/webplugin/main.cpp b/examples/webkit/webplugin/main.cpp
new file mode 100644
index 0000000000..fd2b2337bb
--- /dev/null
+++ b/examples/webkit/webplugin/main.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow window;
+ window.show();
+ return app.exec();
+}
diff --git a/examples/webkit/webplugin/mainwindow.cpp b/examples/webkit/webplugin/mainwindow.cpp
new file mode 100644
index 0000000000..188e08f4d0
--- /dev/null
+++ b/examples/webkit/webplugin/mainwindow.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFile>
+#include <QWebView>
+#include "csvfactory.h"
+#include "mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ QWebSettings::globalSettings()->setAttribute(
+ QWebSettings::PluginsEnabled, true);
+
+ QWebView *webView = new QWebView;
+ CSVFactory *factory = new CSVFactory(webView, this);
+ webView->page()->setPluginFactory(factory);
+ webView->setUrl(QUrl("qrc:/pages/index.html"));
+
+ setCentralWidget(webView);
+ setWindowTitle(tr("Web Plugin Example"));
+}
diff --git a/examples/webkit/webplugin/mainwindow.h b/examples/webkit/webplugin/mainwindow.h
new file mode 100644
index 0000000000..12c8306c02
--- /dev/null
+++ b/examples/webkit/webplugin/mainwindow.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+};
+
+#endif
diff --git a/examples/webkit/webplugin/pages/index.html b/examples/webkit/webplugin/pages/index.html
new file mode 100644
index 0000000000..fe38bbae82
--- /dev/null
+++ b/examples/webkit/webplugin/pages/index.html
@@ -0,0 +1,64 @@
+<html>
+<head>
+<title>Web Plugin</title>
+<!-- [script] -->
+<script type="text/javascript">
+function fillInTable(name, address, quantity)
+{
+ var nameElement = document.getElementById("customers_name");
+ var addressElement = document.getElementById("customers_address");
+ var quantityElement = document.getElementById("customers_quantity");
+
+ nameElement.innerHTML = name;
+ addressElement.innerHTML = address;
+ quantityElement.innerHTML = quantity;
+}
+</script>
+<!-- [script] -->
+</head>
+
+<body>
+<h1>Web Plugin</h1>
+
+<p>
+ This plugin displays comma-separated value (CSV) files in Web pages using
+ a table widget.
+</p>
+
+<!-- [embedded object] -->
+<object type="text/csv;header=present;charset=utf8"
+ data="qrc:/data/accounts.csv"
+ width="100%" height="300">
+</object>
+<!-- [embedded object] -->
+
+<p>
+ The table above shows some sample data rendered by the plugin. It is exposed
+ to this page as the <tt>view</tt> JavaScript object.
+</p>
+
+<p>
+ The fields shown below in an HTML table can be updated by selecting a row in
+ the table above. A signal in the view is connected to a JavaScript function
+ in this page which fills in the values.
+</p>
+
+<div style="margin-left: 5%; width: 90%; background-color: lightgray">
+<!-- [table] -->
+<table>
+<tr>
+ <th>Name:</th>
+ <td id="customers_name"></td>
+</tr><tr>
+ <th>Address:</th>
+ <td id="customers_address"></td>
+</tr><tr>
+ <th>Quantity:</th>
+ <td id="customers_quantity"></td>
+</tr>
+</table>
+<!-- [table] -->
+</div>
+
+</body>
+</html>
diff --git a/examples/webkit/webplugin/webplugin.pro b/examples/webkit/webplugin/webplugin.pro
new file mode 100644
index 0000000000..48f48d136e
--- /dev/null
+++ b/examples/webkit/webplugin/webplugin.pro
@@ -0,0 +1,23 @@
+QT += webkit network
+
+HEADERS = csvfactory.h \
+ csvview.h \
+ mainwindow.h
+
+SOURCES = csvfactory.cpp \
+ csvview.cpp \
+ main.cpp \
+ mainwindow.cpp
+
+RESOURCES = webplugin.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/webkit/webplugin
+sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/webplugin
+INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000EFFE
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/webkit/webplugin/webplugin.qrc b/examples/webkit/webplugin/webplugin.qrc
new file mode 100644
index 0000000000..14f80e7ac0
--- /dev/null
+++ b/examples/webkit/webplugin/webplugin.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>pages/index.html</file>
+ <file>data/accounts.csv</file>
+ </qresource>
+</RCC>
diff --git a/examples/widgets/analogclock/analogclock.desktop b/examples/widgets/analogclock/analogclock.desktop
new file mode 100644
index 0000000000..b177a62d35
--- /dev/null
+++ b/examples/widgets/analogclock/analogclock.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Analog Clock
+Exec=/opt/usr/bin/analogclock
+Icon=analogclock
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro
index 34c0ec5323..5f901ef5ec 100644
--- a/examples/widgets/analogclock/analogclock.pro
+++ b/examples/widgets/analogclock/analogclock.pro
@@ -12,3 +12,5 @@ symbian {
TARGET.UID3 = 0xA000A64F
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/analogclock/main.cpp b/examples/widgets/analogclock/main.cpp
index 0f31f07573..040fbb0265 100644
--- a/examples/widgets/analogclock/main.cpp
+++ b/examples/widgets/analogclock/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
AnalogClock clock;
+#if defined(Q_OS_SYMBIAN)
+ clock.showMaximized();
+#else
clock.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/applicationicon/applicationicon.desktop b/examples/widgets/applicationicon/applicationicon.desktop
new file mode 100644
index 0000000000..9645802195
--- /dev/null
+++ b/examples/widgets/applicationicon/applicationicon.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Application Icon
+Exec=/opt/usr/bin/applicationicon
+Icon=applicationicon
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/applicationicon/applicationicon.png b/examples/widgets/applicationicon/applicationicon.png
new file mode 100644
index 0000000000..83a186ee56
--- /dev/null
+++ b/examples/widgets/applicationicon/applicationicon.png
Binary files differ
diff --git a/examples/widgets/applicationicon/applicationicon.pro b/examples/widgets/applicationicon/applicationicon.pro
new file mode 100644
index 0000000000..f9ab55d82b
--- /dev/null
+++ b/examples/widgets/applicationicon/applicationicon.pro
@@ -0,0 +1,30 @@
+
+QT += core gui
+
+TARGET = applicationicon
+TEMPLATE = app
+
+SOURCES += main.cpp
+
+OTHER_FILES += applicationicon.svg \
+ applicationicon.png \
+ applicationicon.desktop
+
+symbian {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ # override icon
+ ICON = applicationicon.svg
+ TARGET.UID3 = 0xe9f919ee
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+}
+
+maemo5 {
+ include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+ # override icon from maemo5pkgrules.pri
+ icon.files = $${TARGET}.png
+}
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/applicationicon/applicationicon.svg b/examples/widgets/applicationicon/applicationicon.svg
new file mode 100644
index 0000000000..aa2835b08f
--- /dev/null
+++ b/examples/widgets/applicationicon/applicationicon.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" baseProfile="tiny" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 44 44">
+ <defs>
+ <linearGradient id="linearGradient2824" y2="1051.4" gradientUnits="userSpaceOnUse" x2="30.217" y1="1009.4" x1="15.109">
+ <stop stop-color="#41a200" offset="0"/>
+ <stop stop-color="#9be948" offset="0.63897"/>
+ <stop stop-color="#beff61" offset="1"/>
+ </linearGradient>
+ <linearGradient id="linearGradient2848" y2="1009.4" gradientUnits="userSpaceOnUse" y1="1053.7" gradientTransform="matrix(0.85714286,0,0,0.85714286,2.1428572,146.19467)" x2="15.085" x1="31.027">
+ <stop stop-color="#41a200" offset="0"/>
+ <stop stop-color="#9be948" offset="0.88602"/>
+ <stop stop-color="#beff61" offset="1"/>
+ </linearGradient>
+ </defs>
+ <g id="layer1" transform="translate(0,-1008.3622)">
+ <path id="rect2816" d="m8.412,1009h27.18c4.106,0,7.412,3.306,7.412,7.412v27.18c0,4.106-3.306,7.412-7.412,7.412h-27.18c-4.106,0-7.412-3-7.412-7v-27.18c0-4.106,3.306-7.412,7.412-7.412z" stroke-linecap="round" stroke-miterlimit="4" stroke-width="0.64300001" fill="url(#linearGradient2824)"/>
+ <path id="rect2816-4" d="m9.353,1011h25.29c3.52,0,6.353,2.833,6.353,6.353v25.29c0,3.519-2.833,6.353-6.353,6.353h-25.29c-3.52-0.1-6.353-2.1-6.353-6.1v-25.29c0-3.519,2.833-6.353,6.353-6.353z" stroke-linecap="round" stroke-miterlimit="4" stroke-width="0.64300001" fill="url(#linearGradient2848)"/>
+ <g id="text2893" font-weight="normal" transform="translate(-1.100281,1010.3622)" font-style="normal" font-stretch="normal" font-size="48px" font-variant="normal" font-family="Cambria Math" fill="#e5ffd5">
+ <path id="path2908" fill="#e5ffd5" d="m11.92,35.44c1.359-1.719,2.672-3.828,3.938-6.328l7.522-14.742c-0.8-3.13-1.54-5.321-2.24-6.586-0.69-1.266-1.76-1.899-3.2-1.899-1.328,0.0000307-2.594,0.6563-3.797,1.969l-1.148-1.266c2.156-2.359,4.289-3.539,6.398-3.539,1.469,0.0000335,2.609,0.418,3.422,1.254,0.8125,0.836,1.492,2.168,2.039,3.996,0.5469,1.828,1.32,5.359,2.32,10.59,1.297,6.828,2.309,11.14,3.035,12.93,0.7265,1.789,1.59,2.684,2.59,2.684,0.7187,0.000002,1.383-0.25,1.992-0.75l0.8906,1.406c-1.547,1.203-2.938,1.805-4.172,1.805-1.75,0-3-0.8984-3.75-2.695-0.75-1.797-1.797-6.633-3.141-14.51h-0.1406c-2.658,5.391-5.258,11.001-7.798,16.831h-4.758z"/>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/examples/widgets/applicationicon/main.cpp b/examples/widgets/applicationicon/main.cpp
new file mode 100644
index 0000000000..566284d82a
--- /dev/null
+++ b/examples/widgets/applicationicon/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QtGui/QLabel>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ QLabel label(QObject::tr("Hello, world!"));
+#if defined(Q_WS_S60)
+ label.showMaximized();
+#else
+ label.show();
+#endif
+ return a.exec();
+}
diff --git a/examples/widgets/calculator/calculator.cpp b/examples/widgets/calculator/calculator.cpp
index 991ffc3efc..3fbdf03b9a 100644
--- a/examples/widgets/calculator/calculator.cpp
+++ b/examples/widgets/calculator/calculator.cpp
@@ -47,7 +47,7 @@
//! [0]
Calculator::Calculator(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
sumInMemory = 0.0;
sumSoFar = 0.0;
@@ -98,8 +98,11 @@ Calculator::Calculator(QWidget *parent)
//! [5]
QGridLayout *mainLayout = new QGridLayout;
//! [5] //! [6]
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
+#else
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
-
+#endif
mainLayout->addWidget(display, 0, 0, 1, 6);
mainLayout->addWidget(backspaceButton, 1, 0, 1, 2);
mainLayout->addWidget(clearButton, 1, 2, 1, 2);
diff --git a/examples/widgets/calculator/calculator.desktop b/examples/widgets/calculator/calculator.desktop
new file mode 100644
index 0000000000..d0ae81d5a9
--- /dev/null
+++ b/examples/widgets/calculator/calculator.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Calculator
+Exec=/opt/usr/bin/calculator
+Icon=calculator
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/calculator/calculator.h b/examples/widgets/calculator/calculator.h
index e1221f4f70..3548b85625 100644
--- a/examples/widgets/calculator/calculator.h
+++ b/examples/widgets/calculator/calculator.h
@@ -41,7 +41,7 @@
#ifndef CALCULATOR_H
#define CALCULATOR_H
-#include <QDialog>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QLineEdit;
@@ -49,7 +49,7 @@ QT_END_NAMESPACE
class Button;
//! [0]
-class Calculator : public QDialog
+class Calculator : public QWidget
{
Q_OBJECT
diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro
index b31208e551..fe788ac038 100644
--- a/examples/widgets/calculator/calculator.pro
+++ b/examples/widgets/calculator/calculator.pro
@@ -14,3 +14,5 @@ symbian {
TARGET.UID3 = 0xA000C602
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/calculator/main.cpp b/examples/widgets/calculator/main.cpp
index 0038aa10dd..3974f801b1 100644
--- a/examples/widgets/calculator/main.cpp
+++ b/examples/widgets/calculator/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Calculator calc;
+#if defined(Q_OS_SYMBIAN)
+ calc.showMaximized();
+#else
calc.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/calculator/releasenotes.txt b/examples/widgets/calculator/releasenotes.txt
new file mode 100644
index 0000000000..053f651dba
--- /dev/null
+++ b/examples/widgets/calculator/releasenotes.txt
@@ -0,0 +1,4 @@
+Calculator
+=============
+
+Compared to the original example in the Qt SDK, the Calculator class (calculator.h) has been derived from QWidget instead of QDialog because in Maemo you cannot have any additional controls with dialogs. The mainLayout size constraint has been changed to SetNoConstraint to enable immediate scaling of the grid in Symbian. Screen definition for Symbian has been changed to showMaximized() to enable correct scaling of the application (see main.cpp). \ No newline at end of file
diff --git a/examples/widgets/calendarwidget/calendarwidget.desktop b/examples/widgets/calendarwidget/calendarwidget.desktop
new file mode 100644
index 0000000000..645dc412e3
--- /dev/null
+++ b/examples/widgets/calendarwidget/calendarwidget.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Calendar Widget
+Exec=/opt/usr/bin/calendarwidget
+Icon=calendarwidget
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro
index 4675db1a1e..64205fa591 100644
--- a/examples/widgets/calendarwidget/calendarwidget.pro
+++ b/examples/widgets/calendarwidget/calendarwidget.pro
@@ -12,3 +12,8 @@ symbian {
TARGET.UID3 = 0xA000C603
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/charactermap/charactermap.desktop b/examples/widgets/charactermap/charactermap.desktop
new file mode 100644
index 0000000000..7f1919470a
--- /dev/null
+++ b/examples/widgets/charactermap/charactermap.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Character Map
+Exec=/opt/usr/bin/charactermap
+Icon=charactermap
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/charactermap/charactermap.pro b/examples/widgets/charactermap/charactermap.pro
index eea2cb4c8a..2b777ff827 100644
--- a/examples/widgets/charactermap/charactermap.pro
+++ b/examples/widgets/charactermap/charactermap.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/codeeditor/codeeditor.desktop b/examples/widgets/codeeditor/codeeditor.desktop
new file mode 100644
index 0000000000..9347479e11
--- /dev/null
+++ b/examples/widgets/codeeditor/codeeditor.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Code Editor
+Exec=/opt/usr/bin/codeeditor
+Icon=codeeditor
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/codeeditor/codeeditor.pro b/examples/widgets/codeeditor/codeeditor.pro
index a94a5e054a..4bef727dac 100644
--- a/examples/widgets/codeeditor/codeeditor.pro
+++ b/examples/widgets/codeeditor/codeeditor.pro
@@ -7,3 +7,8 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/codeeditor
INSTALLS += target sources
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/widgets/codeeditor/main.cpp b/examples/widgets/codeeditor/main.cpp
index a2a81a1a85..cd87ac9ec0 100644
--- a/examples/widgets/codeeditor/main.cpp
+++ b/examples/widgets/codeeditor/main.cpp
@@ -48,7 +48,11 @@ int main(int argv, char **args)
CodeEditor editor;
editor.setWindowTitle(QObject::tr("Code Editor Example"));
+#if defined(Q_OS_SYMBIAN)
+ editor.showMaximized();
+#else
editor.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/digitalclock/digitalclock.desktop b/examples/widgets/digitalclock/digitalclock.desktop
new file mode 100644
index 0000000000..b13876878c
--- /dev/null
+++ b/examples/widgets/digitalclock/digitalclock.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Digital Clock
+Exec=/opt/usr/bin/digitalclock
+Icon=digitalclock
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/digitalclock/digitalclock.pro b/examples/widgets/digitalclock/digitalclock.pro
index 78e9eaea8a..e5a3657809 100644
--- a/examples/widgets/digitalclock/digitalclock.pro
+++ b/examples/widgets/digitalclock/digitalclock.pro
@@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/digitalclock/main.cpp b/examples/widgets/digitalclock/main.cpp
index c43162bade..d022918b2c 100644
--- a/examples/widgets/digitalclock/main.cpp
+++ b/examples/widgets/digitalclock/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
DigitalClock clock;
+#if defined(Q_OS_SYMBIAN)
+ clock.showMaximized();
+#else
clock.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/elidedlabel/elidedlabel.cpp b/examples/widgets/elidedlabel/elidedlabel.cpp
new file mode 100644
index 0000000000..fcee5c893a
--- /dev/null
+++ b/examples/widgets/elidedlabel/elidedlabel.cpp
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "elidedlabel.h"
+
+#include <QPainter>
+#include <QTextLayout>
+#include <QDebug>
+
+//! [0]
+ElidedLabel::ElidedLabel(const QString &text, QWidget *parent)
+ : QFrame(parent)
+ , elided(false)
+ , content(text)
+{
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+}
+//! [0]
+
+//! [1]
+void ElidedLabel::setText(const QString &newText)
+{
+ content = newText;
+ update();
+}
+//! [1]
+
+//! [2]
+void ElidedLabel::paintEvent(QPaintEvent *event)
+{
+ QFrame::paintEvent(event);
+
+ QPainter painter(this);
+ QFontMetrics fontMetrics = painter.fontMetrics();
+
+ bool didElide = false;
+ int lineSpacing = fontMetrics.lineSpacing();
+ int y = 0;
+
+ QTextLayout textLayout(content, painter.font());
+ textLayout.beginLayout();
+ forever {
+ QTextLine line = textLayout.createLine();
+
+ if (!line.isValid())
+ break;
+
+ line.setLineWidth(width());
+ int nextLineY = y + lineSpacing;
+
+ if (height() >= nextLineY + lineSpacing) {
+ line.draw(&painter, QPoint(0, y));
+ y = nextLineY;
+ //! [2]
+ //! [3]
+ } else {
+ QString lastLine = content.mid(line.textStart());
+ QString elidedLastLine = fontMetrics.elidedText(lastLine, Qt::ElideRight, width());
+ painter.drawText(QPoint(0, y + fontMetrics.ascent()), elidedLastLine);
+ line = textLayout.createLine();
+ didElide = line.isValid();
+ break;
+ }
+ }
+ textLayout.endLayout();
+ //! [3]
+
+ //! [4]
+ if (didElide != elided) {
+ elided = didElide;
+ emit elisionChanged(didElide);
+ }
+}
+//! [4]
diff --git a/examples/widgets/elidedlabel/elidedlabel.desktop b/examples/widgets/elidedlabel/elidedlabel.desktop
new file mode 100644
index 0000000000..5da3a6c15a
--- /dev/null
+++ b/examples/widgets/elidedlabel/elidedlabel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Elided Label
+Exec=/opt/usr/bin/elidedlabel
+Icon=elidedlabel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/elidedlabel/elidedlabel.h b/examples/widgets/elidedlabel/elidedlabel.h
new file mode 100644
index 0000000000..bbf284bd51
--- /dev/null
+++ b/examples/widgets/elidedlabel/elidedlabel.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ELIDEDLABEL_H
+#define ELIDEDLABEL_H
+
+#include <QFrame>
+#include <QRect>
+#include <QResizeEvent>
+#include <QString>
+#include <QWidget>
+
+//! [0]
+class ElidedLabel : public QFrame
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text WRITE setText)
+ Q_PROPERTY(bool isElided READ isElided)
+
+public:
+ ElidedLabel(const QString &text, QWidget *parent = 0);
+
+ void setText(const QString &text);
+ const QString & text() const { return content; }
+ bool isElided() const { return elided; }
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+signals:
+ void elisionChanged(bool elided);
+
+private:
+ bool elided;
+ QString content;
+};
+//! [0]
+
+#endif // TEXTWRAPPINGWIDGET_H
diff --git a/examples/widgets/elidedlabel/elidedlabel.pro b/examples/widgets/elidedlabel/elidedlabel.pro
new file mode 100644
index 0000000000..072cd2fb14
--- /dev/null
+++ b/examples/widgets/elidedlabel/elidedlabel.pro
@@ -0,0 +1,31 @@
+# Nokia Qt Examples: elided label example
+
+QT += core gui
+
+TARGET = elidedlabel
+TEMPLATE = app
+
+SOURCES += \
+ main.cpp\
+ testwidget.cpp \
+ elidedlabel.cpp
+
+HEADERS += \
+ testwidget.h \
+ elidedlabel.h
+
+CONFIG += mobility
+MOBILITY =
+
+symbian {
+ TARGET.UID3 = 0xE2728354 # randomly generated
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/elidedlabel/main.cpp b/examples/widgets/elidedlabel/main.cpp
new file mode 100644
index 0000000000..512ac46430
--- /dev/null
+++ b/examples/widgets/elidedlabel/main.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "testwidget.h"
+
+#include <QtGui/QApplication>
+
+//! [0]
+int main( int argc, char *argv[] )
+{
+ QApplication application( argc, argv );
+ TestWidget w;
+ w.showFullScreen();
+ return application.exec();
+}
+//! [0]
diff --git a/examples/widgets/elidedlabel/testwidget.cpp b/examples/widgets/elidedlabel/testwidget.cpp
new file mode 100644
index 0000000000..79a47f043e
--- /dev/null
+++ b/examples/widgets/elidedlabel/testwidget.cpp
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "testwidget.h"
+#include "elidedlabel.h"
+
+#include <QLabel>
+#include <QPushButton>
+#include <QSizePolicy>
+#include <QGridLayout>
+
+//! [0]
+TestWidget::TestWidget(QWidget *parent):
+ QWidget(parent)
+{
+ const QString romeo = tr(
+ "But soft, what light through yonder window breaks? / "
+ "It is the east, and Juliet is the sun. / "
+ "Arise, fair sun, and kill the envious moon, / "
+ "Who is already sick and pale with grief / "
+ "That thou, her maid, art far more fair than she."
+ );
+
+ const QString macbeth = tr(
+ "To-morrow, and to-morrow, and to-morrow, / "
+ "Creeps in this petty pace from day to day, / "
+ "To the last syllable of recorded time; / "
+ "And all our yesterdays have lighted fools / "
+ "The way to dusty death. Out, out, brief candle! / "
+ "Life's but a walking shadow, a poor player, / "
+ "That struts and frets his hour upon the stage, / "
+ "And then is heard no more. It is a tale / "
+ "Told by an idiot, full of sound and fury, / "
+ "Signifying nothing."
+ );
+
+ const QString harry = tr("Feeling lucky, punk?");
+
+ textSamples << romeo << macbeth << harry;
+ //! [0]
+
+ //! [1]
+ sampleIndex = 0;
+ elidedText = new ElidedLabel(textSamples[sampleIndex], this);
+ elidedText->setFrameStyle(QFrame::Box);
+ //! [1]
+
+ //! [2]
+ QPushButton *switchButton = new QPushButton(tr("Switch text"));
+ connect(switchButton, SIGNAL(clicked(bool)), this, SLOT(switchText()));
+
+ QPushButton *exitButton = new QPushButton(tr("Exit"));
+ connect(exitButton, SIGNAL(clicked(bool)), this, SLOT(close()));
+
+ QLabel *label = new QLabel(tr("Elided"));
+ label->setVisible(elidedText->isElided());
+ connect(elidedText, SIGNAL(elisionChanged(bool)), label, SLOT(setVisible(bool)));
+ //! [2]
+
+ //! [3]
+ widthSlider = new QSlider(Qt::Horizontal);
+ widthSlider->setMinimum(0);
+ connect(widthSlider, SIGNAL(valueChanged(int)), this, SLOT(onWidthChanged(int)));
+
+ heightSlider = new QSlider(Qt::Vertical);
+ heightSlider->setInvertedAppearance(true);
+ heightSlider->setMinimum(0);
+ connect(heightSlider, SIGNAL(valueChanged(int)), this, SLOT(onHeightChanged(int)));
+ //! [3]
+
+ //! [4]
+ QGridLayout *layout = new QGridLayout();
+ layout->addWidget(label, 0, 1, Qt::AlignCenter);
+ layout->addWidget(switchButton, 0, 2);
+ layout->addWidget(exitButton, 0, 3);
+ layout->addWidget(widthSlider, 1, 1, 1, 3);
+ layout->addWidget(heightSlider, 2, 0);
+ layout->addWidget(elidedText, 2, 1, 1, 3, Qt::AlignTop | Qt::AlignLeft);
+
+ setLayout(layout);
+ //! [4]
+
+ //! [5]
+#ifdef Q_WS_MAEMO_5
+ setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+#endif
+}
+//! [5]
+
+//! [6]
+void TestWidget::resizeEvent(QResizeEvent *event)
+{
+ Q_UNUSED(event)
+
+ int maxWidth = widthSlider->width();
+ widthSlider->setMaximum(maxWidth);
+ widthSlider->setValue(maxWidth / 2);
+
+ int maxHeight = heightSlider->height();
+ heightSlider->setMaximum(maxHeight);
+ heightSlider->setValue(maxHeight / 2);
+
+ elidedText->setFixedSize(widthSlider->value(), heightSlider->value());
+}
+//! [6]
+
+//! [7]
+void TestWidget::switchText()
+{
+ sampleIndex = (sampleIndex + 1) % textSamples.size();
+ elidedText->setText(textSamples.at(sampleIndex));
+}
+//! [7]
+
+//! [8]
+void TestWidget::onWidthChanged(int width)
+{
+ elidedText->setFixedWidth(width);
+}
+
+void TestWidget::onHeightChanged(int height)
+{
+ elidedText->setFixedHeight(height);
+}
+//! [8]
+
+
diff --git a/examples/widgets/elidedlabel/testwidget.h b/examples/widgets/elidedlabel/testwidget.h
new file mode 100644
index 0000000000..6c43a87edc
--- /dev/null
+++ b/examples/widgets/elidedlabel/testwidget.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TESTWIDGET_H
+#define TESTWIDGET_H
+
+#include <QWidget>
+#include <QStringList>
+#include <QSlider>
+#include <QComboBox>
+
+class ElidedLabel;
+
+//! [0]
+class TestWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TestWidget(QWidget *parent = 0);
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+
+private slots:
+ void switchText();
+ void onWidthChanged(int width);
+ void onHeightChanged(int height);
+
+private:
+ int sampleIndex;
+ QStringList textSamples;
+ ElidedLabel *elidedText;
+ QSlider *heightSlider;
+ QSlider *widthSlider;
+};
+//! [0]
+
+#endif // TESTWIDGET_H
diff --git a/examples/widgets/groupbox/groupbox.desktop b/examples/widgets/groupbox/groupbox.desktop
new file mode 100644
index 0000000000..8239bbf5d0
--- /dev/null
+++ b/examples/widgets/groupbox/groupbox.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Group Box
+Exec=/opt/usr/bin/groupbox
+Icon=groupbox
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/groupbox/groupbox.pro b/examples/widgets/groupbox/groupbox.pro
index 2757ce1291..30838044e7 100644
--- a/examples/widgets/groupbox/groupbox.pro
+++ b/examples/widgets/groupbox/groupbox.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/groupbox/main.cpp b/examples/widgets/groupbox/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/widgets/groupbox/main.cpp
+++ b/examples/widgets/groupbox/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/icons/icons.desktop b/examples/widgets/icons/icons.desktop
new file mode 100644
index 0000000000..df90cc5e6f
--- /dev/null
+++ b/examples/widgets/icons/icons.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Icons
+Exec=/opt/usr/bin/icons
+Icon=icons
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro
index 48b2da907c..478303c3a0 100644
--- a/examples/widgets/icons/icons.pro
+++ b/examples/widgets/icons/icons.pro
@@ -25,3 +25,8 @@ wince*: {
}
DEPLOYMENT += imageFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/icons/main.cpp b/examples/widgets/icons/main.cpp
index 923c1f8514..c1ba2bda40 100644
--- a/examples/widgets/icons/main.cpp
+++ b/examples/widgets/icons/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showMaximized();
+#else
mainWin.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/imageviewer/imageviewer.desktop b/examples/widgets/imageviewer/imageviewer.desktop
new file mode 100644
index 0000000000..63f2408c38
--- /dev/null
+++ b/examples/widgets/imageviewer/imageviewer.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Image Viewer
+Exec=/opt/usr/bin/imageviewer
+Icon=imageviewer
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro
index c8656187ed..00652ffc3a 100644
--- a/examples/widgets/imageviewer/imageviewer.pro
+++ b/examples/widgets/imageviewer/imageviewer.pro
@@ -10,6 +10,14 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+#Symbian has built-in component named imageviewer so we use different target
+symbian: TARGET = imageviewerexample
+
wince*: {
DEPLOYMENT_PLUGIN += qjpeg qmng qgif
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/imageviewer/main.cpp b/examples/widgets/imageviewer/main.cpp
index 55a362a622..8d1a068c5a 100644
--- a/examples/widgets/imageviewer/main.cpp
+++ b/examples/widgets/imageviewer/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
ImageViewer imageViewer;
+#if defined(Q_OS_SYMBIAN)
+ imageViewer.showMaximized();
+#else
imageViewer.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/lineedits/lineedits.desktop b/examples/widgets/lineedits/lineedits.desktop
new file mode 100644
index 0000000000..7d8dea3ec0
--- /dev/null
+++ b/examples/widgets/lineedits/lineedits.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Line Edits
+Exec=/opt/usr/bin/lineedits
+Icon=lineedits
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro
index 0a40dcf918..a641659699 100644
--- a/examples/widgets/lineedits/lineedits.pro
+++ b/examples/widgets/lineedits/lineedits.pro
@@ -12,3 +12,8 @@ symbian {
TARGET.UID3 = 0xA000C604
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/lineedits/main.cpp b/examples/widgets/lineedits/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/widgets/lineedits/main.cpp
+++ b/examples/widgets/lineedits/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/maemovibration/buttonwidget.cpp b/examples/widgets/maemovibration/buttonwidget.cpp
new file mode 100644
index 0000000000..d56d7a5160
--- /dev/null
+++ b/examples/widgets/maemovibration/buttonwidget.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "buttonwidget.h"
+#include <QSignalMapper>
+#include <QGridLayout>
+#include <QPushButton>
+
+//! [0]
+ButtonWidget::ButtonWidget(QStringList texts, QWidget *parent)
+ : QWidget(parent)
+{
+ signalMapper = new QSignalMapper(this);
+
+ QGridLayout *gridLayout = new QGridLayout;
+ for (int i = 0; i < texts.size(); ++i) {
+ QPushButton *button = new QPushButton(texts[i]);
+ connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
+ signalMapper->setMapping(button, texts[i]);
+ gridLayout->addWidget(button, i / 2, i % 2);
+ }
+
+ connect(signalMapper, SIGNAL(mapped(const QString &)),
+ this, SIGNAL(clicked(const QString &)));
+
+ setLayout(gridLayout);
+}
+//! [0]
+
diff --git a/examples/widgets/maemovibration/buttonwidget.h b/examples/widgets/maemovibration/buttonwidget.h
new file mode 100644
index 0000000000..3068825212
--- /dev/null
+++ b/examples/widgets/maemovibration/buttonwidget.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BUTTONWIDGET_H
+#define BUTTONWIDGET_H
+
+#include <QWidget>
+#include <QSignalMapper>
+
+//! [0]
+class ButtonWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ButtonWidget(QStringList texts, QWidget *parent = 0);
+
+signals:
+ void clicked(const QString &text);
+
+private:
+ QSignalMapper *signalMapper;
+};
+//! [0]
+
+#endif // BUTTONWIDGET_H
+
diff --git a/examples/widgets/maemovibration/data/48x48/maemovibration.png b/examples/widgets/maemovibration/data/48x48/maemovibration.png
new file mode 100644
index 0000000000..f32e9ced99
--- /dev/null
+++ b/examples/widgets/maemovibration/data/48x48/maemovibration.png
Binary files differ
diff --git a/examples/widgets/maemovibration/data/64x64/maemovibration.png b/examples/widgets/maemovibration/data/64x64/maemovibration.png
new file mode 100644
index 0000000000..f09cf7c3c6
--- /dev/null
+++ b/examples/widgets/maemovibration/data/64x64/maemovibration.png
Binary files differ
diff --git a/examples/widgets/maemovibration/data/maemovibration.desktop b/examples/widgets/maemovibration/data/maemovibration.desktop
new file mode 100644
index 0000000000..a88ed4e0aa
--- /dev/null
+++ b/examples/widgets/maemovibration/data/maemovibration.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Name=Maemo Vibration
+Exec=/usr/bin/maemovibration
+Icon=maemovibration
+X-HildonDesk-ShowInToolbar=true
+X-Window-Icon=maemovibration
+X-Window-Icon-Dimmed=maemovibration
+X-Osso-Type=application/x-executable
+X-Osso-Service=com.nokia.maemovibration
diff --git a/examples/widgets/maemovibration/data/maemovibration.service b/examples/widgets/maemovibration/data/maemovibration.service
new file mode 100644
index 0000000000..1fab19f35c
--- /dev/null
+++ b/examples/widgets/maemovibration/data/maemovibration.service
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=com.nokia.maemovibration
+Exec=/usr/bin/maemovibration
diff --git a/examples/widgets/maemovibration/maemovibration.pro b/examples/widgets/maemovibration/maemovibration.pro
new file mode 100644
index 0000000000..e4107c6dd7
--- /dev/null
+++ b/examples/widgets/maemovibration/maemovibration.pro
@@ -0,0 +1,52 @@
+TARGET = maemovibration
+HEADERS += buttonwidget.h mcevibrator.h
+SOURCES += main.cpp buttonwidget.cpp mcevibrator.cpp
+
+# All generated files goes same directory
+OBJECTS_DIR = build
+MOC_DIR = build
+UI_DIR = build
+DESTDIR = build
+
+TEMPLATE = app
+CONFIG += debug
+QT=core gui
+
+maemo5 {
+ QT += dbus
+ CONFIG += link_pkgconfig
+ PKG_CONFIG += mce
+ INSTALLS += target
+ target.path = /usr/bin/
+
+ INSTALLS += desktop
+ desktop.path = /usr/share/applications/hildon
+ desktop.files = data/maemovibration.desktop
+
+ INSTALLS += service
+ service.path = /usr/share/dbus-1/services
+ service.files = data/maemovibration.service
+
+ INSTALLS += icon64
+ icon64.path = /usr/share/icons/hicolor/64x64/apps
+ icon64.files = data/64x64/maemovibration.png
+
+ #
+ # Targets for debian source and binary package creation
+ #
+ debian-src.commands = dpkg-buildpackage -S -r -us -uc -d
+ debian-bin.commands = dpkg-buildpackage -b -r -uc -d
+ debian-all.depends = debian-src debian-bin
+
+ #
+ # Clean all but Makefile
+ #
+ compiler_clean.commands = -$(DEL_FILE) $(TARGET)
+
+ QMAKE_EXTRA_TARGETS += debian-all debian-src debian-bin compiler_clean
+}
+
+!maemo5 {
+ warning(The Maemo Vibration Example only works for the maemo target!)
+}
+
diff --git a/examples/widgets/maemovibration/main.cpp b/examples/widgets/maemovibration/main.cpp
new file mode 100644
index 0000000000..fbac37478a
--- /dev/null
+++ b/examples/widgets/maemovibration/main.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "buttonwidget.h"
+#include "mcevibrator.h"
+
+#include <QtDebug>
+#include <QApplication>
+#include <QFile>
+#include <QTextStream>
+#include <QMessageBox>
+#include <QTextStream>
+
+#include <cstdlib>
+
+//! [0]
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ QString path = MceVibrator::defaultMceFilePath;
+
+ QFile file(path);
+ QStringList names;
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QTextStream stream(&file);
+ names = MceVibrator::parsePatternNames(stream);
+ file.close();
+ }
+
+ if (names.isEmpty()){
+ qDebug() << "Could not read vibration pattern names from " << path;
+ a.exit(-1);
+ }
+//! [0]
+
+//! [1]
+ ButtonWidget buttonWidget(names);
+ MceVibrator vibrator;
+ QObject::connect(&buttonWidget, SIGNAL(clicked(const QString &)),
+ &vibrator, SLOT(vibrate(const QString &)));
+ buttonWidget.show();
+
+ return a.exec();
+}
+//! [1]
+
diff --git a/examples/widgets/maemovibration/mcevibrator.cpp b/examples/widgets/maemovibration/mcevibrator.cpp
new file mode 100644
index 0000000000..fcae1dc5d2
--- /dev/null
+++ b/examples/widgets/maemovibration/mcevibrator.cpp
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "mcevibrator.h"
+
+#include <QStringList>
+#include <QDebug>
+#include <QDBusConnection>
+#include <QDBusMessage>
+
+#include <mce/dbus-names.h>
+
+const char MceVibrator::defaultMceFilePath[] = "/etc/mce/mce.ini";
+
+//! [5]
+static void checkError(QDBusMessage &msg)
+{
+ if (msg.type() == QDBusMessage::ErrorMessage)
+ qDebug() << msg.errorName() << msg.errorMessage();
+}
+//! [5]
+
+//! [0]
+MceVibrator::MceVibrator(QObject *parent) :
+ QObject(parent),
+ mceInterface(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF,
+ QDBusConnection::systemBus())
+{
+ QDBusMessage reply = mceInterface.call(MCE_ENABLE_VIBRATOR);
+ checkError(reply);
+}
+//! [0]
+
+//! [3]
+MceVibrator::~MceVibrator()
+{
+ deactivate(lastPatternName);
+ QDBusMessage reply = mceInterface.call(MCE_DISABLE_VIBRATOR);
+ checkError(reply);
+}
+//! [3]
+
+//! [1]
+void MceVibrator::vibrate(const QString &patternName)
+{
+ deactivate(lastPatternName);
+ lastPatternName = patternName;
+ QDBusMessage reply = mceInterface.call(MCE_ACTIVATE_VIBRATOR_PATTERN, patternName);
+ checkError(reply);
+}
+//! [1]
+
+//! [2]
+void MceVibrator::deactivate(const QString &patternName)
+{
+ if (!patternName.isNull()) {
+ QDBusMessage reply = mceInterface.call(MCE_DEACTIVATE_VIBRATOR_PATTERN, patternName);
+ checkError(reply);
+ }
+}
+//! [2]
+
+//! [4]
+QStringList MceVibrator::parsePatternNames(QTextStream &stream)
+{
+ QStringList result;
+ QString line;
+
+ do {
+ line = stream.readLine();
+ if (line.startsWith(QLatin1String("VibratorPatterns="))) {
+ QString values = line.section('=', 1);
+ result = values.split(';');
+ break;
+ }
+ } while (!line.isNull());
+
+ return result;
+}
+//! [4]
+
diff --git a/examples/widgets/maemovibration/mcevibrator.h b/examples/widgets/maemovibration/mcevibrator.h
new file mode 100644
index 0000000000..fae99be035
--- /dev/null
+++ b/examples/widgets/maemovibration/mcevibrator.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MCEVIBRATOR_H
+#define MCEVIBRATOR_H
+
+#include <QObject>
+#include <QTextStream>
+#include <QDBusInterface>
+
+//! [0]
+class MceVibrator : public QObject
+{
+ Q_OBJECT
+public:
+ explicit MceVibrator(QObject *parent = 0);
+ ~MceVibrator();
+
+ static const char defaultMceFilePath[];
+ static QStringList parsePatternNames(QTextStream &stream);
+
+public slots:
+ void vibrate(const QString &patternName);
+
+private:
+ void deactivate(const QString &patternName);
+
+ QDBusInterface mceInterface;
+ QString lastPatternName;
+};
+//! [0]
+
+#endif // MCEVIBRATOR_H
+
diff --git a/examples/widgets/movie/main.cpp b/examples/widgets/movie/main.cpp
index 3863234936..b9a1c69914 100644
--- a/examples/widgets/movie/main.cpp
+++ b/examples/widgets/movie/main.cpp
@@ -47,5 +47,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MoviePlayer player;
player.show();
+#if defined(Q_OS_SYMBIAN)
+ player.showMaximized();
+#else
+ player.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/movie/movie.desktop b/examples/widgets/movie/movie.desktop
new file mode 100644
index 0000000000..5c7ae21896
--- /dev/null
+++ b/examples/widgets/movie/movie.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Movie
+Exec=/opt/usr/bin/movie
+Icon=movie
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro
index d59bf2ee26..62cc8bcfe2 100644
--- a/examples/widgets/movie/movie.pro
+++ b/examples/widgets/movie/movie.pro
@@ -17,3 +17,8 @@ wince*: {
DEPLOYMENT_PLUGIN += qmng
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/orientation/image_a.png b/examples/widgets/orientation/image_a.png
new file mode 100644
index 0000000000..4a1a0d3252
--- /dev/null
+++ b/examples/widgets/orientation/image_a.png
Binary files differ
diff --git a/examples/widgets/orientation/image_b.png b/examples/widgets/orientation/image_b.png
new file mode 100644
index 0000000000..8722d1edee
--- /dev/null
+++ b/examples/widgets/orientation/image_b.png
Binary files differ
diff --git a/examples/widgets/orientation/image_c.png b/examples/widgets/orientation/image_c.png
new file mode 100644
index 0000000000..6c9304fda0
--- /dev/null
+++ b/examples/widgets/orientation/image_c.png
Binary files differ
diff --git a/examples/widgets/orientation/images.qrc b/examples/widgets/orientation/images.qrc
new file mode 100644
index 0000000000..b258291e6f
--- /dev/null
+++ b/examples/widgets/orientation/images.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>image_a.png</file>
+ <file>image_b.png</file>
+ <file>image_c.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/widgets/orientation/landscape.ui b/examples/widgets/orientation/landscape.ui
new file mode 100644
index 0000000000..4616c041dc
--- /dev/null
+++ b/examples/widgets/orientation/landscape.ui
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LandscapeUI</class>
+ <widget class="QWidget" name="LandscapeUI">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>514</width>
+ <height>265</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">font-weight: bold;</string>
+ </property>
+ <property name="text">
+ <string>Landscape mode</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="exitButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Choices</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QRadioButton" name="radioAButton">
+ <property name="text">
+ <string>Long description explaining choice A</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <attribute name="buttonGroup">
+ <string>buttonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioBButton">
+ <property name="text">
+ <string>Long description explaining choice B</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string>buttonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioCButton">
+ <property name="text">
+ <string>Long description explaining choice C</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string>buttonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QWidget" name="choiceWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+ <buttongroups>
+ <buttongroup name="buttonGroup"/>
+ </buttongroups>
+</ui>
diff --git a/examples/widgets/orientation/main.cpp b/examples/widgets/orientation/main.cpp
new file mode 100644
index 0000000000..17e0da0066
--- /dev/null
+++ b/examples/widgets/orientation/main.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+//! [0]
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ MainWindow w;
+ w.showFullScreen();
+
+ return a.exec();
+}
+//! [0]
+
diff --git a/examples/widgets/orientation/mainwindow.cpp b/examples/widgets/orientation/mainwindow.cpp
new file mode 100644
index 0000000000..246a79dc72
--- /dev/null
+++ b/examples/widgets/orientation/mainwindow.cpp
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mainwindow.h"
+#include "ui_landscape.h"
+#include "ui_portrait.h"
+
+#include <QDesktopWidget>
+#include <QResizeEvent>
+
+//! [0]
+MainWindow::MainWindow(QWidget *parent) :
+ QWidget(parent),
+ landscapeWidget(0),
+ portraitWidget(0)
+{
+ landscapeWidget = new QWidget(this);
+ landscape.setupUi(landscapeWidget);
+
+ portraitWidget = new QWidget(this);
+ portrait.setupUi(portraitWidget);
+//! [0]
+
+//! [1]
+ connect(portrait.exitButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(landscape.exitButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(landscape.buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)),
+ this, SLOT(onRadioButtonClicked(QAbstractButton*)));
+
+ landscape.radioAButton->setChecked(true);
+ onRadioButtonClicked(landscape.radioAButton);
+//! [1]
+
+//! [2]
+#ifdef Q_WS_MAEMO_5
+ setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+#endif
+}
+//! [2]
+
+//! [3]
+void MainWindow::resizeEvent(QResizeEvent *event)
+{
+ QSize size = event->size();
+ bool isLandscape = size.width() > size.height();
+
+ if (!isLandscape)
+ size.transpose();
+
+ landscapeWidget->setFixedSize(size);
+ size.transpose();
+ portraitWidget->setFixedSize(size);
+
+ landscapeWidget->setVisible(isLandscape);
+ portraitWidget->setVisible(!isLandscape);
+}
+//! [3]
+
+//! [4]
+void MainWindow::onRadioButtonClicked(QAbstractButton *button)
+{
+ QString styleTemplate = "background-image: url(:/image_%1.png);"
+ "background-repeat: no-repeat;"
+ "background-position: center center";
+
+ QString imageStyle("");
+ if (button == landscape.radioAButton)
+ imageStyle = styleTemplate.arg("a");
+ else if (button == landscape.radioBButton)
+ imageStyle = styleTemplate.arg("b");
+ else if (button == landscape.radioCButton)
+ imageStyle = styleTemplate.arg("c");
+
+ portrait.choiceWidget->setStyleSheet(imageStyle);
+ landscape.choiceWidget->setStyleSheet(imageStyle);
+}
+//! [4]
+
diff --git a/examples/widgets/orientation/mainwindow.h b/examples/widgets/orientation/mainwindow.h
new file mode 100644
index 0000000000..400a6a5a7f
--- /dev/null
+++ b/examples/widgets/orientation/mainwindow.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QWidget>
+
+#include "ui_landscape.h"
+#include "ui_portrait.h"
+
+class QAbstractButton;
+
+//! [0]
+class MainWindow : public QWidget
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+
+private slots:
+ void onRadioButtonClicked(QAbstractButton *button);
+
+private:
+ Ui::LandscapeUI landscape;
+ Ui::PortraitUI portrait;
+ QWidget *landscapeWidget;
+ QWidget *portraitWidget;
+};
+//! [0]
+
+#endif // MAINWINDOW_H
diff --git a/examples/widgets/orientation/orientation.desktop b/examples/widgets/orientation/orientation.desktop
new file mode 100644
index 0000000000..7bbf5584d3
--- /dev/null
+++ b/examples/widgets/orientation/orientation.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Orientation
+Exec=/opt/usr/bin/orientation
+Icon=orientation
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/orientation/orientation.pro b/examples/widgets/orientation/orientation.pro
new file mode 100644
index 0000000000..c146322635
--- /dev/null
+++ b/examples/widgets/orientation/orientation.pro
@@ -0,0 +1,30 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-08-04T10:27:31
+#
+#-------------------------------------------------
+
+QT += core gui
+
+TARGET = orientation
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+ mainwindow.cpp
+
+HEADERS += mainwindow.h
+
+FORMS += \
+ portrait.ui \
+ landscape.ui
+
+RESOURCES += \
+ images.qrc
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/orientation/portrait.ui b/examples/widgets/orientation/portrait.ui
new file mode 100644
index 0000000000..31a55aff73
--- /dev/null
+++ b/examples/widgets/orientation/portrait.ui
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PortraitUI</class>
+ <widget class="QWidget" name="PortraitUI">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>201</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="styleSheet">
+ <string notr="true">font-weight: bold;</string>
+ </property>
+ <property name="text">
+ <string>Portrait mode</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QPushButton" name="exitButton">
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="helpLabel">
+ <property name="text">
+ <string>Switch to landscape mode. In landscape mode you can change visible image.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QWidget" name="choiceWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/widgets/scribble/main.cpp b/examples/widgets/scribble/main.cpp
index 01c8adae53..dffe80348a 100644
--- a/examples/widgets/scribble/main.cpp
+++ b/examples/widgets/scribble/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/scribble/scribble.desktop b/examples/widgets/scribble/scribble.desktop
new file mode 100644
index 0000000000..9c1ee0c482
--- /dev/null
+++ b/examples/widgets/scribble/scribble.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Scribble
+Exec=/opt/usr/bin/scribble
+Icon=scribble
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/scribble/scribble.pro b/examples/widgets/scribble/scribble.pro
index cf92a25fd5..46004a89d0 100644
--- a/examples/widgets/scribble/scribble.pro
+++ b/examples/widgets/scribble/scribble.pro
@@ -11,3 +11,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/shapedclock/main.cpp b/examples/widgets/shapedclock/main.cpp
index 9b7f951a48..f5e9718d4f 100644
--- a/examples/widgets/shapedclock/main.cpp
+++ b/examples/widgets/shapedclock/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
ShapedClock clock;
+#if defined(Q_OS_SYMBIAN)
+ clock.showMaximized();
+#else
clock.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/shapedclock/shapedclock.desktop b/examples/widgets/shapedclock/shapedclock.desktop
new file mode 100644
index 0000000000..bae58e30d5
--- /dev/null
+++ b/examples/widgets/shapedclock/shapedclock.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Shaped Clock
+Exec=/opt/usr/bin/shapedclock
+Icon=shapedclock
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro
index 0a2515f13b..af1e3dfcfb 100644
--- a/examples/widgets/shapedclock/shapedclock.pro
+++ b/examples/widgets/shapedclock/shapedclock.pro
@@ -12,3 +12,7 @@ symbian {
TARGET.UID3 = 0xA000C605
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
diff --git a/examples/widgets/sliders/main.cpp b/examples/widgets/sliders/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/widgets/sliders/main.cpp
+++ b/examples/widgets/sliders/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/sliders/sliders.desktop b/examples/widgets/sliders/sliders.desktop
new file mode 100644
index 0000000000..bc8904317b
--- /dev/null
+++ b/examples/widgets/sliders/sliders.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Sliders
+Exec=/opt/usr/bin/sliders
+Icon=sliders
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/sliders/sliders.pro b/examples/widgets/sliders/sliders.pro
index fd39a227be..9c15321e8f 100644
--- a/examples/widgets/sliders/sliders.pro
+++ b/examples/widgets/sliders/sliders.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/softkeys/softkeys.desktop b/examples/widgets/softkeys/softkeys.desktop
new file mode 100644
index 0000000000..7f4993a588
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Soft Keys
+Exec=/opt/usr/bin/softkeys
+Icon=softkeys
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro
index d4d192ff35..47dcd6bd4e 100644
--- a/examples/widgets/softkeys/softkeys.pro
+++ b/examples/widgets/softkeys/softkeys.pro
@@ -13,3 +13,5 @@ symbian {
TARGET.UID3 = 0xA000CF6B
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/spinboxes/main.cpp b/examples/widgets/spinboxes/main.cpp
index f2079f511b..4a43828d45 100644
--- a/examples/widgets/spinboxes/main.cpp
+++ b/examples/widgets/spinboxes/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/spinboxes/spinboxes.desktop b/examples/widgets/spinboxes/spinboxes.desktop
new file mode 100644
index 0000000000..7de30383f2
--- /dev/null
+++ b/examples/widgets/spinboxes/spinboxes.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Spin Boxes
+Exec=/opt/usr/bin/spinboxes
+Icon=spinboxes
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/spinboxes/spinboxes.pro b/examples/widgets/spinboxes/spinboxes.pro
index 129ec81e7b..60e963385d 100644
--- a/examples/widgets/spinboxes/spinboxes.pro
+++ b/examples/widgets/spinboxes/spinboxes.pro
@@ -9,3 +9,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/styles/styles.desktop b/examples/widgets/styles/styles.desktop
new file mode 100644
index 0000000000..fb9ef42994
--- /dev/null
+++ b/examples/widgets/styles/styles.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Styles
+Exec=/opt/usr/bin/styles
+Icon=styles
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/styles/styles.pro b/examples/widgets/styles/styles.pro
index 1228803a3b..5fb76f05e4 100644
--- a/examples/widgets/styles/styles.pro
+++ b/examples/widgets/styles/styles.pro
@@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/stylesheet/main.cpp b/examples/widgets/stylesheet/main.cpp
index fd417a0c18..3c2aaa280f 100644
--- a/examples/widgets/stylesheet/main.cpp
+++ b/examples/widgets/stylesheet/main.cpp
@@ -48,6 +48,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/stylesheet/stylesheet.desktop b/examples/widgets/stylesheet/stylesheet.desktop
new file mode 100644
index 0000000000..0550b19ba2
--- /dev/null
+++ b/examples/widgets/stylesheet/stylesheet.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Style Sheet
+Exec=/opt/usr/bin/stylesheet
+Icon=stylesheet
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/stylesheet/stylesheet.pro b/examples/widgets/stylesheet/stylesheet.pro
index c67eba33e2..8a0032f6ba 100644
--- a/examples/widgets/stylesheet/stylesheet.pro
+++ b/examples/widgets/stylesheet/stylesheet.pro
@@ -14,3 +14,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/symbianvibration/main.cpp b/examples/widgets/symbianvibration/main.cpp
new file mode 100644
index 0000000000..c6e0abbd3b
--- /dev/null
+++ b/examples/widgets/symbianvibration/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+#if defined(Q_WS_S60)
+ w.showMaximized();
+#else
+ w.show();
+#endif
+ return a.exec();
+}
diff --git a/examples/widgets/symbianvibration/mainwindow.cpp b/examples/widgets/symbianvibration/mainwindow.cpp
new file mode 100644
index 0000000000..d43877cda7
--- /dev/null
+++ b/examples/widgets/symbianvibration/mainwindow.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QMenuBar>
+#include "mainwindow.h"
+#include "vibrationsurface.h"
+#include "xqvibra.h"
+
+//! [0]
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ vibra = new XQVibra(this);
+ setCentralWidget(new VibrationSurface(vibra, this));
+ menuBar()->addAction(tr("Vibrate"), this, SLOT(vibrate()));
+}
+//! [0]
+
+//! [1]
+void MainWindow::vibrate()
+{
+ vibra->setIntensity(75);
+ vibra->start(2500);
+}
+//! [1]
+
diff --git a/examples/widgets/symbianvibration/mainwindow.h b/examples/widgets/symbianvibration/mainwindow.h
new file mode 100644
index 0000000000..c555cc5e4e
--- /dev/null
+++ b/examples/widgets/symbianvibration/mainwindow.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+class XQVibra;
+
+//! [0]
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+
+private slots:
+ void vibrate();
+
+private:
+ XQVibra *vibra;
+};
+//! [0]
+
+#endif // MAINWINDOW_H
diff --git a/examples/widgets/symbianvibration/symbianvibration.pro b/examples/widgets/symbianvibration/symbianvibration.pro
new file mode 100644
index 0000000000..d99b76d9e1
--- /dev/null
+++ b/examples/widgets/symbianvibration/symbianvibration.pro
@@ -0,0 +1,39 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-06-14T10:09:27
+#
+#-------------------------------------------------
+
+QT += core gui
+
+TARGET = symbianvibration
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+ mainwindow.cpp \
+ vibrationsurface.cpp \
+ xqvibra.cpp \
+ xqvibra_p.cpp
+
+HEADERS += mainwindow.h \
+ vibrationsurface.h \
+ xqvibra.h \
+ xqvibra_p.h
+
+CONFIG += mobility
+MOBILITY =
+
+symbian {
+ TARGET.UID3 = 0xecf47018
+ # TARGET.CAPABILITY +=
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+ LIBS += -lhwrmvibraclient
+ include($$PWD/../../symbianpkgrules.pri)
+}
+
+!symbian {
+ error(The Symbian Vibration Example only works for the Symbian target!)
+}
+
diff --git a/examples/widgets/symbianvibration/vibrationsurface.cpp b/examples/widgets/symbianvibration/vibrationsurface.cpp
new file mode 100644
index 0000000000..e06241d179
--- /dev/null
+++ b/examples/widgets/symbianvibration/vibrationsurface.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "vibrationsurface.h"
+#include <QtGui/QPainter>
+#include <QtCore/QLine>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QScreen>
+#include <QtCore/QRect>
+#include <QtGui/QColor>
+
+#include "xqvibra.h"
+
+//! [4]
+const int NumberOfLevels = 10;
+const double IntensityFactor = XQVibra::MaxIntensity / NumberOfLevels;
+//! [4]
+
+VibrationSurface::VibrationSurface(XQVibra *vibra, QWidget *parent) :
+ QWidget(parent),
+ vibra(vibra),
+ lastIntensity(0)
+{
+}
+
+//! [0]
+void VibrationSurface::mousePressEvent(QMouseEvent *event)
+{
+ applyIntensity(event->x(), event->y());
+ vibra->start();
+}
+//! [0]
+
+//! [1]
+void VibrationSurface::mouseMoveEvent(QMouseEvent *event)
+{
+ applyIntensity(event->x(), event->y());
+}
+//! [1]
+
+//! [2]
+void VibrationSurface::mouseReleaseEvent(QMouseEvent *)
+{
+ vibra->stop();
+}
+//! [2]
+
+//! [5]
+void VibrationSurface::paintEvent(QPaintEvent *)
+{
+ QPainter painter(this);
+ QRect rect = geometry();
+ int dx = 0, dy = 0;
+
+ if (height() > width()) {
+ dy = height() / NumberOfLevels;
+ rect.setHeight(dy);
+ } else {
+ dx = width() / NumberOfLevels;
+ rect.setWidth(dx);
+ }
+//! [5]
+//! [6]
+ for (int i = 0; i < NumberOfLevels; i++) {
+ int x = i * dx;
+ int y = i * dy;
+ int intensity = getIntensity(x, y);
+ QColor color = QColor(40, 80, 10).lighter(100 + intensity);
+
+ rect.moveTo(x, y);
+ painter.fillRect(rect, color);
+ painter.setPen(color.darker());
+ painter.drawText(rect, Qt::AlignCenter, QString::number(intensity));
+ }
+}
+//! [6]
+
+//! [7]
+int VibrationSurface::getIntensity(int x, int y)
+{
+ int level;
+ int coord;
+
+ if (height() > width()) {
+ level = height() / NumberOfLevels;
+ coord = y;
+ } else {
+ level = width() / NumberOfLevels;
+ coord = x;
+ }
+
+ if (level == 0) {
+ return 0;
+ }
+//! [7]
+//! [8]
+ int intensity = (coord / level + 1) * IntensityFactor;
+
+ if (intensity < 0) {
+ intensity = 0;
+ } else if (intensity > XQVibra::MaxIntensity) {
+ intensity = XQVibra::MaxIntensity;
+ }
+
+ return intensity;
+}
+//! [8]
+
+//! [3]
+void VibrationSurface::applyIntensity(int x, int y)
+{
+ int intensity = getIntensity(x, y);
+
+ if (intensity != lastIntensity) {
+ vibra->setIntensity(intensity);
+ lastIntensity = intensity;
+ }
+}
+//! [3]
+
diff --git a/examples/widgets/symbianvibration/vibrationsurface.h b/examples/widgets/symbianvibration/vibrationsurface.h
new file mode 100644
index 0000000000..2c4f3e56e1
--- /dev/null
+++ b/examples/widgets/symbianvibration/vibrationsurface.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TOUCHAREA_H
+#define TOUCHAREA_H
+
+#include <QWidget>
+
+class XQVibra;
+
+//! [0]
+class VibrationSurface : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit VibrationSurface(XQVibra *vibra, QWidget *parent = 0);
+
+protected:
+ virtual void mousePressEvent(QMouseEvent *);
+ virtual void mouseMoveEvent(QMouseEvent *);
+ virtual void mouseReleaseEvent(QMouseEvent *);
+ virtual void paintEvent(QPaintEvent *);
+
+private:
+
+ int getIntensity(int x, int y);
+ void applyIntensity(int x, int y);
+
+ XQVibra *vibra;
+ int lastIntensity;
+};
+//! [0]
+
+#endif // TOUCHAREA_H
diff --git a/examples/widgets/symbianvibration/xqvibra.cpp b/examples/widgets/symbianvibration/xqvibra.cpp
new file mode 100644
index 0000000000..4a50a38501
--- /dev/null
+++ b/examples/widgets/symbianvibration/xqvibra.cpp
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "xqvibra.h"
+#include "xqvibra_p.h"
+
+/*!
+ \class XQVibra
+
+ \brief The XQVibra class is used to control the device's vibra. The XQVibra
+ class provides also information of vibration setting in the user profile.
+
+ Example:
+ \code
+ XQVibra *vibra = new XQVibra(this);
+ QPushButton *startButton = new QPushButton(this);
+ QPushButton *stopButton = new QPushButton(this);
+ connect(startButton, SIGNAL(clicked()), vibra, SLOT(start()));
+ connect(stopButton, SIGNAL(clicked()), vibra, SLOT(stop()));
+ \endcode
+*/
+
+/*! \var XQVibra::InfiniteDuration
+ With this constant vibration can be set to work indefinitely (Note! Depends on the HW)
+*/
+/*! \var XQVibra::MaxIntensity
+ Maximum intensity as percentages
+*/
+/*! \var XQVibra::MinIntensity
+ Minimum intensity as percentages
+*/
+
+/*!
+ Constructs a XQVibra object with the given parent.
+ Call error() to get a value of XQVibra::Error that indicates which error occurred during initialisation if any.
+ \sa start(), setIntensity(), error()
+*/
+XQVibra::XQVibra(QObject *parent)
+ : QObject(parent), d(new XQVibraPrivate(this))
+{
+}
+
+/*!
+ Destroys the XQVibra object.
+*/
+XQVibra::~XQVibra()
+{
+ delete d;
+}
+
+/*!
+ \enum XQVibra::Error
+
+ This enum defines the possible errors for a XQVibra object.
+*/
+/*! \var XQVibra::Error XQVibra::NoError
+ No error occurred.
+*/
+/*! \var XQVibra::Error XQVibra::OutOfMemoryError
+ Not enough memory.
+*/
+/*! \var XQVibra::Error XQVibra::ArgumentError
+ Duration is invalid.
+*/
+/*! \var XQVibra::Error XQVibra::VibraInUseError
+ Vibra is already in used by other client.
+*/
+/*! \var XQVibra::Error XQVibra::HardwareError
+ There is a hardware error.
+*/
+/*! \var XQVibra::Error XQVibra::TimeOutError
+ Timeout occurred in controlling vibra.
+*/
+/*! \var XQVibra::Error XQVibra::VibraLockedError
+ Vibra is locked down because too much continuous use or explicitly blocked by
+ for example some vibration sensitive accessory.
+*/
+/*! \var XQVibra::Error XQVibra::AccessDeniedError
+ Vibration setting in the user profile is not set.
+*/
+/*! \var XQVibra::Error XQVibra::UnknownError
+ Unknown error.
+*/
+
+/*!
+ \enum XQVibra::Status
+
+ This enum defines the possible statuses of the vibration
+*/
+/*! \var XQVibra::Status XQVibra::StatusNotAllowed
+ Vibra is set off in the user profile or status is unknow
+*/
+/*! \var XQVibra::Status XQVibra::StatusOff
+ Vibration is non-active
+*/
+/*! \var XQVibra::Status XQVibra::StatusOn
+ Vibration is active
+*/
+
+/*!
+ Starts vibrating. If duration hasn't been set the vibration continues
+ indefinitely unless stopped with stop() function. Calling the start while vibration
+ is active the active vibration is interrupted and the new vibration starts immediately.
+
+ \param duration Specifies duration how long vibration should last
+ \return If false is returned, an error has occurred. Call error() to get a value of
+ XQVibra::Error that indicates which error occurred
+ \sa stop(), setIntensity(), error()
+*/
+bool XQVibra::start(int duration)
+{
+ return d->start(duration);
+}
+
+/*!
+ Interrupts the device vibration immediately.
+
+ \return If false is returned, an error has occurred. Call error() to get a value of
+ XQVibra::Error that indicates which error occurred
+ \sa start(), setIntensity(), error()
+*/
+bool XQVibra::stop()
+{
+ return d->stop();
+}
+
+/*!
+ Sets the intensity of the vibration. Allowed values for the intensity are
+ between -100 and 100. 0 means no vibrating. NOTE: The device might have
+ hardware-imposed limits on supported vibra intensity values, so actual
+ effect might vary between different hardware.
+
+ \param intensity Intensity of the vibra in decimals
+ \return If false is returned, an error has occurred. Call error() to get a value of
+ XQVibra::Error that indicates which error occurred
+ \sa error()
+*/
+bool XQVibra::setIntensity(int intensity)
+{
+ return d->setIntensity(intensity);
+}
+
+/*!
+ Returns the current status of the vibration. This function can be used to check has vibration
+ allowed in the user profile.
+
+ \return current status
+ \sa statusChanged()
+*/
+XQVibra::Status XQVibra::currentStatus() const
+{
+ return d->currentStatus();
+}
+
+/*!
+ Returns the type of error that occurred if the latest function call failed; otherwise returns NoError
+ \return Error code
+*/
+XQVibra::Error XQVibra::error() const
+{
+ return d->error();
+}
+
+/*!
+ \fn void XQVibra::statusChanged(Status status)
+
+ This signal is emitted when the there is a change of the vibration status.
+
+ \param status a vibration status
+ \sa currentStatus()
+*/
+
+// End of file
diff --git a/examples/widgets/symbianvibration/xqvibra.h b/examples/widgets/symbianvibration/xqvibra.h
new file mode 100644
index 0000000000..7eb8697266
--- /dev/null
+++ b/examples/widgets/symbianvibration/xqvibra.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XQVIBRA_H
+#define XQVIBRA_H
+
+// INCLUDES
+#include <QObject>
+
+// FORWARD DECLARATIONS
+class XQVibraPrivate;
+
+// CLASS DECLARATION
+//! [0]
+class XQVibra : public QObject
+{
+ Q_OBJECT
+
+public:
+ static const int InfiniteDuration = 0;
+ static const int MaxIntensity = 100;
+ static const int MinIntensity = -100;
+
+ enum Error {
+ NoError = 0,
+ OutOfMemoryError,
+ ArgumentError,
+ VibraInUseError,
+ HardwareError,
+ TimeOutError,
+ VibraLockedError,
+ AccessDeniedError,
+ UnknownError = -1
+ };
+
+ enum Status {
+ StatusNotAllowed = 0,
+ StatusOff,
+ StatusOn
+ };
+
+ XQVibra(QObject *parent = 0);
+ ~XQVibra();
+
+ XQVibra::Status currentStatus() const;
+ XQVibra::Error error() const;
+
+Q_SIGNALS:
+ void statusChanged(XQVibra::Status status);
+
+public Q_SLOTS:
+ bool start(int duration = InfiniteDuration);
+ bool stop();
+ bool setIntensity(int intensity);
+
+private:
+ friend class XQVibraPrivate;
+ XQVibraPrivate *d;
+};
+//! [0]
+
+#endif // XQVIBRA_H
+
+// End of file
diff --git a/examples/widgets/symbianvibration/xqvibra_p.cpp b/examples/widgets/symbianvibration/xqvibra_p.cpp
new file mode 100644
index 0000000000..145434c52f
--- /dev/null
+++ b/examples/widgets/symbianvibration/xqvibra_p.cpp
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "xqvibra_p.h"
+
+const int KDefaultIntensity = 0xFF;
+
+XQVibraPrivate::XQVibraPrivate(XQVibra *vibra)
+ : q(vibra), iStatus(XQVibra::StatusOff), iDuration(XQVibra::InfiniteDuration), iIntensity(KDefaultIntensity)
+
+{
+ TRAP(iError, iVibra = CHWRMVibra::NewL();)
+ QObject::connect(&iTimer, SIGNAL(timeout()), q, SLOT(stop()));
+}
+
+XQVibraPrivate::~XQVibraPrivate()
+{
+ delete iVibra;
+}
+
+bool XQVibraPrivate::start(int aDuration)
+{
+ iDuration = aDuration;
+ TRAP(iError,
+ if (iIntensity == KDefaultIntensity) {
+ iVibra->StartVibraL(XQVibra::InfiniteDuration);
+ } else {
+ iVibra->StopVibraL();
+ iVibra->StartVibraL(XQVibra::InfiniteDuration, iIntensity);
+ }
+
+ if (aDuration != XQVibra::InfiniteDuration) {
+ iTimer.start(aDuration);
+ } else {
+ iTimer.stop();
+ }
+
+ if (iStatus != XQVibra::StatusOn) {
+ iStatus = XQVibra::StatusOn;
+ emit q->statusChanged(iStatus);
+ }
+ )
+ return (iError == KErrNone);
+}
+
+bool XQVibraPrivate::stop()
+{
+ TRAP(iError,
+ if (iVibra->VibraStatus() == CHWRMVibra::EVibraStatusOn) {
+ iVibra->StopVibraL();
+ if (iTimer.isActive()) {
+ iTimer.stop();
+ }
+ }
+
+ iStatus = XQVibra::StatusOff;
+ emit q->statusChanged(iStatus);
+ )
+ return (iError == KErrNone);
+}
+
+void XQVibraPrivate::VibraModeChanged(CHWRMVibra::TVibraModeState /*aStatus*/)
+{
+ // Implementation isn't needed here because this information isn't used in the public side of the extension
+}
+
+void XQVibraPrivate::VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus)
+{
+ if (aStatus == CHWRMVibra::EVibraStatusUnknown ||
+ aStatus == CHWRMVibra::EVibraStatusNotAllowed) {
+ iStatus = XQVibra::StatusNotAllowed;
+ emit q->statusChanged(iStatus);
+ }
+
+ if (iDuration == XQVibra::InfiniteDuration) {
+ if (iStatus != XQVibra::StatusOff) {
+ iStatus = XQVibra::StatusOff;
+ emit q->statusChanged(iStatus);
+ }
+ }
+}
+
+bool XQVibraPrivate::setIntensity(int aIntensity)
+{
+ TRAP(iError,
+ if (aIntensity >= KHWRMVibraMinIntensity && aIntensity <= KHWRMVibraMaxIntensity) {
+ iIntensity = aIntensity;
+ if (iIntensity == 0 && iStatus == XQVibra::StatusOn) {
+ iVibra->StopVibraL();
+ } else if (iStatus == XQVibra::StatusOn) {
+ iVibra->StopVibraL();
+ iVibra->StartVibraL(XQVibra::InfiniteDuration, iIntensity);
+ }
+ } else {
+ User::Leave(KErrArgument);
+ }
+ )
+ return (iError == KErrNone);
+}
+
+XQVibra::Status XQVibraPrivate::currentStatus() const
+{
+ if (iVibra->VibraStatus() == CHWRMVibra::EVibraStatusUnknown ||
+ iVibra->VibraStatus() == CHWRMVibra::EVibraStatusNotAllowed) {
+ return XQVibra::StatusNotAllowed;
+ }
+ return iStatus;
+}
+
+XQVibra::Error XQVibraPrivate::error() const
+{
+ switch (iError) {
+ case KErrNone:
+ return XQVibra::NoError;
+ case KErrNoMemory:
+ return XQVibra::OutOfMemoryError;
+ case KErrArgument:
+ return XQVibra::ArgumentError;
+ case KErrInUse:
+ return XQVibra::VibraInUseError;
+ case KErrGeneral:
+ return XQVibra::HardwareError;
+ case KErrTimedOut:
+ return XQVibra::TimeOutError;
+ case KErrLocked:
+ return XQVibra::VibraLockedError;
+ case KErrAccessDenied:
+ return XQVibra::AccessDeniedError;
+ default:
+ return XQVibra::UnknownError;
+ }
+}
+
+// End of file
diff --git a/examples/widgets/symbianvibration/xqvibra_p.h b/examples/widgets/symbianvibration/xqvibra_p.h
new file mode 100644
index 0000000000..a8be0193e2
--- /dev/null
+++ b/examples/widgets/symbianvibration/xqvibra_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef XQVIBRA_P_H
+#define XQVIBRA_P_H
+
+// INCLUDES
+#include "xqvibra.h"
+#include <hwrmvibra.h>
+#include <QTimer>
+
+// CLASS DECLARATION
+class XQVibraPrivate: public CBase, public MHWRMVibraObserver
+{
+
+public:
+ XQVibraPrivate(XQVibra *vibra);
+ ~XQVibraPrivate();
+
+ bool start(int aDuration = XQVibra::InfiniteDuration);
+ bool stop();
+ bool setIntensity(int aIntensity);
+ XQVibra::Status currentStatus() const;
+ XQVibra::Error error() const;
+
+private: // From MHWRMVibraObserver
+ void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus);
+ void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus);
+
+private:
+ XQVibra *q;
+ XQVibra::Status iStatus;
+ CHWRMVibra *iVibra;
+ QTimer iTimer;
+ int iDuration;
+ int iIntensity;
+ int iError;
+};
+
+#endif /*XQVIBRA_P_H*/
+
+// End of file
diff --git a/examples/widgets/tablet/main.cpp b/examples/widgets/tablet/main.cpp
index 27aab50901..1e045c8108 100644
--- a/examples/widgets/tablet/main.cpp
+++ b/examples/widgets/tablet/main.cpp
@@ -52,9 +52,14 @@ int main(int argv, char *args[])
app.setCanvas(canvas);
MainWindow mainWindow(canvas);
+#if defined(Q_OS_SYMBIAN)
+ mainWindow.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ mainWindow.show();
+#else
mainWindow.resize(500, 500);
mainWindow.show();
-
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/widgets/tablet/tablet.desktop b/examples/widgets/tablet/tablet.desktop
new file mode 100644
index 0000000000..9b40dc25d4
--- /dev/null
+++ b/examples/widgets/tablet/tablet.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Tablet
+Exec=/opt/usr/bin/tablet
+Icon=tablet
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/tablet/tablet.pro b/examples/widgets/tablet/tablet.pro
index e135203e64..4a5622de49 100644
--- a/examples/widgets/tablet/tablet.pro
+++ b/examples/widgets/tablet/tablet.pro
@@ -13,3 +13,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/tetrix/main.cpp b/examples/widgets/tetrix/main.cpp
index 9a7dcf35e5..622aee9845 100644
--- a/examples/widgets/tetrix/main.cpp
+++ b/examples/widgets/tetrix/main.cpp
@@ -48,7 +48,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
TetrixWindow window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
return app.exec();
}
diff --git a/examples/widgets/tetrix/tetrix.desktop b/examples/widgets/tetrix/tetrix.desktop
new file mode 100644
index 0000000000..4d7a3de417
--- /dev/null
+++ b/examples/widgets/tetrix/tetrix.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Tetrix
+Exec=/opt/usr/bin/tetrix
+Icon=tetrix
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro
index fbdb366d20..2178ca7678 100644
--- a/examples/widgets/tetrix/tetrix.pro
+++ b/examples/widgets/tetrix/tetrix.pro
@@ -16,3 +16,5 @@ symbian {
TARGET.UID3 = 0xA000C606
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/tooltips/main.cpp b/examples/widgets/tooltips/main.cpp
index c31d90a1cd..2e17f235c6 100644
--- a/examples/widgets/tooltips/main.cpp
+++ b/examples/widgets/tooltips/main.cpp
@@ -49,6 +49,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
SortingBox sortingBox;
+#if defined(Q_OS_SYMBIAN)
+ sortingBox.showMaximized();
+#else
sortingBox.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/tooltips/tooltips.desktop b/examples/widgets/tooltips/tooltips.desktop
new file mode 100644
index 0000000000..7dade26cc3
--- /dev/null
+++ b/examples/widgets/tooltips/tooltips.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Tool Tips
+Exec=/opt/usr/bin/tooltips
+Icon=tooltips
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/tooltips/tooltips.pro b/examples/widgets/tooltips/tooltips.pro
index f91abea67f..aaf9988049 100644
--- a/examples/widgets/tooltips/tooltips.pro
+++ b/examples/widgets/tooltips/tooltips.pro
@@ -12,3 +12,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/validators/main.cpp b/examples/widgets/validators/main.cpp
index 5e5765e957..748a36125d 100644
--- a/examples/widgets/validators/main.cpp
+++ b/examples/widgets/validators/main.cpp
@@ -128,7 +128,11 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
ValidatorWidget w;
+#if defined(Q_OS_SYMBIAN)
+ w.showMaximized();
+#else
w.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/validators/validators.desktop b/examples/widgets/validators/validators.desktop
new file mode 100644
index 0000000000..073131632f
--- /dev/null
+++ b/examples/widgets/validators/validators.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Validators
+Exec=/opt/usr/bin/validators
+Icon=validators
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/validators/validators.pro b/examples/widgets/validators/validators.pro
index c50b63b516..a23a00af98 100644
--- a/examples/widgets/validators/validators.pro
+++ b/examples/widgets/validators/validators.pro
@@ -21,3 +21,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index d838be0ae5..f9573056d8 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -1,15 +1,18 @@
TEMPLATE = subdirs
SUBDIRS = analogclock \
+ applicationicon \
calculator \
calendarwidget \
charactermap \
codeeditor \
digitalclock \
+ elidedlabel \
groupbox \
icons \
imageviewer \
lineedits \
movie \
+ orientation \
scribble \
shapedclock \
sliders \
@@ -20,7 +23,7 @@ SUBDIRS = analogclock \
tooltips \
validators \
wiggly \
- windowflags
+ windowflags \
symbian: SUBDIRS = \
analogclock \
@@ -28,10 +31,13 @@ symbian: SUBDIRS = \
calendarwidget \
lineedits \
shapedclock \
+ symbianvibration \
tetrix \
wiggly \
softkeys
+maemo5: SUBDIRS += maemovibration
+
contains(styles, motif): SUBDIRS += styles
# install
@@ -40,4 +46,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS widgets.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp
index 91cd1b8c4b..31e334687e 100644
--- a/examples/widgets/wiggly/main.cpp
+++ b/examples/widgets/wiggly/main.cpp
@@ -45,7 +45,15 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+#ifdef Q_OS_SYMBIAN
+ bool smallScreen = true;
+#else
bool smallScreen = QApplication::arguments().contains("-small-screen");
+#endif
+
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_HILDON) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ smallScreen = true;
+#endif
Dialog dialog(0, smallScreen);
diff --git a/examples/widgets/wiggly/wiggly.desktop b/examples/widgets/wiggly/wiggly.desktop
new file mode 100644
index 0000000000..b83e1ab3f0
--- /dev/null
+++ b/examples/widgets/wiggly/wiggly.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Wiggly
+Exec=/opt/usr/bin/wiggly
+Icon=wiggly
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro
index f40f86feca..cfca3029b0 100644
--- a/examples/widgets/wiggly/wiggly.pro
+++ b/examples/widgets/wiggly/wiggly.pro
@@ -14,3 +14,5 @@ symbian {
TARGET.UID3 = 0xA000C607
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/widgets/windowflags/main.cpp b/examples/widgets/windowflags/main.cpp
index 8dd71ed0a5..941a3fadf7 100644
--- a/examples/widgets/windowflags/main.cpp
+++ b/examples/widgets/windowflags/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
ControllerWindow controller;
+#if defined(Q_OS_SYMBIAN)
+ controller.showMaximized();
+#else
controller.show();
+#endif
return app.exec();
}
diff --git a/examples/widgets/windowflags/windowflags.desktop b/examples/widgets/windowflags/windowflags.desktop
new file mode 100644
index 0000000000..27fd7bd364
--- /dev/null
+++ b/examples/widgets/windowflags/windowflags.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Window Flags
+Exec=/opt/usr/bin/windowflags
+Icon=windowflags
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/widgets/windowflags/windowflags.pro b/examples/widgets/windowflags/windowflags.pro
index 27ce0255cf..b203dd22e5 100644
--- a/examples/widgets/windowflags/windowflags.pro
+++ b/examples/widgets/windowflags/windowflags.pro
@@ -11,3 +11,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/xml/dombookmarks/dombookmarks.desktop b/examples/xml/dombookmarks/dombookmarks.desktop
new file mode 100644
index 0000000000..dfaa8a6b2d
--- /dev/null
+++ b/examples/xml/dombookmarks/dombookmarks.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=DOM Bookmarks
+Exec=/opt/usr/bin/dombookmarks
+Icon=dombookmarks
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index 80bbec45a3..374d9e32c3 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -13,8 +13,17 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.path = files
+ DEPLOYMENT += addFiles
+}
+
wince*: {
- addFiles.files = frank.xbel jennifer.xbel
- addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ addFiles.files = frank.xbel jennifer.xbel
+ addFiles.path = "\\My Documents"
+ DEPLOYMENT += addFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/xml/dombookmarks/main.cpp b/examples/xml/dombookmarks/main.cpp
index 71ce6aec0b..6a3bb8c1a9 100644
--- a/examples/xml/dombookmarks/main.cpp
+++ b/examples/xml/dombookmarks/main.cpp
@@ -46,7 +46,12 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showMaximized();
+#else
mainWin.show();
+#endif
+
mainWin.open();
return app.exec();
}
diff --git a/examples/xml/dombookmarks/mainwindow.cpp b/examples/xml/dombookmarks/mainwindow.cpp
index b3bfe64e17..0a3a3f9c3b 100644
--- a/examples/xml/dombookmarks/mainwindow.cpp
+++ b/examples/xml/dombookmarks/mainwindow.cpp
@@ -59,6 +59,15 @@ MainWindow::MainWindow()
void MainWindow::open()
{
+#if defined(Q_OS_SYMBIAN)
+ // Look for bookmarks on the same drive where the application is installed to,
+ // if drive is not read only. QDesktopServices::DataLocation does this check,
+ // and returns writable drive.
+ QString bookmarksFolder =
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1);
+ bookmarksFolder.append(":/Data/qt/saxbookmarks");
+ QDir::setCurrent(bookmarksFolder);
+#endif
QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
QDir::currentPath(),
@@ -81,6 +90,15 @@ void MainWindow::open()
void MainWindow::saveAs()
{
+#if defined(Q_OS_SYMBIAN)
+ // Look for bookmarks on the same drive where the application is installed to,
+ // if drive is not read only. QDesktopServices::DataLocation does this check,
+ // and returns writable drive.
+ QString bookmarksFolder =
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1);
+ bookmarksFolder.append(":/Data/qt/saxbookmarks");
+ QDir::setCurrent(bookmarksFolder);
+#endif
QString fileName =
QFileDialog::getSaveFileName(this, tr("Save Bookmark File"),
QDir::currentPath(),
diff --git a/examples/xml/htmlinfo/htmlinfo.desktop b/examples/xml/htmlinfo/htmlinfo.desktop
new file mode 100644
index 0000000000..901a285b47
--- /dev/null
+++ b/examples/xml/htmlinfo/htmlinfo.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=XML HTML Info
+Exec=/opt/usr/bin/htmlinfo
+Icon=htmlinfo
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
index 94b3a07e69..9b84cfd511 100644
--- a/examples/xml/htmlinfo/htmlinfo.pro
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -1,6 +1,10 @@
SOURCES += main.cpp
QT -= gui
+RESOURCES = resources.qrc
+
+win32: CONFIG += console
+
wince*|symbian:{
htmlfiles.files = *.html
htmlfiles.path = .
@@ -9,11 +13,12 @@ wince*|symbian:{
# install
target.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.html htmlinfo.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo
-INSTALLS += target sources
+INSTALLS += target
symbian {
TARGET.UID3 = 0xA000C609
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
index cb7ac528f0..4e36b1c2cd 100644
--- a/examples/xml/htmlinfo/main.cpp
+++ b/examples/xml/htmlinfo/main.cpp
@@ -101,7 +101,8 @@ int main(int argc, char **argv)
QStringList filter;
filter << "*.htm";
filter << "*.html";
- QStringList htmlFiles = QDir::current().entryList(filter, QDir::Files);
+
+ QStringList htmlFiles = QDir(":/").entryList(filter, QDir::Files);
QTextStream out(stdout);
@@ -112,7 +113,7 @@ int main(int argc, char **argv)
// parse each html file and write the result to file/stream
foreach(QString file, htmlFiles)
- parseHtmlFile(out, file);
+ parseHtmlFile(out, ":/" + file);
return 0;
}
diff --git a/examples/xml/htmlinfo/resources.qrc b/examples/xml/htmlinfo/resources.qrc
new file mode 100644
index 0000000000..a8cf88d57b
--- /dev/null
+++ b/examples/xml/htmlinfo/resources.qrc
@@ -0,0 +1,11 @@
+<RCC>
+ <qresource prefix="/">
+ <file>apache_org.html</file>
+ <file>nokia_com.html</file>
+ <file>simpleexample.html</file>
+ <file>trolltech_com.html</file>
+ <file>w3c_org.html</file>
+ <file>youtube_com.html</file>
+ </qresource>
+</RCC>
+
diff --git a/examples/xml/rsslisting/main.cpp b/examples/xml/rsslisting/main.cpp
index 011569f2b6..78abb92e8d 100644
--- a/examples/xml/rsslisting/main.cpp
+++ b/examples/xml/rsslisting/main.cpp
@@ -58,6 +58,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
RSSListing *rsslisting = new RSSListing;
+#if defined(Q_OS_SYMBIAN)
+ rsslisting->showMaximized();
+#else
rsslisting->show();
+#endif
return app.exec();
}
diff --git a/examples/xml/rsslisting/rsslisting.cpp b/examples/xml/rsslisting/rsslisting.cpp
index 5840f08d09..ffc6d1a6c7 100644
--- a/examples/xml/rsslisting/rsslisting.cpp
+++ b/examples/xml/rsslisting/rsslisting.cpp
@@ -74,6 +74,24 @@ its operation, and also allows very large data sources to be read.
RSSListing::RSSListing(QWidget *parent)
: QWidget(parent), currentReply(0)
{
+#ifdef Q_OS_SYMBIAN
+ // Set Internet Access Point
+ QNetworkConfigurationManager manager;
+ const bool canStartIAP = manager.capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces;
+
+ // Is there default access point, use it
+ QNetworkConfiguration cfg = manager.defaultConfiguration();
+ if (!cfg.isValid() || !canStartIAP) {
+ // Available Access Points not found
+ QMessageBox::warning(this, "Error", "No access point");
+ return;
+ }
+
+ m_session = new QNetworkSession(cfg);
+ m_session->open();
+ m_session->waitForOpened();
+#endif
+
lineEdit = new QLineEdit(this);
lineEdit->setText("http://labs.qt.nokia.com/blogs/feed");
@@ -104,7 +122,9 @@ RSSListing::RSSListing(QWidget *parent)
layout->addWidget(treeWidget);
setWindowTitle(tr("RSS listing example"));
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
resize(640,480);
+#endif
}
/*
diff --git a/examples/xml/rsslisting/rsslisting.desktop b/examples/xml/rsslisting/rsslisting.desktop
new file mode 100644
index 0000000000..e45fe4a3e8
--- /dev/null
+++ b/examples/xml/rsslisting/rsslisting.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=RSS-Listing
+Exec=/opt/usr/bin/rsslisting
+Icon=rsslisting
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xml/rsslisting/rsslisting.h b/examples/xml/rsslisting/rsslisting.h
index 98254f839b..49c694092c 100644
--- a/examples/xml/rsslisting/rsslisting.h
+++ b/examples/xml/rsslisting/rsslisting.h
@@ -48,6 +48,16 @@
#include <QXmlStreamReader>
#include <QUrl>
+#ifdef Q_OS_SYMBIAN
+// Bearer
+#include <QNetworkConfigurationManager>
+#include <QNetworkSession>
+#include <QPointer>
+
+// QtMobility namespace
+QTM_USE_NAMESPACE
+#endif
+
QT_BEGIN_NAMESPACE
class QLineEdit;
class QTreeWidget;
@@ -84,6 +94,11 @@ private:
QLineEdit *lineEdit;
QTreeWidget *treeWidget;
QPushButton *fetchButton;
+
+#ifdef Q_OS_SYMBIAN
+ // for bearer management
+ QPointer<QNetworkSession> m_session;
+#endif
};
#endif
diff --git a/examples/xml/rsslisting/rsslisting.pro b/examples/xml/rsslisting/rsslisting.pro
index e93cad0da9..2515de75a9 100644
--- a/examples/xml/rsslisting/rsslisting.pro
+++ b/examples/xml/rsslisting/rsslisting.pro
@@ -8,5 +8,16 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS rsslisting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/rsslisting
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+
+ # For QtMobility
+ CONFIG += mobility
+ MOBILITY = bearer
+
+ # For QtMobility
+ TARGET.CAPABILITY = NetworkServices
+}
+
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/xml/saxbookmarks/saxbookmarks.desktop b/examples/xml/saxbookmarks/saxbookmarks.desktop
new file mode 100644
index 0000000000..5f983d2b82
--- /dev/null
+++ b/examples/xml/saxbookmarks/saxbookmarks.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=SAX Bookmarks
+Exec=/opt/usr/bin/saxbookmarks
+Icon=saxbookmarks
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index d4b09b6828..a55aa6df29 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -26,3 +26,5 @@ symbian: {
addFiles.path = /data/qt/saxbookmarks
DEPLOYMENT += addFiles
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/xml/streambookmarks/main.cpp b/examples/xml/streambookmarks/main.cpp
index c44e921e82..d909c01b51 100644
--- a/examples/xml/streambookmarks/main.cpp
+++ b/examples/xml/streambookmarks/main.cpp
@@ -47,6 +47,9 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWin;
+#ifdef Q_OS_SYMBIAN
+ mainWin.showFullScreen();
+#endif
mainWin.show();
mainWin.open();
return app.exec();
diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp
index e9236e93e6..ac839fe9a0 100644
--- a/examples/xml/streambookmarks/mainwindow.cpp
+++ b/examples/xml/streambookmarks/mainwindow.cpp
@@ -68,6 +68,15 @@ MainWindow::MainWindow()
//! [1]
void MainWindow::open()
{
+#if defined(Q_OS_SYMBIAN)
+ // Look for bookmarks on the same drive where the application is installed to,
+ // if drive is not read only. QDesktopServices::DataLocation does this check,
+ // and returns writable drive.
+ QString bookmarksFolder =
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1);
+ bookmarksFolder.append(":/Data/qt/saxbookmarks");
+ QDir::setCurrent(bookmarksFolder);
+#endif
QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
QDir::currentPath(),
@@ -103,6 +112,15 @@ void MainWindow::open()
//! [2]
void MainWindow::saveAs()
{
+#if defined(Q_OS_SYMBIAN)
+ // Look for bookmarks on the same drive where the application is installed to,
+ // if drive is not read only. QDesktopServices::DataLocation does this check,
+ // and returns writable drive.
+ QString bookmarksFolder =
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation).left(1);
+ bookmarksFolder.append(":/Data/qt/saxbookmarks");
+ QDir::setCurrent(bookmarksFolder);
+#endif
QString fileName =
QFileDialog::getSaveFileName(this, tr("Save Bookmark File"),
QDir::currentPath(),
diff --git a/examples/xml/streambookmarks/streambookmarks.desktop b/examples/xml/streambookmarks/streambookmarks.desktop
new file mode 100644
index 0000000000..29961a90eb
--- /dev/null
+++ b/examples/xml/streambookmarks/streambookmarks.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QXmlStream Bookmarks
+Exec=/opt/usr/bin/streambookmarks
+Icon=streambookmarks
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xml/streambookmarks/streambookmarks.pro b/examples/xml/streambookmarks/streambookmarks.pro
index 2b1841f70e..0f2d55d9aa 100644
--- a/examples/xml/streambookmarks/streambookmarks.pro
+++ b/examples/xml/streambookmarks/streambookmarks.pro
@@ -13,4 +13,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS streambookmarks.pro *.xb
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/streambookmarks
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian: {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.path = /data/qt/streambookmarks
+ DEPLOYMENT += addFiles
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro
index 6d232e5f6f..4043e01713 100644
--- a/examples/xml/xml.pro
+++ b/examples/xml/xml.pro
@@ -17,4 +17,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xml.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/xml
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.desktop b/examples/xml/xmlstreamlint/xmlstreamlint.desktop
new file mode 100644
index 0000000000..6f85e361b1
--- /dev/null
+++ b/examples/xml/xmlstreamlint/xmlstreamlint.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=XML Stream Lint
+Exec=/opt/usr/bin/xmlstreamlint
+Icon=xmlstreamlint
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.pro b/examples/xml/xmlstreamlint/xmlstreamlint.pro
index 6a09f1ad5c..1274d13722 100644
--- a/examples/xml/xmlstreamlint/xmlstreamlint.pro
+++ b/examples/xml/xmlstreamlint/xmlstreamlint.pro
@@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/xml/xmlstreamlint
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
+simulator: warning(This example does not work on Simulator platform)
diff --git a/examples/xmlpatterns/filetree/filetree.desktop b/examples/xmlpatterns/filetree/filetree.desktop
new file mode 100644
index 0000000000..b11e0de84c
--- /dev/null
+++ b/examples/xmlpatterns/filetree/filetree.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=File System
+Exec=/opt/usr/bin/filetree
+Icon=filetree
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xmlpatterns/filetree/filetree.pro b/examples/xmlpatterns/filetree/filetree.pro
index 4fcf7cb16c..e99c097cc4 100644
--- a/examples/xmlpatterns/filetree/filetree.pro
+++ b/examples/xmlpatterns/filetree/filetree.pro
@@ -15,3 +15,8 @@ symbian {
TARGET.UID3 = 0xA000D7C4
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.desktop b/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.desktop
new file mode 100644
index 0000000000..94e617ff66
--- /dev/null
+++ b/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QObject XML Model
+Exec=/opt/usr/bin/qobjectxmlmodel
+Icon=qobjectxmlmodel
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.pro b/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.pro
index 5a63b2bbb5..7581690758 100644
--- a/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.pro
+++ b/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.pro
@@ -16,3 +16,8 @@ symbian {
TARGET.UID3 = 0xA000D7C8
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/xmlpatterns/recipes/forms/querywidget_mobiles.ui b/examples/xmlpatterns/recipes/forms/querywidget_mobiles.ui
new file mode 100644
index 0000000000..bdb0817edd
--- /dev/null
+++ b/examples/xmlpatterns/recipes/forms/querywidget_mobiles.ui
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QueryWidget</class>
+ <widget class="QMainWindow" name="QueryWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>453</width>
+ <height>583</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Recipes XQuery Example</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <property name="tabsClosable">
+ <bool>false</bool>
+ </property>
+ <widget class="QWidget" name="tab_1">
+ <attribute name="title">
+ <string>Input Document</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTextBrowser" name="inputTextEdit">
+ <property name="textInteractionFlags">
+ <set>Qt::NoTextInteraction</set>
+ </property>
+ <property name="openLinks">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Query selection</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QComboBox" name="defaultQueries"/>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="queryTextEdit">
+ <property name="textInteractionFlags">
+ <set>Qt::NoTextInteraction</set>
+ </property>
+ <property name="openLinks">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_3">
+ <attribute name="title">
+ <string>Ouput Document</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QTextBrowser" name="outputTextEdit">
+ <property name="textInteractionFlags">
+ <set>Qt::NoTextInteraction</set>
+ </property>
+ <property name="openLinks">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/xmlpatterns/recipes/main.cpp b/examples/xmlpatterns/recipes/main.cpp
index cf679f5af8..2ff24608f4 100644
--- a/examples/xmlpatterns/recipes/main.cpp
+++ b/examples/xmlpatterns/recipes/main.cpp
@@ -47,7 +47,11 @@ int main(int argc, char* argv[])
Q_INIT_RESOURCE(recipes);
QApplication app(argc, argv);
QueryMainWindow* const queryWindow = new QueryMainWindow;
+#ifdef Q_OS_SYMBIAN
+ queryWindow->showMaximized();
+#else
queryWindow->show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/xmlpatterns/recipes/querymainwindow.h b/examples/xmlpatterns/recipes/querymainwindow.h
index 675b047629..57666b6504 100644
--- a/examples/xmlpatterns/recipes/querymainwindow.h
+++ b/examples/xmlpatterns/recipes/querymainwindow.h
@@ -43,7 +43,11 @@
#include <QMainWindow>
-#include "ui_querywidget.h"
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ #include "ui_querywidget_mobiles.h"
+#else
+ #include "ui_querywidget.h"
+#endif
QT_BEGIN_NAMESPACE
class QComboBox;
diff --git a/examples/xmlpatterns/recipes/recipes.desktop b/examples/xmlpatterns/recipes/recipes.desktop
new file mode 100644
index 0000000000..db909724c4
--- /dev/null
+++ b/examples/xmlpatterns/recipes/recipes.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Recipes
+Exec=/opt/usr/bin/recipes
+Icon=recipes
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xmlpatterns/recipes/recipes.pro b/examples/xmlpatterns/recipes/recipes.pro
index 67d6d73401..93203ae556 100644
--- a/examples/xmlpatterns/recipes/recipes.pro
+++ b/examples/xmlpatterns/recipes/recipes.pro
@@ -1,5 +1,6 @@
QT += xmlpatterns
-FORMS += forms/querywidget.ui
+FORMS += forms/querywidget.ui \
+ forms/querywidget_mobiles.ui
HEADERS = querymainwindow.h ../shared/xmlsyntaxhighlighter.h
RESOURCES = recipes.qrc
SOURCES = main.cpp querymainwindow.cpp ../shared/xmlsyntaxhighlighter.cpp
@@ -14,3 +15,5 @@ symbian {
TARGET.UID3 = 0xA000D7C5
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/xmlpatterns/schema/main.cpp b/examples/xmlpatterns/schema/main.cpp
index d501b5f6fe..fc5f40dfb3 100644
--- a/examples/xmlpatterns/schema/main.cpp
+++ b/examples/xmlpatterns/schema/main.cpp
@@ -47,7 +47,11 @@ int main(int argc, char* argv[])
Q_INIT_RESOURCE(schema);
QApplication app(argc, argv);
MainWindow* const window = new MainWindow;
+#ifdef Q_OS_SYMBIAN
+ window->showMaximized();
+#else
window->show();
+#endif
return app.exec();
}
//! [0]
diff --git a/examples/xmlpatterns/schema/mainwindow.h b/examples/xmlpatterns/schema/mainwindow.h
index 2bec81dd0f..a5948b52f7 100644
--- a/examples/xmlpatterns/schema/mainwindow.h
+++ b/examples/xmlpatterns/schema/mainwindow.h
@@ -43,7 +43,11 @@
#include <QMainWindow>
-#include "ui_schema.h"
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ #include "ui_schema_mobiles.h"
+#else
+ #include "ui_schema.h"
+#endif
//! [0]
class MainWindow : public QMainWindow,
diff --git a/examples/xmlpatterns/schema/schema.desktop b/examples/xmlpatterns/schema/schema.desktop
new file mode 100644
index 0000000000..06d98e0294
--- /dev/null
+++ b/examples/xmlpatterns/schema/schema.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=XML Schema Validation
+Exec=/opt/usr/bin/schema
+Icon=schema
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xmlpatterns/schema/schema.pro b/examples/xmlpatterns/schema/schema.pro
index 4d3520c1a9..316359cccb 100644
--- a/examples/xmlpatterns/schema/schema.pro
+++ b/examples/xmlpatterns/schema/schema.pro
@@ -1,5 +1,5 @@
QT += xmlpatterns
-FORMS += schema.ui
+FORMS += schema.ui schema_mobiles.ui
HEADERS = mainwindow.h ../shared/xmlsyntaxhighlighter.h
RESOURCES = schema.qrc
SOURCES = main.cpp mainwindow.cpp ../shared/xmlsyntaxhighlighter.cpp
@@ -14,3 +14,5 @@ symbian {
TARGET.UID3 = 0xA000D7C6
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/xmlpatterns/schema/schema_mobiles.ui b/examples/xmlpatterns/schema/schema_mobiles.ui
new file mode 100644
index 0000000000..009d0aaed8
--- /dev/null
+++ b/examples/xmlpatterns/schema/schema_mobiles.ui
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SchemaMainWindow</class>
+ <widget class="QMainWindow" name="SchemaMainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>179</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>XML Schema Validation</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetNoConstraint</enum>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>1</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>XML Schema</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QComboBox" name="schemaSelection">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxVisibleItems">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="schemaView"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>XML Instance</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetNoConstraint</enum>
+ </property>
+ <item>
+ <widget class="QComboBox" name="instanceSelection">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxVisibleItems">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="instanceEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>8</pointsize>
+ </font>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="validationStatus">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Not validated</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="validateButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Validate</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/xmlpatterns/trafficinfo/trafficinfo.desktop b/examples/xmlpatterns/trafficinfo/trafficinfo.desktop
new file mode 100644
index 0000000000..246d34be4f
--- /dev/null
+++ b/examples/xmlpatterns/trafficinfo/trafficinfo.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=TrafficInfo
+Exec=/opt/usr/bin/trafficinfo
+Icon=trafficinfo
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xmlpatterns/trafficinfo/trafficinfo.pro b/examples/xmlpatterns/trafficinfo/trafficinfo.pro
index 99825d0db9..db6b37ab71 100644
--- a/examples/xmlpatterns/trafficinfo/trafficinfo.pro
+++ b/examples/xmlpatterns/trafficinfo/trafficinfo.pro
@@ -12,3 +12,8 @@ symbian {
TARGET.UID3 = 0xA000D7C7
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example might not fully work on Symbian platform)
+maemo5: warning(This example might not fully work on Maemo platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/xmlpatterns/xmlpatterns.pro b/examples/xmlpatterns/xmlpatterns.pro
index 2ad4798ff9..35ca4d56da 100644
--- a/examples/xmlpatterns/xmlpatterns.pro
+++ b/examples/xmlpatterns/xmlpatterns.pro
@@ -14,4 +14,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xmlpatterns.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/xmlpatterns/xquery/globalVariables/globalVariables.desktop b/examples/xmlpatterns/xquery/globalVariables/globalVariables.desktop
new file mode 100644
index 0000000000..d2f505564f
--- /dev/null
+++ b/examples/xmlpatterns/xquery/globalVariables/globalVariables.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=C++ Source Code Analyzer
+Exec=/opt/usr/bin/globalVariables
+Icon=globalVariables
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
index 8520606bbe..b32613bae9 100644
--- a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
+++ b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
@@ -8,4 +8,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.cpp *.pro *.xq *.html
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery/globalVariables
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/xmlpatterns/xquery/xquery.pro b/examples/xmlpatterns/xquery/xquery.pro
index 70b215c8b0..67818740a8 100644
--- a/examples/xmlpatterns/xquery/xquery.pro
+++ b/examples/xmlpatterns/xquery/xquery.pro
@@ -8,3 +8,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery
INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
index d9918bfd5f..f058399486 100644
--- a/mkspecs/features/symbian/application_icon.prf
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -66,8 +66,8 @@ contains(CONFIG, no_icon) {
mifconv.target = $$replace(mifconv.target, /, \\)
}
# Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library
- # svg-t icons should always use /c32 depth
- mifconv.commands = mifconv $$mifconv.target /c32 $$ICON_backslashed
+ # svg-t icons should always use -c32 depth
+ mifconv.commands = mifconv $$mifconv.target -c32 $$ICON_backslashed
mifconv.depends = $$ICON
PRE_TARGETDEPS += $$mifconv.target
diff --git a/mkspecs/features/symbian/qt_config.prf b/mkspecs/features/symbian/qt_config.prf
index 82c18621b7..1afd22c187 100644
--- a/mkspecs/features/symbian/qt_config.prf
+++ b/mkspecs/features/symbian/qt_config.prf
@@ -3,7 +3,7 @@ load(qt_config)
!contains(QMAKE_HOST.os, "Windows") {
# Test for the existence of lower cased headers, a sign of using Gnupoc.
# Note that the qmake "exists" test won't do because it is case insensitive.
- system("test -f $${EPOCROOT}epoc32/include/akndoc.h") {
+ system("test -f $${EPOCROOT}epoc32/include/akndoc.h") | system("test -f $${EPOCROOT}epoc32/include/mw/akndoc.h") {
CONFIG += is_using_gnupoc
}
}
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index b7aec00c30..9a87eb6c1d 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1324,6 +1324,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("DYLIB_COMPATIBILITY_VERSION", project->first("COMPAT_VERSION")) << ";" << "\n";
if(!project->isEmpty("QMAKE_MACOSX_DEPLOYMENT_TARGET"))
t << "\t\t\t\t" << writeSettings("MACOSX_DEPLOYMENT_TARGET", project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET")) << ";" << "\n";
+ if(!project->isEmpty("QMAKE_IPHONEOS_DEPLOYMENT_TARGET"))
+ t << "\t\t\t\t" << writeSettings("IPHONEOS_DEPLOYMENT_TARGET", project->first("QMAKE_IPHONEOS_DEPLOYMENT_TARGET")) << ";" << "\n";
if(pbVersion >= 38) {
if(!project->isEmpty("OBJECTS_DIR"))
t << "\t\t\t\t" << writeSettings("OBJROOT", fixForOutput(project->first("OBJECTS_DIR"))) << ";" << "\n";
diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h
index 69d2a218c0..8402e13647 100644
--- a/qmake/generators/symbian/symbiancommon.h
+++ b/qmake/generators/symbian/symbiancommon.h
@@ -119,6 +119,7 @@ protected:
const SymbianLocalizationList &symbianLocalizationList);
QString generateLocFileName();
+
protected:
MakefileGenerator *generator;
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 30d782256c..fc951b1323 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -179,6 +179,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "export MACOSX_DEPLOYMENT_TARGET = " //exported to children processes
<< project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET") << endl;
+ if(!project->isEmpty("QMAKE_IPHONEOS_DEPLOYMENT_TARGET"))
+ t << "export IPHONEOS_DEPLOYMENT_TARGET = " //exported to children processes
+ << project->first("QMAKE_IPHONEOS_DEPLOYMENT_TARGET") << endl;
+
if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
t << "vpath %.dso " << project->values("QMAKE_LIBDIR").join(":") << endl;
t << "vpath %.lib " << project->values("QMAKE_LIBDIR").join(":") << endl;
diff --git a/src/3rdparty/phonon/ds9/mediagraph.cpp b/src/3rdparty/phonon/ds9/mediagraph.cpp
index 3e7a68bac8..153cd7e969 100644
--- a/src/3rdparty/phonon/ds9/mediagraph.cpp
+++ b/src/3rdparty/phonon/ds9/mediagraph.cpp
@@ -781,6 +781,23 @@ namespace Phonon
}
}
+ const QList<OutputPin> demuxOutputs = BackendNode::pins(m_demux, PINDIR_OUTPUT);
+ for (int i = 0; i < demuxOutputs.count(); ++i) {
+ //...and the output must be decoded
+ QAMMediaType type;
+ hr = demuxOutputs.at(i)->ConnectionMediaType(&type);
+ if (FAILED(hr)) {
+ continue;
+ }
+
+ if (type.majortype == MEDIATYPE_Video) {
+ m_hasVideo = true;
+ } else if (type.majortype == MEDIATYPE_Audio) {
+ m_hasAudio = true;
+ }
+ }
+
+
for (int i = 0; i < m_decoders.count(); ++i) {
QList<Filter> chain = getFilterChain(m_demux, m_decoders.at(i));
for (int i = 0; i < chain.count(); ++i) {
@@ -806,14 +823,11 @@ namespace Phonon
}
//we need to do something smart to detect if the streams are unencoded
- if (m_demux) {
- const QList<OutputPin> outputs = BackendNode::pins(m_demux, PINDIR_OUTPUT);
- for (int i = 0; i < outputs.count(); ++i) {
- const OutputPin &out = outputs.at(i);
- InputPin pin;
- if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) {
- m_decoderPins += out; //unconnected outputs can be decoded outputs
- }
+ for (int i = 0; i < demuxOutputs.count(); ++i) {
+ const OutputPin &out = demuxOutputs.at(i);
+ InputPin pin;
+ if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) {
+ m_decoderPins += out; //unconnected outputs can be decoded outputs
}
}
diff --git a/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h b/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h
new file mode 100644
index 0000000000..73673aef6f
--- /dev/null
+++ b/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright © 2010 Kristian Høgsberg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#ifndef WAYLAND_WINDOWMANAGER_CLIENT_PROTOCOL_H
+#define WAYLAND_WINDOWMANAGER_CLIENT_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-util.h"
+
+struct wl_client;
+
+struct wl_windowmanager;
+
+struct wl_proxy;
+
+extern void
+wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...);
+extern struct wl_proxy *
+wl_proxy_create(struct wl_proxy *factory,
+ const struct wl_interface *interface);
+extern struct wl_proxy *
+wl_proxy_create_for_id(struct wl_display *display,
+ const struct wl_interface *interface, uint32_t id);
+extern void
+wl_proxy_destroy(struct wl_proxy *proxy);
+
+extern int
+wl_proxy_add_listener(struct wl_proxy *proxy,
+ void (**implementation)(void), void *data);
+
+extern void
+wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
+
+extern void *
+wl_proxy_get_user_data(struct wl_proxy *proxy);
+
+extern const struct wl_interface wl_windowmanager_interface;
+
+#define wl_WINDOWMANAGER_MAP_CLIENT_TO_PROCESS 0
+#define wl_WINDOWMANAGER_AUTHENTICATE_WITH_TOKEN 1
+
+static inline struct wl_windowmanager *
+wl_windowmanager_create(struct wl_display *display, uint32_t id)
+{
+ return (struct wl_windowmanager *)
+ wl_proxy_create_for_id(display, &wl_windowmanager_interface, id);
+}
+
+static inline void
+wl_windowmanager_set_user_data(struct wl_windowmanager *wl_windowmanager, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_windowmanager, user_data);
+}
+
+static inline void *
+wl_windowmanager_get_user_data(struct wl_windowmanager *wl_windowmanager)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_windowmanager);
+}
+
+static inline void
+wl_windowmanager_destroy(struct wl_windowmanager *wl_windowmanager)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_windowmanager);
+}
+
+static inline void
+wl_windowmanager_map_client_to_process(struct wl_windowmanager *wl_windowmanager, uint32_t processid)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_windowmanager,
+ wl_WINDOWMANAGER_MAP_CLIENT_TO_PROCESS, processid);
+}
+
+static inline void
+wl_windowmanager_authenticate_with_token(struct wl_windowmanager *wl_windowmanager, const char *wl_authentication_token)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_windowmanager,
+ wl_WINDOWMANAGER_AUTHENTICATE_WITH_TOKEN, wl_authentication_token);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/3rdparty/wayland/wayland-windowmanager-protocol.c b/src/3rdparty/wayland/wayland-windowmanager-protocol.c
new file mode 100644
index 0000000000..0250801b1f
--- /dev/null
+++ b/src/3rdparty/wayland/wayland-windowmanager-protocol.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2010 Kristian Høgsberg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+static const struct wl_message wl_windowmanager_requests[] = {
+ { "map_client_to_process", "u" },
+ { "authenticate_with_token", "s" },
+};
+
+WL_EXPORT const struct wl_interface wl_windowmanager_interface = {
+ "wl_windowmanager", 1,
+ ARRAY_LENGTH(wl_windowmanager_requests), wl_windowmanager_requests,
+ 0, NULL,
+};
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 58d2c7b2c6..96738611db 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -45,4 +45,5 @@ symbian: {
"UNPAGED" \
"$${LITERAL_HASH}endif"
MMP_RULES += pagingBlock
+ LIBS += -ltzclient
}
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c144871594..e5626b4632 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2883,8 +2883,8 @@ int qrand()
\relates <QtGlobal>
\since 4.8
- \brief Hints the compiler that the enclosed condition is likely to evaluate
- to \c true.
+ \brief Hints to the compiler that the enclosed condition, \a expr, is
+ likely to evaluate to \c true.
Use of this macro can help the compiler to optimize the code.
@@ -2900,8 +2900,8 @@ int qrand()
\relates <QtGlobal>
\since 4.8
- \brief Hints the compiler that the enclosed condition is likely to evaluate
- to \c false.
+ \brief Hints to the compiler that the enclosed condition, \a expr, is
+ likely to evaluate to \c false.
Use of this macro can help the compiler to optimize the code.
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1454cb3f9a..32b3e6bb3d 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1423,6 +1423,7 @@ class QDataStream;
# define Q_DECLARATIVE_EXPORT
# define Q_OPENGL_EXPORT
# define Q_MULTIMEDIA_EXPORT
+# define Q_OPENVG_EXPORT
# define Q_XML_EXPORT
# define Q_XMLPATTERNS_EXPORT
# define Q_SCRIPT_EXPORT
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 8c27430209..b397c1a29c 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -584,8 +584,9 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_4_3 Version 9 (Qt 4.3)
\value Qt_4_4 Version 10 (Qt 4.4)
\value Qt_4_5 Version 11 (Qt 4.5)
- \value Qt_4_6 Version 12 (Qt 4.6)
+ \value Qt_4_6 Version 12 (Qt 4.6, Qt 4.7, Qt 4.8)
\value Qt_4_7 Same as Qt_4_6.
+ \value Qt_4_8 Same as Qt_4_6.
\sa setVersion(), version()
*/
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 9d6641c153..66edf58214 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1656,6 +1656,8 @@ bool QFile::atEnd() const
}
/*!
+ \fn bool QFile::seek(qint64 pos)
+
For random-access devices, this function sets the current position
to \a pos, returning true on success, or false if an error occurred.
For sequential devices, the default behavior is to do nothing and
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index 9590e3946f..97669acd8c 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -196,7 +196,7 @@ static bool _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry &ent
Resolves the \a entry (see QDir::searchPaths) and returns an engine for
it, but never a QFSFileEngine.
- \returns a file engine that can be used to access the entry. Returns 0 if
+ Returns a file engine that can be used to access the entry. Returns 0 if
QFileSystemEngine API should be used to query and interact with the file
system object.
*/
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index f1e0758bbe..b0ebfbd45d 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -180,7 +180,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));
#else
char *ret = 0;
-# if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
+# if defined(Q_OS_MAC)
+# if !defined(QT_NO_CORESERVICES)
// Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here.
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) {
ret = realpath(entry.nativeFilePath().constData(), (char*)0);
@@ -197,9 +198,13 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
return QFileSystemEntry(ret);
}
}
-# else
+# else
+ ret = (char*)malloc(PATH_MAX);
+ realpath(entry.nativeFilePath().constData(), (char*)ret);
+# endif //!defined(QT_NO_CORESERVICES)
+# else
ret = realpath(entry.nativeFilePath().constData(), (char*)0);
-# endif
+# endif //defined(Q_OS_MAC)
if (ret) {
data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
data.entryFlags |= QFileSystemMetaData::ExistsAttribute;
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index 6ae6e388e1..4ae7cf853a 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -57,13 +57,15 @@
#include <sys/types.h>
#include <CoreFoundation/CFRunLoop.h>
#include <CoreFoundation/CFUUID.h>
+#if !defined( QT_NO_CORESERVICES )
#include <CoreServices/CoreServices.h>
+#endif
#include <AvailabilityMacros.h>
#include <private/qcore_mac_p.h>
QT_BEGIN_NAMESPACE
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
// Static operator overloading so for the sake of some convieniece.
// They only live in this compilation unit to avoid polluting Qt in general.
static bool operator==(const struct ::timespec &left, const struct ::timespec &right)
@@ -152,7 +154,7 @@ QFSEventsFileSystemWatcherEngine::QFSEventsFileSystemWatcherEngine()
QFSEventsFileSystemWatcherEngine::~QFSEventsFileSystemWatcherEngine()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
// I assume that at this point, QFileSystemWatcher has already called stop
// on me, so I don't need to invalidate or stop my stream, simply
// release it.
@@ -171,7 +173,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
stop();
wait();
QMutexLocker locker(&mutex);
@@ -257,7 +259,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
void QFSEventsFileSystemWatcherEngine::warmUpFSEvents()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
// This function assumes that the mutex has already been grabbed before calling it.
// It exits with the mutex still locked (Q_ASSERT(mutex.isLocked()) ;-).
start();
@@ -269,7 +271,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat
QStringList *files,
QStringList *directories)
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
stop();
wait();
QMutexLocker locker(&mutex);
@@ -336,7 +338,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat
#endif
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
void QFSEventsFileSystemWatcherEngine::updateList(PathInfoList &list, bool directory, bool emitSignals)
{
PathInfoList::iterator End = list.end();
@@ -396,7 +398,7 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef ,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId [])
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
QFSEventsFileSystemWatcherEngine *watcher = static_cast<QFSEventsFileSystemWatcherEngine *>(clientCallBackInfo);
QMutexLocker locker(&watcher->mutex);
CFArrayRef paths = static_cast<CFArrayRef>(eventPaths);
@@ -431,7 +433,7 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef ,
void QFSEventsFileSystemWatcherEngine::stop()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
QMutexLocker locker(&mutex);
stopFSStream(fsStream);
if (threadsRunLoop) {
@@ -443,13 +445,13 @@ void QFSEventsFileSystemWatcherEngine::stop()
void QFSEventsFileSystemWatcherEngine::updateFiles()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
QMutexLocker locker(&mutex);
updateHash(filePathInfoHash);
updateHash(dirPathInfoHash);
if (filePathInfoHash.isEmpty() && dirPathInfoHash.isEmpty()) {
// Everything disappeared before we got to start, don't bother.
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
// Code duplicated from stop(), with the exception that we
// don't wait on waitForStop here. Doing this will lead to
// a deadlock since this function is called from the worker
@@ -467,7 +469,7 @@ void QFSEventsFileSystemWatcherEngine::updateFiles()
void QFSEventsFileSystemWatcherEngine::run()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
threadsRunLoop = CFRunLoopGetCurrent();
FSEventStreamScheduleWithRunLoop(fsStream, threadsRunLoop, kCFRunLoopDefaultMode);
bool startedOK = FSEventStreamStart(fsStream);
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
index 2466a6e3d8..515c32e15c 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h
+++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
@@ -74,7 +74,7 @@ typedef uint64_t FSEventStreamEventId;
QT_BEGIN_NAMESPACE
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(QT_NO_CORESERVICES)
// Yes, I use a stat64 element here. QFileInfo requires too much knowledge about implementation
// details to be used as a long-standing record. Since I'm going to have to store this information, I can
// do the stat myself too.
@@ -117,7 +117,7 @@ private:
QMutex mutex;
QWaitCondition waitCondition;
QWaitCondition waitForStop;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES )
PathHash filePathInfoHash;
PathHash dirPathInfoHash;
void updateHash(PathHash &pathHash);
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp
index 6e5e91114c..63cc4f1ce6 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian.cpp
+++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp
@@ -62,9 +62,9 @@ QNotifyChangeEvent::QNotifyChangeEvent(RFs &fs, const TDesC &file,
failureCount(0)
{
if (isDir) {
- fsSession.NotifyChange(ENotifyEntry, iStatus, file);
+ fsSession.NotifyChange(ENotifyEntry, iStatus, watchedPath);
} else {
- fsSession.NotifyChange(ENotifyAll, iStatus, file);
+ fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath);
}
CActiveScheduler::Add(this);
SetActive();
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 4894754674..0d23a27909 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -472,10 +472,10 @@ qint64 QFSFileEngine::size() const
return d->nativeSize();
}
+#ifndef Q_OS_WIN
/*!
\internal
*/
-#ifndef Q_OS_WIN
qint64 QFSFileEnginePrivate::sizeFdFh() const
{
Q_Q(const QFSFileEngine);
diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp
index 7db4bbddd5..7d06ca4b17 100644
--- a/src/corelib/io/qtldurl.cpp
+++ b/src/corelib/io/qtldurl.cpp
@@ -7,29 +7,29 @@
** This file is part of the QtCore 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.
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
+** 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.
-**
-**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
**
**
**
diff --git a/src/corelib/io/qtldurl_p.h b/src/corelib/io/qtldurl_p.h
index 152ffa0f63..77c0a15823 100644
--- a/src/corelib/io/qtldurl_p.h
+++ b/src/corelib/io/qtldurl_p.h
@@ -7,29 +7,29 @@
** This file is part of the QtCore 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.
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
+** 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.
-**
-**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
**
**
**
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 83b49cee95..881365678f 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -6105,7 +6105,7 @@ bool QUrl::isDetached() const
"//servername/path/to/file.txt". Note that only certain platforms can
actually open this file using QFile::open().
- \sa toLocalFile(), isLocalFile(), QDir::toNativeSeparators
+ \sa toLocalFile(), isLocalFile(), QDir::toNativeSeparators()
*/
QUrl QUrl::fromLocalFile(const QString &localFile)
{
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 5b52ec22a1..04acfb0362 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -109,80 +109,6 @@ QHBufC::~QHBufC()
delete m_hBufC;
}
-class QS60PluginResolver
-{
-public:
- QS60PluginResolver()
- : initTried(false) {}
-
- ~QS60PluginResolver() {
- lib.Close();
- }
-
- TLibraryFunction resolve(int ordinal) {
- if (!initTried) {
- init();
- initTried = true;
- }
-
- if (lib.Handle())
- return lib.Lookup(ordinal);
- else
- return reinterpret_cast<TLibraryFunction>(NULL);
- }
-
-private:
- void init()
- {
- _LIT(KLibName_3_1, "qts60plugin_3_1" QT_LIBINFIX_UNICODE L".dll");
- _LIT(KLibName_3_2, "qts60plugin_3_2" QT_LIBINFIX_UNICODE L".dll");
- _LIT(KLibName_5_0, "qts60plugin_5_0" QT_LIBINFIX_UNICODE L".dll");
-
- TPtrC libName;
- TInt uidValue;
- switch (QSysInfo::s60Version()) {
- case QSysInfo::SV_S60_3_1:
- libName.Set(KLibName_3_1);
- uidValue = 0x2001E620;
- break;
- case QSysInfo::SV_S60_3_2:
- libName.Set(KLibName_3_2);
- uidValue = 0x2001E621;
- break;
- case QSysInfo::SV_S60_5_0: // Fall through to default
- default:
- // Default to 5.0 version, as any unknown platform is likely to be newer than that
- libName.Set(KLibName_5_0);
- uidValue = 0x2001E622;
- break;
- }
-
- TUidType libUid(KDynamicLibraryUid, KSharedLibraryUid, TUid::Uid(uidValue));
- lib.Load(libName, libUid);
-
- // Duplicate lib handle to enable process wide access to it. Since Duplicate overwrites
- // existing handle without closing it, store original for subsequent closing.
- RLibrary origHandleCloser = lib;
- lib.Duplicate(RThread(), EOwnerProcess);
- origHandleCloser.Close();
- }
-
- RLibrary lib;
- bool initTried;
-};
-
-Q_GLOBAL_STATIC(QS60PluginResolver, qt_s60_plugin_resolver);
-
-/*!
- \internal
- Resolves a platform version specific function from S60 plugin.
- If plugin is missing or resolving fails for another reason, NULL is returned.
-*/
-Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal)
-{
- return qt_s60_plugin_resolver()->resolve(ordinal);
-}
-
class QS60RFsSession
{
public:
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
index 84c6fed4db..3019e0594f 100644
--- a/src/corelib/kernel/qcore_symbian_p.h
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -142,19 +142,6 @@ inline uint qHash(TUid uid)
return qHash(uid.iUid);
}
-// S60 version specific function ordinals that can be resolved
-enum S60PluginFuncOrdinals
-{
- S60Plugin_TimeFormatL = 1,
- S60Plugin_GetTimeFormatSpec = 2,
- S60Plugin_GetLongDateFormatSpec = 3,
- S60Plugin_GetShortDateFormatSpec = 4,
- S60Plugin_LocalizedDirectoryName = 5,
- S60Plugin_GetSystemDrive = 6
-};
-
-Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal);
-
Q_CORE_EXPORT RFs& qt_s60GetRFs();
Q_CORE_EXPORT RSocketServ& qt_symbianGetSocketServer();
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 750204f714..7694a0f979 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -116,8 +116,6 @@ private:
};
#ifdef Q_OS_SYMBIAN
-typedef TDriveNumber (*SystemDriveFunc)(RFs&);
-static SystemDriveFunc PtrGetSystemDrive = 0;
static CApaCommandLine* apaCommandLine = 0;
static char *apaTail = 0;
static QVector<char *> *apaArgv = 0;
@@ -1950,10 +1948,7 @@ QString QCoreApplication::applicationDirPath()
}
if (err != KErrNone || (driveInfo.iDriveAtt & KDriveAttRom) || (driveInfo.iMediaAtt
& KMediaAttWriteProtected)) {
- if(!PtrGetSystemDrive)
- PtrGetSystemDrive = reinterpret_cast<SystemDriveFunc>(qt_resolveS60PluginFunc(S60Plugin_GetSystemDrive));
- Q_ASSERT(PtrGetSystemDrive);
- drive = PtrGetSystemDrive(fs);
+ drive = fs.GetSystemDrive();
fs.DriveToChar(drive, driveChar);
}
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 1d7ecce9ae..b216075e9d 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -59,8 +59,6 @@ QT_BEGIN_NAMESPACE
#define WAKE_UP_PRIORITY CActive::EPriorityStandard
#define TIMER_PRIORITY CActive::EPriorityHigh
-#define NULLTIMER_PRIORITY CActive::EPriorityLow
-#define COMPLETE_DEFERRED_ACTIVE_OBJECTS_PRIORITY CActive::EPriorityIdle
static inline int qt_pipe_write(int socket, const char *data, qint64 len)
{
@@ -124,57 +122,25 @@ private:
};
/*
- * This class is designed to aid in implementing event handling in a more round robin fashion. We
- * cannot change active objects that we do not own, but the active objects that Qt owns will use
- * this as a base class with convenience functions.
- *
- * Here is how it works: On every RunL, the deriving class should call maybeQueueForLater().
- * This will return whether the active object has been queued, or whether it should run immediately.
- * Queued objects will run again after other events have been processed.
- *
- * The QCompleteDeferredAOs class is a special object that runs after all others, which will
- * reactivate the objects that were previously not run.
+ * This class can be used as a base class for Qt active objects.
+ * Socket active objects can use it to defer their activity.
*/
QActiveObject::QActiveObject(TInt priority, QEventDispatcherSymbian *dispatcher)
: CActive(priority),
- m_dispatcher(dispatcher),
- m_hasAlreadyRun(false),
- m_hasRunAgain(false),
- m_iterationCount(1)
+ m_dispatcher(dispatcher)
{
}
QActiveObject::~QActiveObject()
{
- if (m_hasRunAgain)
- m_dispatcher->removeDeferredActiveObject(this);
-}
-
-bool QActiveObject::maybeQueueForLater()
-{
- Q_ASSERT(!m_hasRunAgain);
-
- if (!m_hasAlreadyRun || m_dispatcher->iterationCount() != m_iterationCount) {
- // First occurrence of this event in this iteration.
- m_hasAlreadyRun = true;
- m_iterationCount = m_dispatcher->iterationCount();
- return false;
- } else {
- // The event has already occurred.
- m_dispatcher->addDeferredActiveObject(this);
- m_hasRunAgain = true;
- return true;
- }
}
bool QActiveObject::maybeDeferSocketEvent()
{
- Q_ASSERT(!m_hasRunAgain);
Q_ASSERT(m_dispatcher);
if (!m_dispatcher->areSocketEventsBlocked()) {
return false;
}
- m_hasRunAgain = true;
m_dispatcher->addDeferredSocketActiveObject(this);
return true;
}
@@ -186,13 +152,11 @@ void QActiveObject::reactivateAndComplete()
SetActive();
TRequestStatus *status = &iStatus;
QEventDispatcherSymbian::RequestComplete(status, error);
-
- m_hasRunAgain = false;
- m_hasAlreadyRun = false;
}
QWakeUpActiveObject::QWakeUpActiveObject(QEventDispatcherSymbian *dispatcher)
- : QActiveObject(WAKE_UP_PRIORITY, dispatcher)
+ : CActive(WAKE_UP_PRIORITY),
+ m_dispatcher(dispatcher)
{
m_hostThreadId = RThread().Id();
CActiveScheduler::Add(this);
@@ -224,17 +188,14 @@ void QWakeUpActiveObject::DoCancel()
void QWakeUpActiveObject::RunL()
{
- if (maybeQueueForLater())
- return;
-
iStatus = KRequestPending;
SetActive();
QT_TRYCATCH_LEAVING(m_dispatcher->wakeUpWasCalled());
}
QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo)
- : QActiveObject((timerInfo->interval) ? TIMER_PRIORITY : NULLTIMER_PRIORITY , dispatcher),
- m_timerInfo(timerInfo), m_expectedTimeSinceLastEvent(0)
+ : CActive(TIMER_PRIORITY),
+ m_dispatcher(dispatcher), m_timerInfo(timerInfo), m_expectedTimeSinceLastEvent(0)
{
// start the timeout timer to ensure initialisation
m_timeoutTimer.start();
@@ -311,9 +272,6 @@ void QTimerActiveObject::Run()
return;
}
- if (maybeQueueForLater())
- return;
-
if (m_timerInfo->interval > 0) {
// Start a new timer immediately so that we don't lose time.
m_timerInfo->msLeft = m_timerInfo->interval;
@@ -365,44 +323,6 @@ SymbianTimerInfo::~SymbianTimerInfo()
delete timerAO;
}
-QCompleteDeferredAOs::QCompleteDeferredAOs(QEventDispatcherSymbian *dispatcher)
- : CActive(COMPLETE_DEFERRED_ACTIVE_OBJECTS_PRIORITY),
- m_dispatcher(dispatcher)
-{
- CActiveScheduler::Add(this);
- iStatus = KRequestPending;
- SetActive();
-}
-
-QCompleteDeferredAOs::~QCompleteDeferredAOs()
-{
- Cancel();
-}
-
-void QCompleteDeferredAOs::complete()
-{
- if (iStatus.Int() == KRequestPending) {
- TRequestStatus *status = &iStatus;
- QEventDispatcherSymbian::RequestComplete(status, KErrNone);
- }
-}
-
-void QCompleteDeferredAOs::DoCancel()
-{
- if (iStatus.Int() == KRequestPending) {
- TRequestStatus *status = &iStatus;
- QEventDispatcherSymbian::RequestComplete(status, KErrNone);
- }
-}
-
-void QCompleteDeferredAOs::RunL()
-{
- iStatus = KRequestPending;
- SetActive();
-
- QT_TRYCATCH_LEAVING(m_dispatcher->reactivateDeferredActiveObjects());
-}
-
QSelectThread::QSelectThread()
: m_quit(false)
{
@@ -677,8 +597,6 @@ void QSocketActiveObject::RunL()
{
if (maybeDeferSocketEvent())
return;
- if (maybeQueueForLater())
- return;
QT_TRYCATCH_LEAVING(run());
}
@@ -708,6 +626,138 @@ void QSocketActiveObject::deleteLater()
}
}
+/* Round robin active object scheduling for Qt apps.
+ *
+ * Qt and Symbian have different views on how events should be handled. Qt expects
+ * round-robin event processing, whereas Symbian implements a strict priority based
+ * system.
+ *
+ * This scheduler class, and its use in QEventDispatcherSymbian::processEvents,
+ * introduces round robin scheduling for high priority active objects, but leaves
+ * those with low priorities scheduled in priority order.
+ * The algorithm used is that, during each call to processEvents, any pre-existing
+ * runnable active object may run, but only once. Active objects with priority
+ * lower than EPriorityStandard can only run if no higher priority active object
+ * has run.
+ * This is done by implementing an alternative scheduling algorithm which requires
+ * access to the internal members of the active object system. The iSpare member of
+ * CActive is replaced with a flag indicating that the object is new (CBase zero
+ * initialization sets this), or not run, or ran. Only active objects with the
+ * not run flag are allowed to run.
+ */
+class QtRRActiveScheduler
+{
+public:
+ static void MarkReadyToRun();
+ enum RunResult {
+ NothingFound,
+ ObjectRun,
+ ObjectDelayed
+ };
+ static RunResult RunMarkedIfReady(TInt &runPriority, TInt minimumPriority);
+ static bool UseRRActiveScheduler();
+
+private:
+ // active scheduler access kit, for gaining access to the internals of active objects for
+ // alternative active scheduler implementations.
+ class TRequestStatusAccess
+ {
+ public:
+ enum { ERequestActiveFlags = 3 }; // TRequestStatus::EActive | TRequestStatus::ERequestPending
+ TInt iStatus;
+ TUint iFlags;
+ };
+
+ class CActiveDataAccess : public CBase
+ {
+ public:
+ TRequestStatusAccess iStatus;
+ TPriQueLink iLink;
+ enum TMarks
+ {
+ ENewObject, // CBase zero initialization sets this, new objects cannot be run in the processEvents in which they are created
+ ENotRun, // This object has not yet run in the current processEvents call
+ ERan // This object has run in the current processEvents call
+ };
+ int iMark; //TAny* iSpare;
+ };
+
+ class CActiveFuncAccess : public CActive
+ {
+ public:
+ // these functions are needed in RunMarkedIfReady
+ using CActive::RunL;
+ using CActive::RunError;
+ };
+
+ class CActiveSchedulerAccess : public CBase
+ {
+ public:
+ using CBase::Extension_;
+ struct TLoop;
+ TLoop* iStack;
+ TPriQue<CActiveFuncAccess> iActiveQ;
+ TAny* iSpare;
+ };
+};
+
+void QtRRActiveScheduler::MarkReadyToRun()
+{
+ CActiveScheduler *pS=CActiveScheduler::Current();
+ if (pS!=NULL)
+ {
+ TDblQueIter<CActive> iterator(((CActiveSchedulerAccess*)pS)->iActiveQ);
+ for (CActive* active=iterator++; active!=NULL; active=iterator++) {
+ ((CActiveDataAccess*)active)->iMark = CActiveDataAccess::ENotRun;
+ }
+ }
+}
+
+QtRRActiveScheduler::RunResult QtRRActiveScheduler::RunMarkedIfReady(TInt &runPriority, TInt minimumPriority)
+{
+ RunResult result = NothingFound;
+ TInt error=KErrNone;
+ CActiveScheduler *pS=CActiveScheduler::Current();
+ if (pS!=NULL) {
+ TDblQueIter<CActiveFuncAccess> iterator(((CActiveSchedulerAccess*)pS)->iActiveQ);
+ for (CActiveFuncAccess *active=iterator++; active!=NULL; active=iterator++) {
+ CActiveDataAccess *dataAccess = (CActiveDataAccess*)active;
+ if (active->IsActive() && (active->iStatus!=KRequestPending)) {
+ int& mark = dataAccess->iMark;
+ if (mark == CActiveDataAccess::ENotRun && active->Priority()>=minimumPriority) {
+ mark = CActiveDataAccess::ERan;
+ runPriority = active->Priority();
+ dataAccess->iStatus.iFlags&=~TRequestStatusAccess::ERequestActiveFlags;
+ int vptr = *(int*)active; // vptr can be used to identify type when debugging leaves
+ TRAP(error, active->RunL());
+ if (error!=KErrNone)
+ error=active->RunError(error);
+ if (error) {
+ qWarning("Active object (ptr=0x%08x, vptr=0x%08x) leave: %i\n", active, vptr, error);
+ pS->Error(error);
+ }
+ return ObjectRun;
+ }
+ result = ObjectDelayed;
+ }
+ }
+ }
+ return result;
+}
+
+bool QtRRActiveScheduler::UseRRActiveScheduler()
+{
+ // This code allows euser to declare incompatible active object / scheduler internal data structures
+ // in the future, disabling Qt's round robin scheduler use.
+ // By default the Extension_ function will set the second argument to NULL. We therefore use NULL to indicate
+ // that the data structures are compatible with before when this protocol was recognised.
+ // The extension id used is QtCore's UID.
+ CActiveSchedulerAccess *access = (CActiveSchedulerAccess *)CActiveScheduler::Current();
+ TAny* schedulerCompatibilityNumber;
+ access->Extension_(0x2001B2DC, schedulerCompatibilityNumber, NULL);
+ return schedulerCompatibilityNumber == NULL;
+}
+
#ifdef QT_SYMBIAN_PRIORITY_DROP
class QIdleDetectorThread
{
@@ -811,7 +861,6 @@ QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent)
m_selectThread(0),
m_activeScheduler(0),
m_wakeUpAO(0),
- m_completeDeferredAOs(0),
m_interrupt(false),
m_wakeUpDone(0),
m_iterationCount(0),
@@ -836,7 +885,6 @@ void QEventDispatcherSymbian::startingUp()
CActiveScheduler::Install(m_activeScheduler);
}
m_wakeUpAO = q_check_ptr(new QWakeUpActiveObject(this));
- m_completeDeferredAOs = q_check_ptr(new QCompleteDeferredAOs(this));
// We already might have posted events, wakeup once to process them
wakeUp();
}
@@ -855,7 +903,6 @@ void QEventDispatcherSymbian::closingDown()
delete m_selectThread;
m_selectThread = 0;
- delete m_completeDeferredAOs;
delete m_wakeUpAO;
if (m_activeScheduler) {
delete m_activeScheduler;
@@ -864,6 +911,7 @@ void QEventDispatcherSymbian::closingDown()
bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags )
{
+ const bool useRRScheduler = QtRRActiveScheduler::UseRRActiveScheduler();
bool handledAnyEvent = false;
bool oldNoSocketEventsValue = m_noSocketEvents;
bool oldInsideTimerEventValue = m_insideTimerEvent;
@@ -894,8 +942,9 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
handledAnyEvent = sendDeferredSocketEvents();
}
- bool handledSymbianEvent = false;
+ QtRRActiveScheduler::RunResult handledSymbianEvent = QtRRActiveScheduler::NothingFound;
m_interrupt = false;
+ int minPriority = KMinTInt;
#ifdef QT_SYMBIAN_PRIORITY_DROP
QElapsedTimer eventTimer;
@@ -921,6 +970,10 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
CActiveScheduler::Current()->WaitForAnyRequest();
}
+ if (useRRScheduler && handledSymbianEvent == QtRRActiveScheduler::NothingFound) {
+ QtRRActiveScheduler::MarkReadyToRun();
+ }
+
#ifdef QT_SYMBIAN_PRIORITY_DROP
if (idleDetectorThread()->hasRun()) {
if (m_delay > baseDelay)
@@ -936,11 +989,31 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
eventTimer.start();
#endif
- TInt error;
- handledSymbianEvent = CActiveScheduler::RunIfReady(error, KMinTInt);
- if (error) {
- qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
- CActiveScheduler::Current()->Error(error);
+ if (useRRScheduler) {
+ // Standard or above priority AOs are scheduled round robin.
+ // Lower priority AOs can only run if nothing higher priority has run.
+ int runPriority = minPriority;
+ handledSymbianEvent = QtRRActiveScheduler::RunMarkedIfReady(runPriority, minPriority);
+ minPriority = qMin(runPriority, int(CActive::EPriorityStandard));
+ } else {
+ TInt error;
+ handledSymbianEvent =
+ CActiveScheduler::RunIfReady(error, minPriority)
+ ? QtRRActiveScheduler::ObjectRun
+ : QtRRActiveScheduler::NothingFound;
+ if (error) {
+ qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
+ CActiveScheduler::Current()->Error(error);
+ }
+ }
+
+ if (handledSymbianEvent == QtRRActiveScheduler::NothingFound) {
+ // no runnable or delayed active object was found, the signal that caused us to get here must be bad
+ qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
+ } else if (handledSymbianEvent == QtRRActiveScheduler::ObjectDelayed) {
+ // signal the thread to compensate for the un-handled signal absorbed
+ RThread().RequestSignal();
+ break;
}
#ifdef QT_SYMBIAN_PRIORITY_DROP
@@ -949,10 +1022,8 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
m_avgEventTime = (m_avgEventTime * 95 + eventDur * 5) / 100;
#endif
- if (!handledSymbianEvent) {
- qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
- }
handledAnyEvent = true;
+
if (m_interrupt) {
break;
}
@@ -1051,41 +1122,11 @@ bool QEventDispatcherSymbian::sendPostedEvents()
//return false;
}
-inline void QEventDispatcherSymbian::addDeferredActiveObject(QActiveObject *object)
-{
- queueDeferredActiveObjectsCompletion();
- m_deferredActiveObjects.append(object);
-}
-
-inline void QEventDispatcherSymbian::removeDeferredActiveObject(QActiveObject *object)
-{
- m_deferredActiveObjects.removeAll(object);
- m_deferredSocketEvents.removeAll(object);
-}
-
inline void QEventDispatcherSymbian::addDeferredSocketActiveObject(QActiveObject *object)
{
m_deferredSocketEvents.append(object);
}
-void QEventDispatcherSymbian::queueDeferredActiveObjectsCompletion()
-{
- m_completeDeferredAOs->complete();
-}
-
-void QEventDispatcherSymbian::reactivateDeferredActiveObjects()
-{
- while (!m_deferredActiveObjects.isEmpty()) {
- QActiveObject *object = m_deferredActiveObjects.takeFirst();
- object->reactivateAndComplete();
- }
-
- // We do this because we want to return from processEvents. This is because
- // each invocation of processEvents should only run each active object once.
- // The active scheduler should run them continously, however.
- m_interrupt = true;
-}
-
bool QEventDispatcherSymbian::sendDeferredSocketEvents()
{
bool sentAnyEvents = false;
@@ -1161,14 +1202,6 @@ void QEventDispatcherSymbian::registerTimer ( int timerId, int interval, QObject
m_timerList.insert(timerId, timer);
timer->timerAO->Start();
-
- if (m_insideTimerEvent)
- // If we are inside a timer event, we need to prevent event starvation
- // by preventing newly created timers from running in the same event processing
- // iteration. Do this by calling the maybeQueueForLater() function to "fake" that we have
- // already run once. This will cause the next run to be added to the deferred
- // queue instead.
- timer->timerAO->maybeQueueForLater();
}
bool QEventDispatcherSymbian::unregisterTimer ( int timerId )
@@ -1231,86 +1264,6 @@ void CQtActiveScheduler::Error(TInt aError) const
QT_CATCH (const std::bad_alloc&) {} // ignore alloc fails, nothing more can be done
}
-bool QActiveObject::wait(CActive* ao, int ms)
-{
- if (!ao->IsActive())
- return true; //request already complete
- bool timedout = false;
- if (ms > 0) {
- TRequestStatus tstat;
- RTimer t;
- if (KErrNone != t.CreateLocal())
- return false;
- t.HighRes(tstat, ms*1000);
- User::WaitForRequest(tstat, ao->iStatus);
- if (tstat != KRequestPending) {
- timedout = true;
- } else {
- t.Cancel();
- //balance thread semaphore
- User::WaitForRequest(tstat);
- }
- t.Close();
- } else {
- User::WaitForRequest(ao->iStatus);
- }
- if (timedout)
- return false;
-
- //evil cast to allow calling of protected virtual
- ((QActiveObject*)ao)->RunL();
-
- //clear active & pending flags
- ao->iStatus = TRequestStatus();
-
- return true;
-}
-
-bool QActiveObject::wait(QList<CActive*> aos, int ms)
-{
- QVector<TRequestStatus*> stati;
- stati.reserve(aos.count() + 1);
- foreach (CActive* ao, aos) {
- if (!ao->IsActive())
- return true; //request already complete
- stati.append(&(ao->iStatus));
- }
- bool timedout = false;
- TRequestStatus tstat;
- RTimer t;
- if (ms > 0) {
- if (KErrNone != t.CreateLocal())
- return false;
- t.HighRes(tstat, ms*1000);
- stati.append(&tstat);
- }
- User::WaitForNRequest(stati.data(), stati.count());
- if (ms > 0) {
- if (tstat != KRequestPending) {
- timedout = true;
- } else {
- t.Cancel();
- //balance thread semaphore
- User::WaitForRequest(tstat);
- }
- t.Close();
- }
- if (timedout)
- return false;
-
- foreach (CActive* ao, aos) {
- if (ao->iStatus != KRequestPending) {
- //evil cast to allow calling of protected virtual
- ((QActiveObject*)ao)->RunL();
-
- //clear active & pending flags
- ao->iStatus = TRequestStatus();
- break; //only call one
- }
- }
- return true;
-}
-
QT_END_NAMESPACE
#include "moc_qeventdispatcher_symbian_p.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index e327a9cdc5..1b8159998c 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -83,23 +83,14 @@ public:
QActiveObject(TInt priority, QEventDispatcherSymbian *dispatcher);
~QActiveObject();
- bool maybeQueueForLater();
bool maybeDeferSocketEvent();
void reactivateAndComplete();
-
- static bool wait(CActive* ao, int ms);
- static bool wait(QList<CActive*> aos, int ms);
protected:
QEventDispatcherSymbian *m_dispatcher;
-
-private:
- bool m_hasAlreadyRun : 1;
- bool m_hasRunAgain : 1;
- int m_iterationCount;
};
-class QWakeUpActiveObject : public QActiveObject
+class QWakeUpActiveObject : public CActive
{
public:
QWakeUpActiveObject(QEventDispatcherSymbian *dispatcher);
@@ -112,6 +103,7 @@ protected:
void RunL();
private:
+ QEventDispatcherSymbian *m_dispatcher;
TThreadId m_hostThreadId;
};
@@ -132,7 +124,7 @@ struct SymbianTimerInfo : public QSharedData
typedef QExplicitlySharedDataPointer<SymbianTimerInfo> SymbianTimerInfoPtr;
// This is a bit of a proxy class. See comments in SetActive and Start for details.
-class QTimerActiveObject : public QActiveObject
+class QTimerActiveObject : public CActive
{
public:
QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo);
@@ -149,28 +141,13 @@ private:
void StartTimer();
private:
+ QEventDispatcherSymbian *m_dispatcher;
SymbianTimerInfo *m_timerInfo;
QElapsedTimer m_timeoutTimer;
int m_expectedTimeSinceLastEvent;
RTimer m_rTimer;
};
-class QCompleteDeferredAOs : public CActive
-{
-public:
- QCompleteDeferredAOs(QEventDispatcherSymbian *dispatcher);
- ~QCompleteDeferredAOs();
-
- void complete();
-
-protected:
- void DoCancel();
- void RunL();
-
-private:
- QEventDispatcherSymbian *m_dispatcher;
-};
-
class QSocketActiveObject : public QActiveObject
{
public:
@@ -254,12 +231,6 @@ public:
void wakeUpWasCalled();
void reactivateSocketNotifier(QSocketNotifier *notifier);
- void addDeferredActiveObject(QActiveObject *object);
- void removeDeferredActiveObject(QActiveObject *object);
- void queueDeferredActiveObjectsCompletion();
- // Can be overridden to activate local active objects too, but do call baseclass!
- virtual void reactivateDeferredActiveObjects();
-
inline int iterationCount() const { return m_iterationCount; }
void addDeferredSocketActiveObject(QActiveObject *object);
@@ -282,7 +253,6 @@ private:
QHash<QSocketNotifier *, QSocketActiveObject *> m_notifiers;
QWakeUpActiveObject *m_wakeUpAO;
- QCompleteDeferredAOs *m_completeDeferredAOs;
volatile bool m_interrupt;
QAtomicInt m_wakeUpDone;
@@ -292,8 +262,6 @@ private:
bool m_noSocketEvents;
//deferred until socket events are enabled
QList<QActiveObject *> m_deferredSocketEvents;
- //deferred until idle
- QList<QActiveObject *> m_deferredActiveObjects;
int m_delay;
int m_avgEventTime;
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index a4948c16be..b88643df5c 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1790,6 +1790,7 @@ QObjectList QObject::queryList(const char *inheritsClass,
/*!
\fn T qFindChild(const QObject *obj, const QString &name)
\relates QObject
+ \overload qFindChildren()
\obsolete
This function is equivalent to
@@ -1805,6 +1806,7 @@ QObjectList QObject::queryList(const char *inheritsClass,
/*!
\fn QList<T> qFindChildren(const QObject *obj, const QString &name)
\relates QObject
+ \overload qFindChildren()
\obsolete
This function is equivalent to
@@ -1834,38 +1836,6 @@ QObjectList QObject::queryList(const char *inheritsClass,
/*!
\internal
- \fn T qFindChild(const QObject *obj, const QString &name = QString(), T dummy = 0)
- \relates QObject
- \overload qFindChildren()
-
- This function is equivalent to
- \a{obj}->\l{QObject::findChild()}{findChild}<T>(\a name).
-
- \note This function was provided as a workaround for MSVC 6
- which did not support member template functions. It is advised
- to use the other form in new code.
-
- \sa QObject::findChild()
-*/
-
-/*!
- \internal
- \fn QList<T> qFindChildren(const QObject *obj, const QString &name = QString(), T dummy = 0)
- \relates QObject
- \overload qFindChildren()
-
- This function is equivalent to
- \a{obj}->\l{QObject::findChildren()}{findChildren}<T>(\a name).
-
- \note This function was provided as a workaround for MSVC 6
- which did not support member template functions. It is advised
- to use the other form in new code.
-
- \sa QObject::findChildren()
-*/
-
-/*!
- \internal
*/
void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re,
const QMetaObject &mo, QList<void*> *list)
@@ -2419,20 +2389,22 @@ int QObject::receivers(const char *signal) const
This helper function calculates signal and method index for the given
member in the specified class.
- \li If member.mobj is 0 then both signalIndex and methodIndex are set to -1.
+ \list
+ \o If member.mobj is 0 then both signalIndex and methodIndex are set to -1.
- \li If specified member is not a member of obj instance class (or one of
+ \o If specified member is not a member of obj instance class (or one of
its parent classes) then both signalIndex and methodIndex are set to -1.
+ \endlist
This function is used by QObject::connect and QObject::disconnect which
are working with QMetaMethod.
- \param[out] signalIndex is set to the signal index of member. If the member
+ \a signalIndex is set to the signal index of member. If the member
specified is not signal this variable is set to -1.
- \param[out] methodIndex is set to the method index of the member. If the
- member is not a method of the object specified by obj param this variable
- is set to -1.
+ \a methodIndex is set to the method index of the member. If the
+ member is not a method of the object specified by the \a obj argument this
+ variable is set to -1.
*/
void QMetaObjectPrivate::memberIndexes(const QObject *obj,
const QMetaMethod &member,
@@ -2689,9 +2661,9 @@ bool QObject::connect(const QObject *sender, const char *signal,
Qt::ConnectionType type)
but it uses QMetaMethod to specify signal and method.
- \see connect(const QObject *sender, const char *signal,
- const QObject *receiver, const char *method,
- Qt::ConnectionType type)
+ \sa connect(const QObject *sender, const char *signal,
+ const QObject *receiver, const char *method,
+ Qt::ConnectionType type)
*/
bool QObject::connect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &method,
@@ -2987,7 +2959,7 @@ bool QObject::disconnect(const QObject *sender, const char *signal,
In the same way 0 can be used for \a receiver in the meaning "any receiving object". In this case
method shoud also be QMetaMethod(). \a sender parameter should be never 0.
- \see disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
+ \sa disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
*/
bool QObject::disconnect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &method)
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index d274fa36da..15d81b949a 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -345,6 +345,11 @@ public:
};
#endif
+#ifdef qdoc
+T qFindChild(const QObject *o, const QString &name = QString());
+QList<T> qFindChildren(const QObject *oobj, const QString &name = QString());
+QList<T> qFindChildren(const QObject *o, const QRegExp &re);
+#endif
#ifdef QT_DEPRECATED
template<typename T>
inline QT_DEPRECATED T qFindChild(const QObject *o, const QString &name = QString())
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index acb6044bac..288227933c 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -247,14 +247,14 @@ void QSharedMemory::setNativeKey(const QString &key)
if (isAttached())
detach();
d->cleanHandle();
- d->key = QString();
+ d->key.clear();
d->nativeKey = key;
}
bool QSharedMemoryPrivate::initKey()
{
- if (!cleanHandle())
- return false;
+ cleanHandle();
+
#ifndef QT_NO_SYSTEMSEMAPHORE
systemSemaphore.setKey(QString(), 1);
systemSemaphore.setKey(key, 1);
@@ -285,7 +285,7 @@ bool QSharedMemoryPrivate::initKey()
return false;
}
#endif
- errorString = QString();
+ errorString.clear();
error = QSharedMemory::NoError;
return true;
}
@@ -342,28 +342,24 @@ bool QSharedMemory::create(int size, AccessMode mode)
if (!d->initKey())
return false;
+ if (size <= 0) {
+ d->error = QSharedMemory::InvalidSize;
+ d->errorString = QSharedMemory::tr("%1: create size is less then 0").arg(QLatin1String("QSharedMemory::create"));
+ return false;
+ }
+
#ifndef QT_NO_SYSTEMSEMAPHORE
#ifndef Q_OS_WIN
// Take ownership and force set initialValue because the semaphore
// might have already existed from a previous crash.
d->systemSemaphore.setKey(d->key, 1, QSystemSemaphore::Create);
#endif
-#endif
- QString function = QLatin1String("QSharedMemory::create");
-#ifndef QT_NO_SYSTEMSEMAPHORE
QSharedMemoryLocker lock(this);
- if (!d->key.isNull() && !d->tryLocker(&lock, function))
+ if (!d->key.isNull() && !d->tryLocker(&lock, QLatin1String("QSharedMemory::create")))
return false;
#endif
- if (size <= 0) {
- d->error = QSharedMemory::InvalidSize;
- d->errorString =
- QSharedMemory::tr("%1: create size is less then 0").arg(function);
- return false;
- }
-
if (!d->create(size))
return false;
diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h
index d5fafeff97..21b8612438 100644
--- a/src/corelib/kernel/qsharedmemory_p.h
+++ b/src/corelib/kernel/qsharedmemory_p.h
@@ -70,12 +70,12 @@ namespace QSharedMemoryPrivate
#include "private/qobject_p.h"
#ifdef Q_OS_WIN
-#include <qt_windows.h>
+# include <qt_windows.h>
#elif defined(Q_OS_SYMBIAN)
-#include <e32std.h>
-#include <sys/types.h>
+# include <e32std.h>
+# include <sys/types.h>
#else
-#include <sys/sem.h>
+# include <sys/types.h>
#endif
QT_BEGIN_NAMESPACE
@@ -139,7 +139,7 @@ public:
key_t handle();
#endif
bool initKey();
- bool cleanHandle();
+ void cleanHandle();
bool create(int size);
bool attach(QSharedMemory::AccessMode mode);
bool detach();
@@ -151,7 +151,7 @@ public:
#endif
#ifndef QT_NO_SYSTEMSEMAPHORE
- bool tryLocker(QSharedMemoryLocker *locker, const QString function) {
+ inline bool tryLocker(QSharedMemoryLocker *locker, const QString &function) {
if (!locker->lock()) {
errorString = QSharedMemory::tr("%1: unable to lock").arg(function);
error = QSharedMemory::LockError;
diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp
index fdd513a475..cd1567accb 100644
--- a/src/corelib/kernel/qsharedmemory_symbian.cpp
+++ b/src/corelib/kernel/qsharedmemory_symbian.cpp
@@ -41,19 +41,21 @@
#include "qsharedmemory.h"
#include "qsharedmemory_p.h"
-#include "qsystemsemaphore.h"
+
#include "qcore_symbian_p.h"
#include <qdebug.h>
-QT_BEGIN_NAMESPACE
-
#ifndef QT_NO_SHAREDMEMORY
#define QSHAREDMEMORY_DEBUG
-QSharedMemoryPrivate::QSharedMemoryPrivate() : QObjectPrivate(),
- memory(0), size(0), error(QSharedMemory::NoError),
- systemSemaphore(QString()), lockedByMe(false)
+QT_BEGIN_NAMESPACE
+
+QSharedMemoryPrivate::QSharedMemoryPrivate()
+ : QObjectPrivate(), memory(0), size(0), error(QSharedMemory::NoError),
+#ifndef QT_NO_SYSTEMSEMAPHORE
+ systemSemaphore(QString()), lockedByMe(false)
+#endif
{
}
@@ -61,6 +63,7 @@ void QSharedMemoryPrivate::setErrorString(const QString &function, TInt errorCod
{
if (errorCode == KErrNone)
return;
+
switch (errorCode) {
case KErrAlreadyExists:
error = QSharedMemory::AlreadyExists;
@@ -88,40 +91,43 @@ void QSharedMemoryPrivate::setErrorString(const QString &function, TInt errorCod
#if defined QSHAREDMEMORY_DEBUG
qDebug() << errorString << "key" << key;
#endif
+ break;
}
}
key_t QSharedMemoryPrivate::handle()
{
+ // don't allow making handles on empty keys
+ if (nativeKey.isEmpty()) {
+ error = QSharedMemory::KeyError;
+ errorString = QSharedMemory::tr("%1: key is empty").arg(QLatin1String("QSharedMemory::handle"));
+ return 0;
+ }
+
// Not really cost effective to check here if shared memory is attachable, as it requires
// exactly the same call as attaching, so always assume handle is valid and return failure
// from attach.
return 1;
}
-bool QSharedMemoryPrivate::cleanHandle()
+void QSharedMemoryPrivate::cleanHandle()
{
chunk.Close();
- return true;
}
bool QSharedMemoryPrivate::create(int size)
{
- QString function = QLatin1String("QSharedMemory::create");
- if (nativeKey.isEmpty()) {
- error = QSharedMemory::KeyError;
- errorString = QSharedMemory::tr("%1: key error").arg(function);
+ if (!handle())
return false;
- }
TPtrC ptr(qt_QString2TPtrC(nativeKey));
TInt err = chunk.CreateGlobal(ptr, size, size);
- setErrorString(function, err);
-
- if (err != KErrNone)
+ if (err != KErrNone) {
+ setErrorString(QLatin1String("QSharedMemory::create"), err);
return false;
+ }
// Zero out the created chunk
Mem::FillZ(chunk.Base(), chunk.Size());
@@ -133,12 +139,8 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode /* mode */)
{
// Grab a pointer to the memory block
if (!chunk.Handle()) {
- QString function = QLatin1String("QSharedMemory::handle");
- if (nativeKey.isEmpty()) {
- error = QSharedMemory::KeyError;
- errorString = QSharedMemory::tr("%1: unable to make key").arg(function);
+ if (!handle())
return false;
- }
TPtrC ptr(qt_QString2TPtrC(nativeKey));
@@ -147,7 +149,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode /* mode */)
err = chunk.OpenGlobal(ptr, false);
if (err != KErrNone) {
- setErrorString(function, err);
+ setErrorString(QLatin1String("QSharedMemory::attach"), err);
return false;
}
}
@@ -168,6 +170,6 @@ bool QSharedMemoryPrivate::detach()
return true;
}
-#endif //QT_NO_SHAREDMEMORY
-
QT_END_NAMESPACE
+
+#endif //QT_NO_SHAREDMEMORY
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index 2bbda4933f..e991ce9e09 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -43,25 +43,26 @@
#include "qsharedmemory.h"
#include "qsharedmemory_p.h"
-#include "qsystemsemaphore.h"
-#include <qdir.h>
-#include <qdebug.h>
-#include <errno.h>
+#include <qdebug.h>
+#include <qfile.h>
#ifndef QT_NO_SHAREDMEMORY
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#endif //QT_NO_SHAREDMEMORY
+#endif // QT_NO_SHAREDMEMORY
+#include <errno.h>
#include "private/qcore_unix_p.h"
#ifndef QT_NO_SHAREDMEMORY
+
+//#define QSHAREDMEMORY_DEBUG
+
QT_BEGIN_NAMESPACE
QSharedMemoryPrivate::QSharedMemoryPrivate()
@@ -78,6 +79,7 @@ void QSharedMemoryPrivate::setErrorString(const QString &function)
// EINVAL is handled in functions so they can give better error strings
switch (errno) {
case EACCES:
+ case EPERM:
errorString = QSharedMemory::tr("%1: permission denied").arg(function);
error = QSharedMemory::PermissionDenied;
break;
@@ -98,9 +100,10 @@ void QSharedMemoryPrivate::setErrorString(const QString &function)
default:
errorString = QSharedMemory::tr("%1: unknown error %2").arg(function).arg(errno);
error = QSharedMemory::UnknownError;
-#if defined QSHAREDMEMORY_DEBUG
+#ifdef QSHAREDMEMORY_DEBUG
qDebug() << errorString << "key" << key << "errno" << errno << EINVAL;
#endif
+ break;
}
}
@@ -117,21 +120,21 @@ key_t QSharedMemoryPrivate::handle()
// don't allow making handles on empty keys
if (nativeKey.isEmpty()) {
- errorString = QSharedMemory::tr("%1: key is empty").arg(QLatin1String("QSharedMemory::handle:"));
+ errorString = QSharedMemory::tr("%1: key is empty").arg(QLatin1String("QSharedMemory::handle"));
error = QSharedMemory::KeyError;
return 0;
}
// ftok requires that an actual file exists somewhere
if (!QFile::exists(nativeKey)) {
- errorString = QSharedMemory::tr("%1: UNIX key file doesn't exist").arg(QLatin1String("QSharedMemory::handle:"));
+ errorString = QSharedMemory::tr("%1: UNIX key file doesn't exist").arg(QLatin1String("QSharedMemory::handle"));
error = QSharedMemory::NotFound;
return 0;
}
unix_key = ftok(QFile::encodeName(nativeKey).constData(), 'Q');
if (-1 == unix_key) {
- errorString = QSharedMemory::tr("%1: ftok failed").arg(QLatin1String("QSharedMemory::handle:"));
+ errorString = QSharedMemory::tr("%1: ftok failed").arg(QLatin1String("QSharedMemory::handle"));
error = QSharedMemory::KeyError;
unix_key = 0;
}
@@ -149,20 +152,20 @@ key_t QSharedMemoryPrivate::handle()
-1 error
0 already existed
1 created
- */
+*/
int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName)
{
if (QFile::exists(fileName))
return 0;
int fd = qt_safe_open(QFile::encodeName(fileName).constData(),
- O_EXCL | O_CREAT | O_RDWR, 0640);
+ O_EXCL | O_CREAT | O_RDWR, 0640);
if (-1 == fd) {
if (errno == EEXIST)
return 0;
return -1;
} else {
- close(fd);
+ qt_safe_close(fd);
}
return 1;
}
@@ -170,25 +173,21 @@ int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName)
#ifndef QT_NO_SHAREDMEMORY
-bool QSharedMemoryPrivate::cleanHandle()
+void QSharedMemoryPrivate::cleanHandle()
{
unix_key = 0;
- return true;
}
bool QSharedMemoryPrivate::create(int size)
{
// build file if needed
- bool createdFile = false;
int built = createUnixKeyFile(nativeKey);
if (built == -1) {
- errorString = QSharedMemory::tr("%1: unable to make key").arg(QLatin1String("QSharedMemory::handle:"));
+ errorString = QSharedMemory::tr("%1: unable to make key").arg(QLatin1String("QSharedMemory::create"));
error = QSharedMemory::KeyError;
return false;
}
- if (built == 1) {
- createdFile = true;
- }
+ bool createdFile = built == 1;
// get handle
if (!handle()) {
@@ -202,7 +201,7 @@ bool QSharedMemoryPrivate::create(int size)
QString function = QLatin1String("QSharedMemory::create");
switch (errno) {
case EINVAL:
- errorString = QSharedMemory::tr("%1: system-imposed size restrictions").arg(QLatin1String("QSharedMemory::handle"));
+ errorString = QSharedMemory::tr("%1: system-imposed size restrictions").arg(function);
error = QSharedMemory::InvalidSize;
break;
default:
@@ -280,7 +279,7 @@ bool QSharedMemoryPrivate::detach()
if (shmid_ds.shm_nattch == 0) {
// mark for removal
if (-1 == shmctl(id, IPC_RMID, &shmid_ds)) {
- setErrorString(QLatin1String("QSharedMemory::remove"));
+ setErrorString(QLatin1String("QSharedMemory::detach"));
switch (errno) {
case EINVAL:
return true;
@@ -296,7 +295,6 @@ bool QSharedMemoryPrivate::detach()
return true;
}
-
QT_END_NAMESPACE
#endif // QT_NO_SHAREDMEMORY
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 3cc14fe512..567214e1d2 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -41,24 +41,30 @@
#include "qsharedmemory.h"
#include "qsharedmemory_p.h"
-#include "qsystemsemaphore.h"
-#include <qdebug.h>
-QT_BEGIN_NAMESPACE
+#include <qdebug.h>
#ifndef QT_NO_SHAREDMEMORY
-QSharedMemoryPrivate::QSharedMemoryPrivate() : QObjectPrivate(),
- memory(0), size(0), error(QSharedMemory::NoError),
- systemSemaphore(QString()), lockedByMe(false), hand(0)
+//#define QSHAREDMEMORY_DEBUG
+
+QT_BEGIN_NAMESPACE
+
+QSharedMemoryPrivate::QSharedMemoryPrivate()
+ : QObjectPrivate(), memory(0), size(0), error(QSharedMemory::NoError),
+#ifndef QT_NO_SYSTEMSEMAPHORE
+ systemSemaphore(QString()), lockedByMe(false),
+#endif
+ hand(0)
{
}
void QSharedMemoryPrivate::setErrorString(const QString &function)
{
- BOOL windowsError = GetLastError();
+ DWORD windowsError = GetLastError();
if (windowsError == 0)
return;
+
switch (windowsError) {
case ERROR_ALREADY_EXISTS:
error = QSharedMemory::AlreadyExists;
@@ -89,19 +95,20 @@ void QSharedMemoryPrivate::setErrorString(const QString &function)
default:
errorString = QSharedMemory::tr("%1: unknown error %2").arg(function).arg(windowsError);
error = QSharedMemory::UnknownError;
-#if defined QSHAREDMEMORY_DEBUG
+#ifdef QSHAREDMEMORY_DEBUG
qDebug() << errorString << "key" << key;
#endif
+ break;
}
}
HANDLE QSharedMemoryPrivate::handle()
{
if (!hand) {
- QString function = QLatin1String("QSharedMemory::handle");
+ // don't allow making handles on empty keys
if (nativeKey.isEmpty()) {
error = QSharedMemory::KeyError;
- errorString = QSharedMemory::tr("%1: unable to make key").arg(function);
+ errorString = QSharedMemory::tr("%1: key is empty").arg(QLatin1String("QSharedMemory::handle"));
return false;
}
#ifndef Q_OS_WINCE
@@ -111,43 +118,34 @@ HANDLE QSharedMemoryPrivate::handle()
// attach as it seems.
hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 0, (wchar_t*)nativeKey.utf16());
#endif
- if (!hand) {
- setErrorString(function);
- return false;
- }
+ if (!hand)
+ setErrorString(QLatin1String("QSharedMemory::handle"));
}
+
return hand;
}
-bool QSharedMemoryPrivate::cleanHandle()
+void QSharedMemoryPrivate::cleanHandle()
{
- if (hand != 0 && !CloseHandle(hand)) {
- hand = 0;
+ if (hand != 0 && !CloseHandle(hand))
setErrorString(QLatin1String("QSharedMemory::cleanHandle"));
- return false;
- }
hand = 0;
- return true;
}
bool QSharedMemoryPrivate::create(int size)
{
- QString function = QLatin1String("QSharedMemory::create");
if (nativeKey.isEmpty()) {
error = QSharedMemory::KeyError;
- errorString = QSharedMemory::tr("%1: key error").arg(function);
+ errorString = QSharedMemory::tr("%1: key is empty").arg(QLatin1String("QSharedMemory::create"));
return false;
}
// Create the file mapping.
hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size, (wchar_t*)nativeKey.utf16());
- setErrorString(function);
+ setErrorString(QLatin1String("QSharedMemory::create"));
// hand is valid when it already exists unlike unix so explicitly check
- if (error == QSharedMemory::AlreadyExists || !hand)
- return false;
-
- return true;
+ return !(error == QSharedMemory::AlreadyExists || !hand);
}
bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
@@ -167,7 +165,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
// Windows doesn't set an error code on this one,
// it should only be a kernel memory error.
error = QSharedMemory::UnknownError;
- errorString = QSharedMemory::tr("%1: size query failed").arg(QLatin1String("QSharedMemory::attach: "));
+ errorString = QSharedMemory::tr("%1: size query failed").arg(QLatin1String("QSharedMemory::attach"));
return false;
}
size = info.RegionSize;
@@ -186,10 +184,11 @@ bool QSharedMemoryPrivate::detach()
size = 0;
// close handle
- return cleanHandle();
-}
-
-#endif //QT_NO_SHAREDMEMORY
+ cleanHandle();
+ return true;
+}
QT_END_NAMESPACE
+
+#endif // QT_NO_SHAREDMEMORY
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index d4e86e8866..3e5f737667 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -59,7 +59,7 @@
#include "qsharedmemory_p.h"
#ifndef Q_OS_WINCE
-# include <sys/types.h>
+# include <sys/types.h>
#endif
#ifdef Q_OS_SYMBIAN
@@ -70,11 +70,10 @@ QT_BEGIN_NAMESPACE
class QSystemSemaphorePrivate
{
-
public:
QSystemSemaphorePrivate();
- QString makeKeyFileName()
+ inline QString makeKeyFileName() const
{
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
}
@@ -101,10 +100,10 @@ public:
#elif defined(Q_OS_SYMBIAN)
RSemaphore semaphore;
#else
+ key_t unix_key;
int semaphore;
bool createdFile;
bool createdSemaphore;
- key_t unix_key;
#endif
QString errorString;
QSystemSemaphore::SystemSemaphoreError error;
@@ -115,4 +114,3 @@ QT_END_NAMESPACE
#endif // QT_NO_SYSTEMSEMAPHORE
#endif // QSYSTEMSEMAPHORE_P_H
-
diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
index 96c19afcfc..bb60df7819 100644
--- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
@@ -46,29 +46,32 @@
#include "qcore_symbian_p.h"
#include <e32cmn.h>
-QT_BEGIN_NAMESPACE
#ifndef QT_NO_SYSTEMSEMAPHORE
+//#define QSYSTEMSEMAPHORE_DEBUG
+
+QT_BEGIN_NAMESPACE
+
QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
- error(QSystemSemaphore::NoError)
+ error(QSystemSemaphore::NoError)
{
}
void QSystemSemaphorePrivate::setErrorString(const QString &function, int err)
{
- if (err == KErrNone){
+ if (err == KErrNone)
return;
- }
+
switch(err){
case KErrAlreadyExists:
errorString = QCoreApplication::tr("%1: already exists", "QSystemSemaphore").arg(function);
error = QSystemSemaphore::AlreadyExists;
- break;
+ break;
case KErrNotFound:
errorString = QCoreApplication::tr("%1: does not exist", "QSystemSemaphore").arg(function);
error = QSystemSemaphore::NotFound;
- break;
+ break;
case KErrNoMemory:
case KErrInUse:
errorString = QCoreApplication::tr("%1: out of resources", "QSystemSemaphore").arg(function);
@@ -77,22 +80,21 @@ void QSystemSemaphorePrivate::setErrorString(const QString &function, int err)
case KErrPermissionDenied:
errorString = QCoreApplication::tr("%1: permission denied", "QSystemSemaphore").arg(function);
error = QSystemSemaphore::PermissionDenied;
- break;
-default:
- errorString = QCoreApplication::tr("%1: unknown error %2", "QSystemSemaphore").arg(function).arg(err);
- error = QSystemSemaphore::UnknownError;
- }
-
-#if defined QSYSTEMSEMAPHORE_DEBUG
+ break;
+ default:
+ errorString = QCoreApplication::tr("%1: unknown error %2", "QSystemSemaphore").arg(function).arg(err);
+ error = QSystemSemaphore::UnknownError;
+#ifdef QSYSTEMSEMAPHORE_DEBUG
qDebug() << errorString << "key" << key;
#endif
+ break;
+ }
}
int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
{
- if (semaphore.Handle()) {
+ if (semaphore.Handle())
return semaphore.Handle();
- }
// don't allow making handles on empty keys
if (key.isEmpty())
@@ -106,12 +108,13 @@ int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
while (err != KErrNoMemory && err != KErrNone && tryCount-- >= 0) {
err = semaphore.CreateGlobal(name, initialValue, EOwnerProcess);
if (err != KErrNoMemory && err != KErrNone)
- err = semaphore.OpenGlobal(name,EOwnerProcess);
+ err = semaphore.OpenGlobal(name, EOwnerProcess);
}
- if (err){
- setErrorString(QLatin1String("QSystemSemaphore::handle"),err);
+ if (err) {
+ setErrorString(QLatin1String("QSystemSemaphore::handle"), err);
return 0;
}
+
return semaphore.Handle();
}
@@ -125,14 +128,14 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
if (0 == handle())
return false;
- if (count > 0) {
+ if (count > 0)
semaphore.Signal(count);
- } else {
+ else
semaphore.Wait();
- }
+
return true;
}
-#endif //QT_NO_SYSTEMSEMAPHORE
-
QT_END_NAMESPACE
+
+#endif // QT_NO_SYSTEMSEMAPHORE
diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp
index 5e533e7f0e..704afaf1e4 100644
--- a/src/corelib/kernel/qsystemsemaphore_unix.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp
@@ -42,9 +42,9 @@
#include "qsystemsemaphore.h"
#include "qsystemsemaphore_p.h"
+#include <qcoreapplication.h>
#include <qdebug.h>
#include <qfile.h>
-#include <qcoreapplication.h>
#ifndef QT_NO_SYSTEMSEMAPHORE
@@ -62,11 +62,13 @@
#define EIDRM EINVAL
#endif
+//#define QSYSTEMSEMAPHORE_DEBUG
+
QT_BEGIN_NAMESPACE
QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
- semaphore(-1), createdFile(false),
- createdSemaphore(false), unix_key(-1), error(QSystemSemaphore::NoError)
+ unix_key(-1), semaphore(-1), createdFile(false),
+ createdSemaphore(false), error(QSystemSemaphore::NoError)
{
}
@@ -95,33 +97,33 @@ void QSystemSemaphorePrivate::setErrorString(const QString &function)
default:
errorString = QCoreApplication::translate("QSystemSemaphore", "%1: unknown error %2").arg(function).arg(errno);
error = QSystemSemaphore::UnknownError;
-#if defined QSYSTEMSEMAPHORE_DEBUG
+#ifdef QSYSTEMSEMAPHORE_DEBUG
qDebug() << errorString << "key" << key << "errno" << errno << EINVAL;
#endif
+ break;
}
}
/*!
\internal
- Setup unix_key
- */
+ Initialise the semaphore
+*/
key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
{
- if (key.isEmpty()){
- errorString = QCoreApplication::tr("%1: key is empty", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
+ if (-1 != unix_key)
+ return unix_key;
+
+ if (key.isEmpty()) {
+ errorString = QCoreApplication::tr("%1: key is empty", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle"));
error = QSystemSemaphore::KeyError;
return -1;
}
// ftok requires that an actual file exists somewhere
- if (-1 != unix_key)
- return unix_key;
-
- // Create the file needed for ftok
int built = QSharedMemoryPrivate::createUnixKeyFile(fileName);
if (-1 == built) {
- errorString = QCoreApplication::tr("%1: unable to make key", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
+ errorString = QCoreApplication::tr("%1: unable to make key", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle"));
error = QSystemSemaphore::KeyError;
return -1;
}
@@ -130,7 +132,7 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
// Get the unix key for the created file
unix_key = ftok(QFile::encodeName(fileName).constData(), 'Q');
if (-1 == unix_key) {
- errorString = QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
+ errorString = QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle"));
error = QSystemSemaphore::KeyError;
return -1;
}
@@ -145,17 +147,16 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
cleanHandle();
return -1;
}
+ if (mode == QSystemSemaphore::Create) {
+ createdSemaphore = true;
+ createdFile = true;
+ }
} else {
createdSemaphore = true;
// Force cleanup of file, it is possible that it can be left over from a crash
createdFile = true;
}
- if (mode == QSystemSemaphore::Create) {
- createdSemaphore = true;
- createdFile = true;
- }
-
// Created semaphore so initialize its value.
if (createdSemaphore && initialValue >= 0) {
qt_semun init_op;
@@ -173,8 +174,8 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
/*!
\internal
- Cleanup the unix_key
- */
+ Clean up the semaphore
+*/
void QSystemSemaphorePrivate::cleanHandle()
{
unix_key = -1;
@@ -189,8 +190,8 @@ void QSystemSemaphorePrivate::cleanHandle()
if (-1 != semaphore) {
if (-1 == semctl(semaphore, 0, IPC_RMID, 0)) {
setErrorString(QLatin1String("QSystemSemaphore::cleanHandle"));
-#if defined QSYSTEMSEMAPHORE_DEBUG
- qDebug() << QLatin1String("QSystemSemaphore::cleanHandle semctl failed.");
+#ifdef QSYSTEMSEMAPHORE_DEBUG
+ qDebug("QSystemSemaphore::cleanHandle semctl failed.");
#endif
}
semaphore = -1;
@@ -201,7 +202,7 @@ void QSystemSemaphorePrivate::cleanHandle()
/*!
\internal
- */
+*/
bool QSystemSemaphorePrivate::modifySemaphore(int count)
{
if (-1 == handle())
@@ -223,7 +224,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return modifySemaphore(count);
}
setErrorString(QLatin1String("QSystemSemaphore::modifySemaphore"));
-#if defined QSYSTEMSEMAPHORE_DEBUG
+#ifdef QSYSTEMSEMAPHORE_DEBUG
qDebug() << QLatin1String("QSystemSemaphore::modify failed") << count << semctl(semaphore, 0, GETVAL) << errno << EIDRM << EINVAL;
#endif
return false;
@@ -232,7 +233,6 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return true;
}
-
QT_END_NAMESPACE
#endif // QT_NO_SYSTEMSEMAPHORE
diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp
index 30cab7ebfe..0e9d645edd 100644
--- a/src/corelib/kernel/qsystemsemaphore_win.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_win.cpp
@@ -44,18 +44,20 @@
#include "qcoreapplication.h"
#include <qdebug.h>
-QT_BEGIN_NAMESPACE
-
#ifndef QT_NO_SYSTEMSEMAPHORE
+//#define QSYSTEMSEMAPHORE_DEBUG
+
+QT_BEGIN_NAMESPACE
+
QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
- semaphore(0), error(QSystemSemaphore::NoError)
+ semaphore(0), error(QSystemSemaphore::NoError)
{
}
void QSystemSemaphorePrivate::setErrorString(const QString &function)
{
- BOOL windowsError = GetLastError();
+ DWORD windowsError = GetLastError();
if (windowsError == 0)
return;
@@ -72,9 +74,10 @@ void QSystemSemaphorePrivate::setErrorString(const QString &function)
default:
errorString = QCoreApplication::translate("QSystemSemaphore", "%1: unknown error %2").arg(function).arg(windowsError);
error = QSystemSemaphore::UnknownError;
-#if defined QSYSTEMSEMAPHORE_DEBUG
+#ifdef QSYSTEMSEMAPHORE_DEBUG
qDebug() << errorString << "key" << key;
#endif
+ break;
}
}
@@ -110,7 +113,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return false;
if (count > 0) {
- if (0 == ReleaseSemaphore(semaphore, count, 0)) {
+ if (0 == ReleaseSemaphore(semaphore, count, 0)) {
setErrorString(QLatin1String("QSystemSemaphore::modifySemaphore"));
#if defined QSYSTEMSEMAPHORE_DEBUG
qDebug() << QLatin1String("QSystemSemaphore::modifySemaphore ReleaseSemaphore failed");
@@ -130,6 +133,6 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return true;
}
-#endif //QT_NO_SYSTEMSEMAPHORE
+#endif // QT_NO_SYSTEMSEMAPHORE
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 3c8704c84a..0edcb3b3ac 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -205,6 +205,9 @@ QTimer::~QTimer()
Starts or restarts the timer with the timeout specified in \l interval.
+ If the timer is already running, it will be
+ \l{QTimer::stop()}{stopped} and restarted.
+
If \l singleShot is true, the timer will be activated only once.
*/
void QTimer::start()
@@ -218,6 +221,12 @@ void QTimer::start()
/*!
Starts or restarts the timer with a timeout interval of \a msec
milliseconds.
+
+ If the timer is already running, it will be
+ \l{QTimer::stop()}{stopped} and restarted.
+
+ If \l singleShot is true, the timer will be activated only once.
+
*/
void QTimer::start(int msec)
{
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 4504eabba0..d2554229e2 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -600,7 +600,7 @@ static QString find_translation(const QLocale & locale,
/*!
\since 4.8
- Loads \a filename + \a prefix + \a \l{QLocale::uiLanguages()}{ui language
+ Loads \a filename + \a prefix + \l{QLocale::uiLanguages()}{ui language
name} + \a suffix (".qm" if the \a suffix is not specified), which may be
an absolute file name or relative to \a directory. Returns true if the
translation is successfully loaded; otherwise returns false.
@@ -618,7 +618,7 @@ static QString find_translation(const QLocale & locale,
\endlist
For example, an application running in the locale with the following
- l{QLocale::uiLanguages()}{ui languages} - "es", "fr-CA", "de" might call
+ \l{QLocale::uiLanguages()}{ui languages} - "es", "fr-CA", "de" might call
load(QLocale::system(), "foo", ".", "/opt/foolib", ".qm"). load() would
replace '-' (dash) with '_' (underscore) in the ui language and then try to
open the first existing readable file from this list:
@@ -637,8 +637,8 @@ static QString find_translation(const QLocale & locale,
\o \c /opt/foolib/foo
\endlist
- For OSs where file system is case sensitive, QTranslator also tries to load
- a lower-cased version of the locale name.
+ On operating systems where file system is case sensitive, QTranslator also
+ tries to load a lower-cased version of the locale name.
*/
bool QTranslator::load(const QLocale & locale,
const QString & filename,
diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp
index 03ab047922..49fb46b0f4 100644
--- a/src/corelib/thread/qmutexpool.cpp
+++ b/src/corelib/thread/qmutexpool.cpp
@@ -123,7 +123,8 @@ QMutexPool *QMutexPool::instance()
return globalMutexPool();
}
-/*! \fn QMutexPool::get(void *address)
+/*!
+ \fn QMutexPool::get(const void *address)
Returns a QMutex from the pool. QMutexPool uses the value \a address
to determine which mutex is returned from the pool.
*/
diff --git a/src/corelib/thread/qthread_symbian.cpp b/src/corelib/thread/qthread_symbian.cpp
index c515ae6d17..46339a69eb 100644
--- a/src/corelib/thread/qthread_symbian.cpp
+++ b/src/corelib/thread/qthread_symbian.cpp
@@ -335,7 +335,15 @@ void *QThreadPrivate::start(void *arg)
createEventDispatcher(data);
emit thr->started();
- thr->run();
+ TRAPD(err, {
+ try {
+ thr->run();
+ } catch (const std::exception& ex) {
+ qWarning("QThreadPrivate::start: Thread exited on exception %s", ex.what());
+ }
+ });
+ if (err)
+ qWarning("QThreadPrivate::start: Thread exited on leave %d", err);
QThreadPrivate::finish(arg);
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 4303731e40..a6fee43e97 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -75,6 +75,7 @@
#if defined(Q_OS_SYMBIAN)
#include <e32std.h>
+#include <tz.h>
#endif
QT_BEGIN_NAMESPACE
@@ -4029,23 +4030,32 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time)
#elif defined(Q_OS_SYMBIAN)
// months and days are zero index based
_LIT(KUnixEpoch, "19700000:000000.000000");
- TTimeIntervalSeconds utcOffset = User::UTCOffset();
TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC);
TTime epochTTime;
TInt err = epochTTime.Set(KUnixEpoch);
tm res;
if(err == KErrNone) {
TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
- utcTTime = utcTTime + utcOffset;
- TDateTime utcDateTime = utcTTime.DateTime();
- res.tm_sec = utcDateTime.Second();
- res.tm_min = utcDateTime.Minute();
- res.tm_hour = utcDateTime.Hour();
- res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct
- res.tm_mon = utcDateTime.Month();
- res.tm_year = utcDateTime.Year() - 1900;
- res.tm_isdst = 0;
- brokenDown = &res;
+ TRAP(err,
+ RTz tz;
+ User::LeaveIfError(tz.Connect());
+ CleanupClosePushL(tz);
+ res.tm_isdst = tz.IsDaylightSavingOnL(*tz.GetTimeZoneIdL(),utcTTime);
+ User::LeaveIfError(tz.ConvertToLocalTime(utcTTime));
+ CleanupStack::PopAndDestroy(&tz));
+ if (KErrNone == err) {
+ TDateTime localDateTime = utcTTime.DateTime();
+ res.tm_sec = localDateTime.Second();
+ res.tm_min = localDateTime.Minute();
+ res.tm_hour = localDateTime.Hour();
+ res.tm_mday = localDateTime.Day() + 1; // non-zero based index for tm struct
+ res.tm_mon = localDateTime.Month();
+ res.tm_year = localDateTime.Year() - 1900;
+ // Symbian's timezone server doesn't know how to handle DST before year 1997
+ if (res.tm_year < 97)
+ res.tm_isdst = -1;
+ brokenDown = &res;
+ }
}
#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant version of localtime() where available
@@ -4120,23 +4130,27 @@ static void localToUtc(QDate &date, QTime &time, int isdst)
#elif defined(Q_OS_SYMBIAN)
// months and days are zero index based
_LIT(KUnixEpoch, "19700000:000000.000000");
- TTimeIntervalSeconds utcOffset = TTimeIntervalSeconds(0 - User::UTCOffset().Int());
TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC);
TTime epochTTime;
TInt err = epochTTime.Set(KUnixEpoch);
tm res;
if(err == KErrNone) {
- TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
- utcTTime = utcTTime + utcOffset;
- TDateTime utcDateTime = utcTTime.DateTime();
- res.tm_sec = utcDateTime.Second();
- res.tm_min = utcDateTime.Minute();
- res.tm_hour = utcDateTime.Hour();
- res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct
- res.tm_mon = utcDateTime.Month();
- res.tm_year = utcDateTime.Year() - 1900;
- res.tm_isdst = (int)isdst;
- brokenDown = &res;
+ TTime localTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
+ RTz tz;
+ if (KErrNone == tz.Connect()) {
+ if (KErrNone == tz.ConvertToUniversalTime(localTTime)) {
+ TDateTime utcDateTime = localTTime.DateTime();
+ res.tm_sec = utcDateTime.Second();
+ res.tm_min = utcDateTime.Minute();
+ res.tm_hour = utcDateTime.Hour();
+ res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct
+ res.tm_mon = utcDateTime.Month();
+ res.tm_year = utcDateTime.Year() - 1900;
+ res.tm_isdst = (int)isdst;
+ brokenDown = &res;
+ }
+ tz.Close();
+ }
}
#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant version of gmtime() where available
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 1c1d684e96..36a9c600cb 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -590,10 +590,10 @@ void **QListData::erase(void **xi)
\sa operator=()
*/
-/*! \fn QList::QList(std::initializer_list<T> args)
+/*! \fn inline QList::QList(std::initializer_list<T> args)
\since 4.8
- Construct a list from a std::initilizer_list.
+ Construct a list from the std::initializer_list specified by \a args.
This constructor is only enabled if the compiler supports C++0x
*/
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index cde93d6e43..ca8cc8a578 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -76,7 +76,6 @@ QT_BEGIN_NAMESPACE
#if defined(Q_OS_SYMBIAN)
void qt_symbianUpdateSystemPrivate();
-void qt_symbianInitSystemLocale();
#endif
#ifndef QT_NO_SYSTEMLOCALE
@@ -470,9 +469,6 @@ static const QSystemLocale *systemLocale()
{
if (_systemLocale)
return _systemLocale;
-#if defined(Q_OS_SYMBIAN)
- qt_symbianInitSystemLocale();
-#endif
return QSystemLocale_globalSystemLocale();
}
@@ -937,7 +933,7 @@ QLocale::Country QLocale::country() const
name() will not contain it for compatibility reasons. Use bcp47Name() instead
if you need a full locale name.
- \sa QLocale(const QString &), language(), script(), country(), bcp47Name()
+ \sa QLocale(), language(), script(), country(), bcp47Name()
*/
QString QLocale::name() const
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index 34e4fb3f12..fd139c3bec 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -769,6 +769,8 @@
\value Weekdays a QList<Qt::DayOfWeek> specifying the regular weekdays
\value LocaleChanged this type is queried whenever the system locale is changed.
\value ListToSeparatedString a string that represents a join of a given QStringList with a locale-defined separator.
+ \value NativeLanguageName a string that represents the name of the native language.
+ \value NativeCountryName a string that represents the name of the native country.
*/
/*!
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index a4f6cc8458..cdf0ab1f37 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -50,6 +50,7 @@
#include <e32const.h>
#include <e32base.h>
#include <e32property.h>
+#include <numberconversion.h>
#include <bacntf.h>
#include "private/qcore_symbian_p.h"
#include "private/qcoreapplication_p.h"
@@ -60,27 +61,6 @@ QT_BEGIN_NAMESPACE
static TExtendedLocale _s60Locale;
-// Type definitions for runtime resolved function pointers
-typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&);
-typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&);
-
-// Runtime resolved functions
-static FormatFunc ptrTimeFormatL = NULL;
-static FormatSpecFunc ptrGetTimeFormatSpec = NULL;
-static FormatSpecFunc ptrGetLongDateFormatSpec = NULL;
-static FormatSpecFunc ptrGetShortDateFormatSpec = NULL;
-
-// Default functions if functions cannot be resolved
-static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&)
-{
- des.Zero();
-}
-
-static TPtrC defaultFormatSpec(TExtendedLocale&)
-{
- return TPtrC(KNullDesC);
-}
-
/*
Definition of struct for mapping Symbian to ISO locale
*/
@@ -699,9 +679,9 @@ static QString symbianDateFormat(bool short_format)
TPtrC dateFormat;
if (short_format) {
- dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ dateFormat.Set(_s60Locale.GetShortDateFormatSpec());
} else {
- dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ dateFormat.Set(_s60Locale.GetLongDateFormatSpec());
}
return s60ToQtFormat(qt_TDesC2QString(dateFormat));
@@ -713,7 +693,7 @@ static QString symbianDateFormat(bool short_format)
*/
static QString symbianTimeFormat()
{
- return s60ToQtFormat(qt_TDesC2QString(ptrGetTimeFormatSpec(_s60Locale)));
+ return s60ToQtFormat(qt_TDesC2QString(_s60Locale.GetTimeFormatSpec()));
}
/*!
@@ -737,17 +717,20 @@ static QString symbianDateToString(const QDate &date, bool short_format)
TPtrC dateFormat;
if (short_format) {
- dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ dateFormat.Set(_s60Locale.GetShortDateFormatSpec());
} else {
- dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ dateFormat.Set(_s60Locale.GetLongDateFormatSpec());
}
- TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());)
+ TLocale *formatLocale = _s60Locale.GetLocale();
+ TRAPD(err, timeStr.FormatL(buffer, dateFormat, *formatLocale);)
- if (err == KErrNone)
+ if (err == KErrNone) {
+ NumberConversion::ConvertDigits(buffer, formatLocale->DigitType());
return qt_TDes2QString(buffer);
- else
+ } else {
return QString();
+ }
}
/*!
@@ -767,17 +750,15 @@ static QString symbianTimeToString(const QTime &time)
TTime timeStr(dateTime);
TBuf<KMaxTimeFormatSpec*2> buffer;
- TRAPD(err, ptrTimeFormatL(
- timeStr,
- buffer,
- ptrGetTimeFormatSpec(_s60Locale),
- *_s60Locale.GetLocale());
- )
+ TLocale *formatLocale = _s60Locale.GetLocale();
+ TRAPD(err, timeStr.FormatL(buffer, _s60Locale.GetTimeFormatSpec(), *formatLocale);)
- if (err == KErrNone)
+ if (err == KErrNone) {
+ NumberConversion::ConvertDigits(buffer, formatLocale->DigitType());
return qt_TDes2QString(buffer);
- else
+ } else {
return QString();
+ }
}
/*!
@@ -802,37 +783,6 @@ void qt_symbianUpdateSystemPrivate()
_s60Locale.LoadSystemSettings();
}
-void qt_symbianInitSystemLocale()
-{
- static QBasicAtomicInt initDone = Q_BASIC_ATOMIC_INITIALIZER(0);
- if (initDone == 2)
- return;
- if (initDone.testAndSetRelaxed(0, 1)) {
- // Initialize platform version dependent function pointers
- ptrTimeFormatL = reinterpret_cast<FormatFunc>
- (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL));
- ptrGetTimeFormatSpec = reinterpret_cast<FormatSpecFunc>
- (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec));
- ptrGetLongDateFormatSpec = reinterpret_cast<FormatSpecFunc>
- (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec));
- ptrGetShortDateFormatSpec = reinterpret_cast<FormatSpecFunc>
- (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec));
- if (!ptrTimeFormatL)
- ptrTimeFormatL = &defaultTimeFormatL;
- if (!ptrGetTimeFormatSpec)
- ptrGetTimeFormatSpec = &defaultFormatSpec;
- if (!ptrGetLongDateFormatSpec)
- ptrGetLongDateFormatSpec = &defaultFormatSpec;
- if (!ptrGetShortDateFormatSpec)
- ptrGetShortDateFormatSpec = &defaultFormatSpec;
- bool ret = initDone.testAndSetRelease(1, 2);
- Q_ASSERT(ret);
- Q_UNUSED(ret);
- }
- while(initDone != 2)
- QThread::yieldCurrentThread();
-}
-
QLocale QSystemLocale::fallbackLocale() const
{
TLanguage lang = User::Language();
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 8ce6b57969..9277a3ebbf 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -252,10 +252,9 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QScopedArrayPointer::QScopedArrayPointer(T *p = 0)
+ \fn QScopedArrayPointer::QScopedArrayPointer()
- Constructs this QScopedArrayPointer instance and sets its pointer
- to \a p.
+ Constructs a QScopedArrayPointer instance.
*/
/*!
diff --git a/src/corelib/tools/qscopedvaluerollback.cpp b/src/corelib/tools/qscopedvaluerollback.cpp
index a9bbdb3f39..1ad47f45dd 100644
--- a/src/corelib/tools/qscopedvaluerollback.cpp
+++ b/src/corelib/tools/qscopedvaluerollback.cpp
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QScopedValueRollback
- \brief The QScopedValueRollback resets a variable to its previous value on destruction
+ \brief The QScopedValueRollback class resets a variable to its previous value on destruction.
\since 4.8
\ingroup misc
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QScopedValueRollback::QScopedValueRollback(T &var)
- Stores the previous value of var internally, for revert on destruction.
+ Stores the previous value of \a var internally, for revert on destruction.
*/
/*!
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 8ad4e70b1e..f8f4bdc97f 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -837,6 +837,25 @@ int QString::grow(int size)
\sa QString::const_iterator
*/
+/*!
+ \typedef QString::const_reference
+
+ The QString::const_reference typedef provides an STL-style
+ const reference for QString.
+*/
+/*!
+ \typedef QString::reference
+
+ The QString::const_reference typedef provides an STL-style
+ reference for QString.
+*/
+/*!
+ \typedef QString::value_type
+
+ The QString::const_reference typedef provides an STL-style
+ value type for QString.
+*/
+
/*! \fn QString::iterator QString::begin()
Returns an \l{STL-style iterator} pointing to the first character in
@@ -3556,6 +3575,38 @@ bool QString::endsWith(const QChar &c, Qt::CaseSensitivity cs) const
Use toLocal8Bit() instead.
*/
+#if defined(QT_ALWAYS_HAVE_SSE2)
+static inline __m128i mergeQuestionMarks(__m128i chunk)
+{
+ const __m128i questionMark = _mm_set1_epi16('?');
+
+ // SSE has no compare instruction for unsigned comparison.
+ // The variables must be shiffted + 0x8000 to be compared
+ const __m128i signedBitOffset = _mm_set1_epi16(0x8000);
+ const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000);
+
+ const __m128i signedChunk = _mm_add_epi16(chunk, signedBitOffset);
+ const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);
+
+# ifdef __SSE4_1__
+ // replace the non-Latin 1 characters in the chunk with question marks
+ chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask);
+# else
+ // offLimitQuestionMark contains '?' for each 16 bits that was off-limit
+ // the 16 bits that were correct contains zeros
+ const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark);
+
+ // correctBytes contains the bytes that were in limit
+ // the 16 bits that were off limits contains zeros
+ const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk);
+
+ // merge offLimitQuestionMark and correctBytes to have the result
+ chunk = _mm_or_si128(correctBytes, offLimitQuestionMark);
+# endif
+ return chunk;
+}
+#endif
+
static QByteArray toLatin1_helper(const QChar *data, int length)
{
QByteArray ba;
@@ -3566,41 +3617,15 @@ static QByteArray toLatin1_helper(const QChar *data, int length)
#if defined(QT_ALWAYS_HAVE_SSE2)
if (length >= 16) {
const int chunkCount = length >> 4; // divided by 16
- const __m128i questionMark = _mm_set1_epi16('?');
- // SSE has no compare instruction for unsigned comparison.
- // The variables must be shiffted + 0x8000 to be compared
- const __m128i signedBitOffset = _mm_set1_epi16(0x8000);
- const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000);
+
for (int i = 0; i < chunkCount; ++i) {
__m128i chunk1 = _mm_loadu_si128((__m128i*)src); // load
+ chunk1 = mergeQuestionMarks(chunk1);
src += 8;
- {
- // each 16 bit is equal to 0xFF if the source is outside latin 1 (>0xff)
- const __m128i signedChunk = _mm_add_epi16(chunk1, signedBitOffset);
- const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);
-
- // offLimitQuestionMark contains '?' for each 16 bits that was off-limit
- // the 16 bits that were correct contains zeros
- const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark);
-
- // correctBytes contains the bytes that were in limit
- // the 16 bits that were off limits contains zeros
- const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk1);
-
- // merge offLimitQuestionMark and correctBytes to have the result
- chunk1 = _mm_or_si128(correctBytes, offLimitQuestionMark);
- }
__m128i chunk2 = _mm_loadu_si128((__m128i*)src); // load
+ chunk2 = mergeQuestionMarks(chunk2);
src += 8;
- {
- // exactly the same operations as for the previous chunk of data
- const __m128i signedChunk = _mm_add_epi16(chunk2, signedBitOffset);
- const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);
- const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark);
- const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk2);
- chunk2 = _mm_or_si128(correctBytes, offLimitQuestionMark);
- }
// pack the two vector to 16 x 8bits elements
const __m128i result = _mm_packus_epi16(chunk1, chunk2);
@@ -9111,7 +9136,7 @@ QByteArray QStringRef::toUtf8() const
UCS-4 is a Unicode codec and is lossless. All characters from this string
can be encoded in UCS-4.
- \sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray()
+ \sa toAscii(), toLatin1(), toLocal8Bit(), QTextCodec
*/
QVector<uint> QStringRef::toUcs4() const
{
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index fb067369b1..45de6bc1c3 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -142,7 +142,8 @@ QT_BEGIN_NAMESPACE
characters.
*/
-/*! \fn QStringBuilder::operator QString() const
+/*!
+ \fn operator QStringBuilder::QString() const
Converts the \c QLatin1Literal into a \c QString object.
*/
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 5997574693..8b47137fd8 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -683,7 +683,7 @@ int QtPrivate::QStringList_removeDuplicates(QStringList *that)
/*! \fn QStringList::QStringList(std::initializer_list<QString> args)
\since 4.8
- Construct a list from a std::initilizer_list.
+ Construct a list from a std::initializer_list given by \a args.
This constructor is only enabled if the compiler supports C++0x
*/
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index b2dc7d6396..b1d7a1a5b1 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -337,6 +337,20 @@
Typedef for const T &. Provided for STL compatibility.
*/
+/*!
+ \typedef QVarLengthArray::const_iterator
+ \since 4.7
+
+ Typedef for const T *. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::iterator
+ \since 4.7
+
+ Typedef for T *. Provided for STL compatibility.
+*/
+
/*! \fn void QVarLengthArray::prepend(const T &value)
\since 4.8
@@ -501,7 +515,7 @@
\relates QVarLengthArray
\since 4.8
- Returns true if the two array are equal;
+ Returns true if the two arrays, specified by \a left and \a right, are equal.
Two arrays are considered equal if they contain the same values
in the same order.
@@ -516,7 +530,7 @@
\relates QVarLengthArray
\since 4.8
- Returns true if the two array are different;
+ Returns true if the two arrays, specified by \a left and \a right, are \e not equal.
Two arrays are considered equal if they contain the same values
in the same order.
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 8c4dd06981..98a2412347 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -277,7 +277,7 @@ int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive
/*! \fn QVector::QVector(std::initializer_list<T> args)
\since 4.8
- Construct a vector from a std::initilizer_list.
+ Construct a vector from the std::initilizer_list given by \a args.
This constructor is only enabled if the compiler supports C++0x
*/
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 0c2cf1619e..3dfce4bc00 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -122,3 +122,8 @@ INCLUDEPATH += ../3rdparty/md5 \
# Note: libm should be present by default becaue this is C++
!macx-icc:!vxworks:!symbian:unix:LIBS_PRIVATE += -lm
+symbian {
+ # QLocale Symbian implementation needs this
+ LIBS += -lnumberconversion
+}
+
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 19626af1cf..caaffd321d 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -646,6 +646,11 @@ QXmlStreamReader::TokenType QXmlStreamReader::tokenType() const
parser has reached the end element, the current element becomes the parent
element.
+ You can traverse a document by repeatedly calling this function while
+ ensuring that the stream reader is not at the end of the document:
+
+ \snippet doc/src/snippets/xml/streamreader/traverse.cpp traverse document
+
This is a convenience function for when you're only concerned with parsing
XML elements. The \l{QXmlStream Bookmarks Example} makes extensive use of
this function.
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 6628ca3645..58c1caa5dc 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -234,10 +234,11 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP
/*!
\since 4.8
- \enum QDBusConnection::ConnectionCapabilities
- The available capabilities for a D-Bus connection.
+ \enum QDBusConnection::ConnectionCapability
- \value UnixFileDescriptorPassing passing of Unix file descriptors to other processes
+ This enum describes the available capabilities for a D-Bus connection.
+
+ \value UnixFileDescriptorPassing enables passing of Unix file descriptors to other processes
(see QDBusUnixFileDescriptor)
\sa connectionCapabilities()
diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp
index 75a99b4a6c..86d2b3c92e 100644
--- a/src/dbus/qdbusunixfiledescriptor.cpp
+++ b/src/dbus/qdbusunixfiledescriptor.cpp
@@ -99,7 +99,17 @@ QT_BEGIN_NAMESPACE
invalid state and QDBusUnixFileDescriptor::isSupported() will return
false.
- \sa QDBusConnection::ConnectionCapabilities, QDBusConnection::connectionCapabilities
+ \sa QDBusConnection::ConnectionCapabilities, QDBusConnection::connectionCapabilities()
+*/
+
+/*!
+ \typedef QDBusUnixFileDescriptor::Data
+ \internal
+*/
+
+/*!
+ \variable QDBusUnixFileDescriptor::d
+ \internal
*/
class QDBusUnixFileDescriptorPrivate : public QSharedData {
@@ -122,7 +132,7 @@ QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate>::~QExplicitlyShared
This is equivalent to constructing the object with an invalid file
descriptor (like -1).
- \sa fileDescriptor, isValid
+ \sa fileDescriptor(), isValid()
*/
QDBusUnixFileDescriptor::QDBusUnixFileDescriptor()
: d(0)
@@ -140,7 +150,7 @@ QDBusUnixFileDescriptor::QDBusUnixFileDescriptor()
If the \a fileDescriptor parameter is not valid, isValid() will return
false and fileDescriptor() will return -1.
- \sa setFileDescriptor, fileDescriptor
+ \sa setFileDescriptor(), fileDescriptor()
*/
QDBusUnixFileDescriptor::QDBusUnixFileDescriptor(int fileDescriptor)
: d(0)
@@ -227,7 +237,7 @@ bool QDBusUnixFileDescriptor::isSupported()
/*!
Sets the file descriptor that this QDBusUnixFileDescriptor object holds
- to a copy of \a fileDescriptor.T he original file descriptor is not
+ to a copy of \a fileDescriptor. The original file descriptor is not
touched and must be closed by the user.
Note that the value returned by fileDescriptor() will be different from
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri
index 044db3c756..3134c79d98 100644
--- a/src/declarative/debugger/debugger.pri
+++ b/src/declarative/debugger/debugger.pri
@@ -9,7 +9,7 @@ SOURCES += \
$$PWD/qdeclarativedebugtrace.cpp \
$$PWD/qdeclarativedebughelper.cpp \
$$PWD/qdeclarativedebugserver.cpp \
- $$PWD/qdeclarativeobserverservice.cpp \
+ $$PWD/qdeclarativeinspectorservice.cpp \
$$PWD/qjsdebuggeragent.cpp \
$$PWD/qjsdebugservice.cpp
@@ -24,7 +24,7 @@ HEADERS += \
$$PWD/qdeclarativedebughelper_p.h \
$$PWD/qdeclarativedebugserver_p.h \
$$PWD/qdeclarativedebugserverconnection_p.h \
- $$PWD/qdeclarativeobserverservice_p.h \
- $$PWD/qdeclarativeobserverinterface_p.h \
+ $$PWD/qdeclarativeinspectorservice_p.h \
+ $$PWD/qdeclarativeinspectorinterface_p.h \
$$PWD/qjsdebuggeragent_p.h \
$$PWD/qjsdebugservice_p.h
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp
index 32c2b47439..620ee1d66a 100644
--- a/src/declarative/debugger/qdeclarativedebug.cpp
+++ b/src/declarative/debugger/qdeclarativedebug.cpp
@@ -638,14 +638,15 @@ QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult
bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName,
const QVariant &bindingExpression,
- bool isLiteralValue)
+ bool isLiteralValue,
+ QString source, int line)
{
Q_D(QDeclarativeEngineDebug);
if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue;
+ ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line;
d->client->sendMessage(message);
return true;
} else {
diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h
index ae92d6ae28..f822637eb4 100644
--- a/src/declarative/debugger/qdeclarativedebug_p.h
+++ b/src/declarative/debugger/qdeclarativedebug_p.h
@@ -101,7 +101,8 @@ public:
const QString &expr,
QObject *parent = 0);
bool setBindingForObject(int objectDebugId, const QString &propertyName,
- const QVariant &bindingExpression, bool isLiteralValue);
+ const QVariant &bindingExpression, bool isLiteralValue,
+ QString source = QString(), int line = -1);
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody);
diff --git a/src/declarative/debugger/qdeclarativeinspectorinterface_p.h b/src/declarative/debugger/qdeclarativeinspectorinterface_p.h
new file mode 100644
index 0000000000..aa29d6807e
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeinspectorinterface_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEOBSERVERINTERFACE_H
+#define QDECLARATIVEOBSERVERINTERFACE_H
+
+#include <QtDeclarative/private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_EXPORT QDeclarativeInspectorInterface
+{
+public:
+ QDeclarativeInspectorInterface() {}
+ virtual ~QDeclarativeInspectorInterface() {}
+
+ virtual void activate() = 0;
+ virtual void deactivate() = 0;
+};
+
+Q_DECLARE_INTERFACE(QDeclarativeInspectorInterface, "com.trolltech.Qt.QDeclarativeInspectorInterface/1.0")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEOBSERVERINTERFACE_H
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
new file mode 100644
index 0000000000..9fec006f56
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeinspectorservice_p.h"
+#include "private/qdeclarativeinspectorinterface_p.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+#include <QtCore/QDir>
+#include <QtCore/QPluginLoader>
+
+#include <QtDeclarative/QDeclarativeView>
+
+QT_BEGIN_NAMESPACE
+
+Q_GLOBAL_STATIC(QDeclarativeInspectorService, serviceInstance)
+
+QDeclarativeInspectorService::QDeclarativeInspectorService()
+ : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode"))
+ , m_inspectorPlugin(0)
+{
+}
+
+QDeclarativeInspectorService *QDeclarativeInspectorService::instance()
+{
+ return serviceInstance();
+}
+
+void QDeclarativeInspectorService::addView(QDeclarativeView *view)
+{
+ m_views.append(view);
+}
+
+void QDeclarativeInspectorService::removeView(QDeclarativeView *view)
+{
+ m_views.removeAll(view);
+}
+
+void QDeclarativeInspectorService::sendMessage(const QByteArray &message)
+{
+ if (status() != Enabled)
+ return;
+
+ QDeclarativeDebugService::sendMessage(message);
+}
+
+void QDeclarativeInspectorService::statusChanged(Status status)
+{
+ if (m_views.isEmpty())
+ return;
+
+ if (status == Enabled) {
+ if (!m_inspectorPlugin)
+ m_inspectorPlugin = loadInspectorPlugin();
+
+ if (!m_inspectorPlugin) {
+ qWarning() << "Error while loading inspector plugin";
+ return;
+ }
+
+ m_inspectorPlugin->activate();
+ } else {
+ if (m_inspectorPlugin)
+ m_inspectorPlugin->deactivate();
+ }
+}
+
+void QDeclarativeInspectorService::messageReceived(const QByteArray &message)
+{
+ emit gotMessage(message);
+}
+
+QDeclarativeInspectorInterface *QDeclarativeInspectorService::loadInspectorPlugin()
+{
+ QStringList pluginCandidates;
+ const QStringList paths = QCoreApplication::libraryPaths();
+ foreach (const QString &libPath, paths) {
+ const QDir dir(libPath + QLatin1String("/qmltooling"));
+ if (dir.exists())
+ foreach (const QString &pluginPath, dir.entryList(QDir::Files))
+ pluginCandidates << dir.absoluteFilePath(pluginPath);
+ }
+
+ foreach (const QString &pluginPath, pluginCandidates) {
+ QPluginLoader loader(pluginPath);
+ if (!loader.load())
+ continue;
+
+ QDeclarativeInspectorInterface *inspector =
+ qobject_cast<QDeclarativeInspectorInterface*>(loader.instance());
+
+ if (inspector)
+ return inspector;
+ loader.unload();
+ }
+ return 0;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice_p.h b/src/declarative/debugger/qdeclarativeinspectorservice_p.h
new file mode 100644
index 0000000000..9fe0d601fa
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeinspectorservice_p.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEOBSERVERSERVICE_H
+#define QDECLARATIVEOBSERVERSERVICE_H
+
+#include "private/qdeclarativedebugservice_p.h"
+#include <private/qdeclarativeglobal_p.h>
+
+#include <QtCore/QList>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeView;
+class QDeclarativeInspectorInterface;
+
+class Q_DECLARATIVE_EXPORT QDeclarativeInspectorService : public QDeclarativeDebugService
+{
+ Q_OBJECT
+
+public:
+ QDeclarativeInspectorService();
+ static QDeclarativeInspectorService *instance();
+
+ void addView(QDeclarativeView *);
+ void removeView(QDeclarativeView *);
+ QList<QDeclarativeView*> views() const { return m_views; }
+
+ void sendMessage(const QByteArray &message);
+
+Q_SIGNALS:
+ void gotMessage(const QByteArray &message);
+
+protected:
+ virtual void statusChanged(Status status);
+ virtual void messageReceived(const QByteArray &);
+
+private:
+ static QDeclarativeInspectorInterface *loadInspectorPlugin();
+
+ QList<QDeclarativeView*> m_views;
+ QDeclarativeInspectorInterface *m_inspectorPlugin;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEOBSERVERSERVICE_H
diff --git a/src/declarative/debugger/qdeclarativeobserverinterface_p.h b/src/declarative/debugger/qdeclarativeobserverinterface_p.h
deleted file mode 100644
index efb47faa05..0000000000
--- a/src/declarative/debugger/qdeclarativeobserverinterface_p.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEOBSERVERINTERFACE_H
-#define QDECLARATIVEOBSERVERINTERFACE_H
-
-#include <QtDeclarative/private/qdeclarativeglobal_p.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class Q_DECLARATIVE_EXPORT QDeclarativeObserverInterface
-{
-public:
- QDeclarativeObserverInterface() {}
- virtual ~QDeclarativeObserverInterface() {}
-
- virtual void activate() = 0;
- virtual void deactivate() = 0;
-};
-
-Q_DECLARE_INTERFACE(QDeclarativeObserverInterface, "com.trolltech.Qt.QDeclarativeObserverInterface/1.0")
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEOBSERVERINTERFACE_H
diff --git a/src/declarative/debugger/qdeclarativeobserverservice.cpp b/src/declarative/debugger/qdeclarativeobserverservice.cpp
deleted file mode 100644
index 43d92813d6..0000000000
--- a/src/declarative/debugger/qdeclarativeobserverservice.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "private/qdeclarativeobserverservice_p.h"
-#include "private/qdeclarativeobserverinterface_p.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDebug>
-#include <QtCore/QDir>
-#include <QtCore/QPluginLoader>
-
-#include <QtDeclarative/QDeclarativeView>
-
-QT_BEGIN_NAMESPACE
-
-Q_GLOBAL_STATIC(QDeclarativeObserverService, serviceInstance)
-
-QDeclarativeObserverService::QDeclarativeObserverService()
- : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode"))
- , m_observer(0)
-{
-}
-
-QDeclarativeObserverService *QDeclarativeObserverService::instance()
-{
- return serviceInstance();
-}
-
-void QDeclarativeObserverService::addView(QDeclarativeView *view)
-{
- m_views.append(view);
-}
-
-void QDeclarativeObserverService::removeView(QDeclarativeView *view)
-{
- m_views.removeAll(view);
-}
-
-void QDeclarativeObserverService::sendMessage(const QByteArray &message)
-{
- if (status() != Enabled)
- return;
-
- QDeclarativeDebugService::sendMessage(message);
-}
-
-void QDeclarativeObserverService::statusChanged(Status status)
-{
- if (m_views.isEmpty())
- return;
-
- if (status == Enabled) {
- if (!m_observer)
- m_observer = loadObserverPlugin();
-
- if (!m_observer) {
- qWarning() << "Error while loading observer plugin";
- return;
- }
-
- m_observer->activate();
- } else {
- if (m_observer)
- m_observer->deactivate();
- }
-}
-
-void QDeclarativeObserverService::messageReceived(const QByteArray &message)
-{
- emit gotMessage(message);
-}
-
-QDeclarativeObserverInterface *QDeclarativeObserverService::loadObserverPlugin()
-{
- QStringList pluginCandidates;
- const QStringList paths = QCoreApplication::libraryPaths();
- foreach (const QString &libPath, paths) {
- const QDir dir(libPath + QLatin1String("/qmltooling"));
- if (dir.exists())
- foreach (const QString &pluginPath, dir.entryList(QDir::Files))
- pluginCandidates << dir.absoluteFilePath(pluginPath);
- }
-
- foreach (const QString &pluginPath, pluginCandidates) {
- QPluginLoader loader(pluginPath);
- if (!loader.load())
- continue;
-
- QDeclarativeObserverInterface *observer =
- qobject_cast<QDeclarativeObserverInterface*>(loader.instance());
-
- if (observer)
- return observer;
- loader.unload();
- }
- return 0;
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativeobserverservice_p.h b/src/declarative/debugger/qdeclarativeobserverservice_p.h
deleted file mode 100644
index c883d4bdd9..0000000000
--- a/src/declarative/debugger/qdeclarativeobserverservice_p.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEOBSERVERSERVICE_H
-#define QDECLARATIVEOBSERVERSERVICE_H
-
-#include "private/qdeclarativedebugservice_p.h"
-#include <private/qdeclarativeglobal_p.h>
-
-#include <QtCore/QList>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeView;
-class QDeclarativeObserverInterface;
-
-class Q_DECLARATIVE_EXPORT QDeclarativeObserverService : public QDeclarativeDebugService
-{
- Q_OBJECT
-
-public:
- QDeclarativeObserverService();
- static QDeclarativeObserverService *instance();
-
- void addView(QDeclarativeView *);
- void removeView(QDeclarativeView *);
- QList<QDeclarativeView*> views() const { return m_views; }
-
- void sendMessage(const QByteArray &message);
-
-Q_SIGNALS:
- void gotMessage(const QByteArray &message);
-
-protected:
- virtual void statusChanged(Status status);
- virtual void messageReceived(const QByteArray &);
-
-private:
- static QDeclarativeObserverInterface *loadObserverPlugin();
-
- QList<QDeclarativeView*> m_views;
- QDeclarativeObserverInterface *m_observer;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEOBSERVERSERVICE_H
diff --git a/src/declarative/debugger/qjsdebuggeragent.cpp b/src/declarative/debugger/qjsdebuggeragent.cpp
index 9b76592c48..dff637b7da 100644
--- a/src/declarative/debugger/qjsdebuggeragent.cpp
+++ b/src/declarative/debugger/qjsdebuggeragent.cpp
@@ -56,7 +56,7 @@ class QJSDebuggerAgentPrivate
{
public:
QJSDebuggerAgentPrivate(QJSDebuggerAgent *q)
- : q(q), state(NoState)
+ : q(q), state(NoState), isInitialized(false)
{}
void continueExec();
@@ -79,6 +79,7 @@ public:
QHash<QString, JSAgentBreakpointData> fileNameToBreakpoints;
QStringList watchExpressions;
QSet<qint64> knownObjectIds;
+ bool isInitialized;
};
namespace {
@@ -252,6 +253,14 @@ QJSDebuggerAgent::~QJSDebuggerAgent()
delete d;
}
+/*!
+ Indicates whether the agent got the list of breakpoints.
+ */
+bool QJSDebuggerAgent::isInitialized() const
+{
+ return d->isInitialized;
+}
+
void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
{
d->breakpoints = breakpoints;
@@ -259,6 +268,8 @@ void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
d->fileNameToBreakpoints.clear();
foreach (const JSAgentBreakpointData &bp, breakpoints)
d->fileNameToBreakpoints.insertMulti(fileName(QString::fromUtf8(bp.fileUrl)), bp);
+
+ d->isInitialized = true;
}
void QJSDebuggerAgent::setWatchExpressions(const QStringList &watchExpressions)
diff --git a/src/declarative/debugger/qjsdebuggeragent_p.h b/src/declarative/debugger/qjsdebuggeragent_p.h
index 5aa3c9ccbc..4b27fc82ad 100644
--- a/src/declarative/debugger/qjsdebuggeragent_p.h
+++ b/src/declarative/debugger/qjsdebuggeragent_p.h
@@ -94,6 +94,12 @@ inline QDataStream &operator<<(QDataStream &s, const JSAgentWatchData &data)
<< data.type << data.hasChildren << data.objectId;
}
+inline QDataStream &operator>>(QDataStream &s, JSAgentWatchData &data)
+{
+ return s >> data.exp >> data.name >> data.value
+ >> data.type >> data.hasChildren >> data.objectId;
+}
+
struct JSAgentStackData
{
QByteArray functionName;
@@ -106,6 +112,11 @@ inline QDataStream &operator<<(QDataStream &s, const JSAgentStackData &data)
return s << data.functionName << data.fileUrl << data.lineNumber;
}
+inline QDataStream &operator>>(QDataStream &s, JSAgentStackData &data)
+{
+ return s >> data.functionName >> data.fileUrl >> data.lineNumber;
+}
+
struct JSAgentBreakpointData
{
QByteArray functionName;
@@ -145,6 +156,8 @@ public:
QJSDebuggerAgent(QDeclarativeEngine *engine, QObject *parent = 0);
~QJSDebuggerAgent();
+ bool isInitialized() const;
+
void setBreakpoints(const JSAgentBreakpoints &);
void setWatchExpressions(const QStringList &);
diff --git a/src/declarative/debugger/qjsdebugservice.cpp b/src/declarative/debugger/qjsdebugservice.cpp
index 4ce2c906bc..ad84f656f7 100644
--- a/src/declarative/debugger/qjsdebugservice.cpp
+++ b/src/declarative/debugger/qjsdebugservice.cpp
@@ -71,6 +71,16 @@ void QJSDebugService::addEngine(QDeclarativeEngine *engine)
Q_ASSERT(!m_engines.contains(engine));
m_engines.append(engine);
+
+ if (status() == Enabled && !m_engines.isEmpty() && !m_agent) {
+ m_agent = new QJSDebuggerAgent(engine, engine);
+ connect(m_agent, SIGNAL(stopped(bool,QString)),
+ this, SLOT(executionStopped(bool,QString)));
+
+ while (!m_agent->isInitialized()) {
+ waitForMessage();
+ }
+ }
}
void QJSDebugService::removeEngine(QDeclarativeEngine *engine)
diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp
index c24df6118d..f53d2a38a2 100644
--- a/src/declarative/debugger/qpacketprotocol.cpp
+++ b/src/declarative/debugger/qpacketprotocol.cpp
@@ -164,47 +164,52 @@ public Q_SLOTS:
void readyToRead()
{
- if(-1 == inProgressSize) {
- // We need a size header of sizeof(qint32)
- if(sizeof(qint32) > (uint)dev->bytesAvailable())
- return;
-
- // Read size header
- int read = dev->read((char *)&inProgressSize, sizeof(qint32));
- Q_ASSERT(read == sizeof(qint32));
- Q_UNUSED(read);
-
- // Check sizing constraints
- if(inProgressSize > maxPacketSize) {
- QObject::disconnect(dev, SIGNAL(readyRead()),
- this, SLOT(readyToRead()));
- QObject::disconnect(dev, SIGNAL(aboutToClose()),
- this, SLOT(aboutToClose()));
- QObject::disconnect(dev, SIGNAL(bytesWritten(qint64)),
- this, SLOT(bytesWritten(qint64)));
- dev = 0;
- emit invalidPacket();
- return;
- }
-
- inProgressSize -= sizeof(qint32);
-
- // Need to get trailing data
- readyToRead();
- } else {
- inProgress.append(dev->read(inProgressSize - inProgress.size()));
-
- if(inProgressSize == inProgress.size()) {
- // Packet has arrived!
- packets.append(inProgress);
- inProgressSize = -1;
- inProgress.clear();
-
- emit readyRead();
- waitingForPacket = false;
-
- // Need to get trailing data
- readyToRead();
+ bool gotPackets = false;
+ while (true) {
+ // Get size header (if not in progress)
+ if (-1 == inProgressSize) {
+ // We need a size header of sizeof(qint32)
+ if (sizeof(qint32) > (uint)dev->bytesAvailable()) {
+ if (gotPackets)
+ emit readyRead();
+ return; // no more data available
+ }
+
+ // Read size header
+ int read = dev->read((char *)&inProgressSize, sizeof(qint32));
+ Q_ASSERT(read == sizeof(qint32));
+ Q_UNUSED(read);
+
+ // Check sizing constraints
+ if (inProgressSize > maxPacketSize) {
+ QObject::disconnect(dev, SIGNAL(readyRead()),
+ this, SLOT(readyToRead()));
+ QObject::disconnect(dev, SIGNAL(aboutToClose()),
+ this, SLOT(aboutToClose()));
+ QObject::disconnect(dev, SIGNAL(bytesWritten(qint64)),
+ this, SLOT(bytesWritten(qint64)));
+ dev = 0;
+ emit invalidPacket();
+ return;
+ }
+
+ inProgressSize -= sizeof(qint32);
+ } else {
+ inProgress.append(dev->read(inProgressSize - inProgress.size()));
+
+ if (inProgressSize == inProgress.size()) {
+ // Packet has arrived!
+ packets.append(inProgress);
+ inProgressSize = -1;
+ inProgress.clear();
+
+ waitingForPacket = false;
+ gotPackets = true;
+ } else {
+ if (gotPackets)
+ emit readyRead();
+ return; // packet in progress is not yet complete
+ }
}
}
}
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
index b74b18c090..055e4b939c 100644
--- a/src/declarative/declarative.pro
+++ b/src/declarative/declarative.pro
@@ -26,7 +26,7 @@ include(debugger/debugger.pri)
symbian: {
TARGET.UID3=0x2001E623
- LIBS += -lefsrv
+ LIBS += -lefsrv -lhal
contains(QT_CONFIG, freetype) {
DEFINES += QT_NO_FONTCONFIG
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
index d222ef5491..cffcd54c1f 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
@@ -79,7 +79,6 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchors : public QObject
Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
- Q_PROPERTY(bool mirrored READ mirrored NOTIFY mirroredChanged REVISION 1)
public:
QDeclarativeAnchors(QObject *parent=0);
@@ -184,7 +183,6 @@ Q_SIGNALS:
void verticalCenterOffsetChanged();
void horizontalCenterOffsetChanged();
void baselineOffsetChanged();
- Q_REVISION(1) void mirroredChanged();
private:
friend class QDeclarativeItem;
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index b7fcbb546e..8787a5ed68 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -87,6 +87,32 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \qmlproperty url AnimatedImage::source
+
+ This property holds the URL that refers to the source image.
+
+ AnimatedImage can handle any image format supported by Qt, loaded from any
+ URL scheme supported by Qt.
+
+ \sa QDeclarativeImageProvider
+*/
+
+/*!
+ \qmlproperty bool AnimatedImage::asynchronous
+
+ Specifies that images on the local filesystem should be loaded
+ asynchronously in a separate thread. The default value is
+ false, causing the user interface thread to block while the
+ image is loaded. Setting \a asynchronous to true is useful where
+ maintaining a responsive user interface is more desirable
+ than having images immediately visible.
+
+ Note that this property is only valid for images read from the
+ local filesystem. Images loaded via a network resource (e.g. HTTP)
+ are always loaded asynchonously.
+*/
+
+/*!
\qmlproperty bool AnimatedImage::cache
\since Quick 1.1
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index 836ad4941b..9c274e93fa 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -240,22 +240,20 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
BorderImage can handle any image format supported by Qt, loaded from any
URL scheme supported by Qt.
- It can also handle .sci files, which are a QML-specific format. A .sci
- file uses a simple text-based format that specifies the borders, the
- image file and the tile rules.
+ This property can also be used to refer to .sci files, which are
+ written in a QML-specific, text-based format that specifies the
+ borders, the image file and the tile rules for a given border image.
The following .sci file sets the borders to 10 on each side for the
image \c picture.png:
- \qml
- BorderImage {
- border.left: 10
- border.top: 10
- border.bottom: 10
- border.right: 10
- source: "picture.png"
- }
- \endqml
+ \code
+ border.left: 10
+ border.top: 10
+ border.bottom: 10
+ border.right: 10
+ source: "picture.png"
+ \endcode
The URL may be absolute, or relative to the URL of the component.
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index ce7566b9c1..13bb8ef113 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -232,8 +232,8 @@ void QDeclarativeFlickablePrivate::AxisData::addVelocitySample(qreal v, qreal ma
void QDeclarativeFlickablePrivate::AxisData::updateVelocity()
{
+ velocity = 0;
if (velocityBuffer.count() > QML_FLICK_DISCARDSAMPLES) {
- velocity = 0;
int count = velocityBuffer.count()-QML_FLICK_DISCARDSAMPLES;
for (int i = 0; i < count; ++i) {
qreal v = velocityBuffer.at(i);
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 34925f13f3..a0264f7076 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -206,7 +206,6 @@ public:
void mirrorChange() {
Q_Q(QDeclarativeGridView);
regenerate();
- emit q->effectiveLayoutDirectionChanged();
}
qreal position() const {
@@ -818,7 +817,9 @@ void QDeclarativeGridViewPrivate::createHighlight()
if (highlight) {
if (trackedItem == highlight)
trackedItem = 0;
- delete highlight->item;
+ if (highlight->item->scene())
+ highlight->item->scene()->removeItem(highlight->item);
+ highlight->item->deleteLater();
delete highlight;
highlight = 0;
delete highlightXAnimator;
@@ -1799,12 +1800,15 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
\o Qt.LeftToRight (default) - Items will be laid out starting in the top, left corner. The flow is
dependent on the \l GridView::flow property.
\o Qt.RightToLeft - Items will be laid out starting in the top, right corner. The flow is dependent
- on the \l GridView:flow property.
+ on the \l GridView::flow property.
\endlist
- \bold Note: If GridView::flow is set to GridView.LeftToRight, this is not to be confused if
- GridView::layoutDirection is set to Qt.RightToLeft. The GridView.LeftToRight flow value simply
- indicates that the flow is horizontal.
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the layout direction of the grid view will be mirrored. However, the actual property
+ \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa {LayoutMirroring}{LayoutMirroring}
*/
Qt::LayoutDirection QDeclarativeGridView::layoutDirection() const
@@ -1820,21 +1824,9 @@ void QDeclarativeGridView::setLayoutDirection(Qt::LayoutDirection layoutDirectio
d->layoutDirection = layoutDirection;
d->regenerate();
emit layoutDirectionChanged();
- emit effectiveLayoutDirectionChanged();
}
}
-/*!
- \qmlproperty enumeration GridView::effectiveLayoutDirection
- This property holds the effective layout direction of the grid.
-
- When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
- the visual layout direction of the grid will be mirrored. However, the
- property \l {GridView::layoutDirection}{layoutDirection} will remain unchanged.
-
- \sa GridView::layoutDirection, {LayoutMirroring}{LayoutMirroring}
-*/
-
Qt::LayoutDirection QDeclarativeGridView::effectiveLayoutDirection() const
{
Q_D(const QDeclarativeGridView);
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index d2dff48dc6..078d033dcc 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -75,7 +75,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
- Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
@@ -194,7 +193,6 @@ Q_SIGNALS:
void delegateChanged();
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
- Q_REVISION(1) void effectiveLayoutDirectionChanged();
void keyNavigationWrapsChanged();
void cacheBufferChanged();
void snapModeChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 91b430dc0b..805ca4dc59 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -898,7 +898,6 @@ void QDeclarativeItemPrivate::setLayoutMirror(bool mirror)
_anchors->d_func()->fillChanged();
_anchors->d_func()->centerInChanged();
_anchors->d_func()->updateHorizontalAnchors();
- emit _anchors->mirroredChanged();
}
mirrorChange();
if (attachedLayoutDirection) {
@@ -2605,6 +2604,17 @@ void QDeclarativeItem::setKeepMouseGrab(bool keep)
If \a item is a \c null value, this maps the point from the coordinate
system of the root QML view.
*/
+
+/*!
+ Maps the point (\a x, \a y), which is in \a item's coordinate system, to
+ this item's coordinate system, and returns a script value with \c x and \c y
+ properties matching the mapped cooordinate.
+
+ If \a item is a \c null value, this maps the point from the coordinate
+ system of the root QML view.
+
+ \sa Item::mapFromItem()
+*/
QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, qreal x, qreal y) const
{
QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject();
@@ -2631,6 +2641,17 @@ QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, qreal x, qr
If \a item is a \c null value, this maps \a x and \a y to the coordinate
system of the root QML view.
*/
+
+/*!
+ Maps the point (\a x, \a y), which is in this item's coordinate system, to
+ \a item's coordinate system, and returns a script value with \c x and \c y
+ properties matching the mapped cooordinate.
+
+ If \a item is a \c null value, this maps \a x and \a y to the coordinate
+ system of the root QML view.
+
+ \sa Item::mapToItem()
+*/
QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qreal y) const
{
QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject();
@@ -2650,8 +2671,17 @@ QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qrea
/*!
\qmlmethod Item::forceActiveFocus()
- Force active focus on the item.
- This method sets focus on the item and makes sure that all the focus scopes higher in the object hierarchy are also given focus.
+ Forces active focus on the item.
+
+ This method sets focus on the item and makes sure that all the focus scopes
+ higher in the object hierarchy are also given the focus.
+*/
+
+/*!
+ Forces active focus on the item.
+
+ This method sets focus on the item and makes sure that all the focus scopes
+ higher in the object hierarchy are also given the focus.
*/
void QDeclarativeItem::forceActiveFocus()
{
@@ -2670,7 +2700,12 @@ void QDeclarativeItem::forceActiveFocus()
Returns the visible child item at point (\a x, \a y), which is in this
item's coordinate system, or \c null if there is no such item.
- */
+*/
+
+/*!
+ Returns the visible child item at point (\a x, \a y), which is in this
+ item's coordinate system, or 0 if there is no such item.
+*/
QDeclarativeItem *QDeclarativeItem::childAt(qreal x, qreal y) const
{
const QList<QGraphicsItem *> children = childItems();
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index b52b6fc850..7a5e433d62 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -298,7 +298,6 @@ public:
void mirrorChange() {
Q_Q(QDeclarativeListView);
regenerate();
- emit q->effectiveLayoutDirectionChanged();
}
bool isRightToLeft() const {
@@ -943,7 +942,9 @@ void QDeclarativeListViewPrivate::createHighlight()
if (highlight) {
if (trackedItem == highlight)
trackedItem = 0;
- delete highlight->item;
+ if (highlight->item->scene())
+ highlight->item->scene()->removeItem(highlight->item);
+ highlight->item->deleteLater();
delete highlight;
highlight = 0;
delete highlightPosAnimator;
@@ -2169,7 +2170,12 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
\o Qt.RightToLeft - Items will be laid out from right to let.
\endlist
- \sa ListView::effectiveLayoutDirection
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the layout direction of the horizontal list will be mirrored. However, the actual property
+ \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa {LayoutMirroring}{LayoutMirroring}
*/
Qt::LayoutDirection QDeclarativeListView::layoutDirection() const
@@ -2185,21 +2191,9 @@ void QDeclarativeListView::setLayoutDirection(Qt::LayoutDirection layoutDirectio
d->layoutDirection = layoutDirection;
d->regenerate();
emit layoutDirectionChanged();
- emit effectiveLayoutDirectionChanged();
}
}
-/*!
- \qmlproperty enumeration ListView::effectiveLayoutDirection
- This property holds the effective layout direction of the horizontal list.
-
- When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
- the visual layout direction of the horizontal list will be mirrored. However, the
- property \l {ListView::layoutDirection}{layoutDirection} will remain unchanged.
-
- \sa ListView::layoutDirection, {LayoutMirroring}{LayoutMirroring}
-*/
-
Qt::LayoutDirection QDeclarativeListView::effectiveLayoutDirection() const
{
Q_D(const QDeclarativeListView);
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index 2cd6ba7c1e..00f9beece5 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -114,7 +114,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeListView : public QDeclarativeFlickable
Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
- Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(QDeclarativeViewSection *section READ sectionCriteria CONSTANT)
@@ -229,7 +228,6 @@ Q_SIGNALS:
void spacingChanged();
void orientationChanged();
Q_REVISION(1) void layoutDirectionChanged();
- Q_REVISION(1) void effectiveLayoutDirectionChanged();
void currentIndexChanged();
void currentSectionChanged();
void highlightMoveSpeedChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 20ca0f689a..18f008a870 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -496,9 +496,6 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
d->pressAndHoldTimer.start(PressAndHoldDelay, this);
setKeepMouseGrab(d->stealMouse);
event->setAccepted(setPressed(true));
-
- if(!event->isAccepted() && d->forwardToList.count())
- d->forwardEvent(event);
}
}
@@ -576,9 +573,6 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
me.setX(d->lastPos.x());
me.setY(d->lastPos.y());
emit positionChanged(&me);
-
- if(!event->isAccepted() && d->forwardToList.count())
- d->forwardEvent(event);
}
@@ -600,9 +594,6 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if (s && s->mouseGrabberItem() == this)
ungrabMouse();
setKeepMouseGrab(false);
-
- if(!event->isAccepted() && d->forwardToList.count())
- d->forwardEvent(event);
}
d->doubleClick = false;
}
@@ -994,11 +985,4 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
*/
-QDeclarativeListProperty<QGraphicsObject> QDeclarativeMouseArea::forwardTo()
-{
- Q_D(QDeclarativeMouseArea);
- return d->forwardTo;
-}
-
-
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index 8fd453f5de..f6f970b4bb 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -130,7 +130,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ???
Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1)
- Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> forwardTo READ forwardTo);
public:
QDeclarativeMouseArea(QDeclarativeItem *parent=0);
@@ -158,8 +157,6 @@ public:
bool preventStealing() const;
void setPreventStealing(bool prevent);
- QDeclarativeListProperty<QGraphicsObject> forwardTo();
-
Q_SIGNALS:
void hoveredChanged();
void pressedChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index 6626c56676..f6ea00dcf0 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -70,8 +70,6 @@ public:
: absorb(true), hovered(false), pressed(false), longPress(false),
moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0)
{
- Q_Q(QDeclarativeMouseArea);
- forwardTo = QDeclarativeListProperty<QGraphicsObject>(q, forwardToList);
}
~QDeclarativeMouseAreaPrivate();
@@ -91,18 +89,6 @@ public:
lastModifiers = event->modifiers();
}
- void forwardEvent(QGraphicsSceneMouseEvent* event)
- {
- Q_Q(QDeclarativeMouseArea);
- for(int i=0; i < forwardToList.count(); i++){
- event->setPos(forwardToList[i]->mapFromScene(event->scenePos()));
- forwardToList[i]->scene()->sendEvent(forwardToList[i], event);
- if(event->isAccepted())
- break;
- }
- event->setPos(q->mapFromScene(event->scenePos()));
- }
-
bool isPressAndHoldConnected() {
Q_Q(QDeclarativeMouseArea);
static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)");
@@ -135,9 +121,6 @@ public:
Qt::MouseButtons lastButtons;
Qt::KeyboardModifiers lastModifiers;
QBasicTimer pressAndHoldTimer;
-
- QDeclarativeListProperty<QGraphicsObject> forwardTo;
- QList<QGraphicsObject*> forwardToList;
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 79e52cd244..94f128dca8 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -203,7 +203,9 @@ void QDeclarativePathViewPrivate::createHighlight()
bool changed = false;
if (highlightItem) {
- delete highlightItem;
+ if (highlightItem->scene())
+ highlightItem->scene()->removeItem(highlightItem);
+ highlightItem->deleteLater();
highlightItem = 0;
changed = true;
}
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 3f4d6dedc4..f3d1a68cd0 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -597,7 +597,12 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
the right anchor remains to the right of the row.
\endlist
- \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the row positioner will be mirrored. However, the
+ property \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring}
*/
Qt::LayoutDirection QDeclarativeRow::layoutDirection() const
{
@@ -616,21 +621,9 @@ void QDeclarativeRow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
prePositioning();
emit layoutDirectionChanged();
- emit effectiveLayoutDirectionChanged();
}
}
-/*!
- \qmlproperty enumeration Row::effectiveLayoutDirection
- This property holds the effective layout direction of the row positioner.
-
- When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
- the visual layout direction of the row positioner will be mirrored. However, the
- property \l {Row::layoutDirection}{layoutDirection} will remain unchanged.
-
- \sa Row::layoutDirection, {LayoutMirroring}{LayoutMirroring}
-*/
-
Qt::LayoutDirection QDeclarativeRow::effectiveLayoutDirection() const
{
return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
@@ -900,7 +893,12 @@ void QDeclarativeGrid::setFlow(Flow flow)
\l Grid::flow property.
\endlist
- \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid positioner will be mirrored. However, the
+ property \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring}
*/
Qt::LayoutDirection QDeclarativeGrid::layoutDirection() const
{
@@ -918,22 +916,10 @@ void QDeclarativeGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection)
else
d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
prePositioning();
- emit layoutDirectionChanged();
- emit effectiveLayoutDirectionChanged();
+ emit layoutDirectionChanged();;
}
}
-/*!
- \qmlproperty enumeration Grid::effectiveLayoutDirection
- This property holds the effective layout direction of the grid positioner.
-
- When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
- the visual layout direction of the grid positioner will be mirrored. However, the
- property \l {Grid::layoutDirection}{layoutDirection} will remain unchanged.
-
- \sa Grid::layoutDirection, {LayoutMirroring}{LayoutMirroring}
-*/
-
Qt::LayoutDirection QDeclarativeGrid::effectiveLayoutDirection() const
{
return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
@@ -1265,7 +1251,12 @@ void QDeclarativeFlow::setFlow(Flow flow)
\l Flow::flow property.
\endlist
- \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the flow positioner will be mirrored. However, the
+ property \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring}
*/
Qt::LayoutDirection QDeclarativeFlow::layoutDirection() const
@@ -1281,21 +1272,9 @@ void QDeclarativeFlow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
- emit effectiveLayoutDirectionChanged();
}
}
-/*!
- \qmlproperty enumeration Flow::effectiveLayoutDirection
- This property holds the effective layout direction of the flow positioner.
-
- When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
- the visual layout direction of the grid positioner will be mirrored. However, the
- property \l {Flow::layoutDirection}{layoutDirection} will remain unchanged.
-
- \sa Flow::layoutDirection, {LayoutMirroring}{LayoutMirroring}
-*/
-
Qt::LayoutDirection QDeclarativeFlow::effectiveLayoutDirection() const
{
return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index 3d62a8838f..1e6c118d9f 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -130,7 +130,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
{
Q_OBJECT
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
- Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeRow(QDeclarativeItem *parent=0);
@@ -140,7 +139,6 @@ public:
Q_SIGNALS:
Q_REVISION(1) void layoutDirectionChanged();
- Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
@@ -156,7 +154,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner
Q_PROPERTY(int columns READ columns WRITE setColumns NOTIFY columnsChanged)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
- Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeGrid(QDeclarativeItem *parent=0);
@@ -180,7 +177,6 @@ Q_SIGNALS:
void columnsChanged();
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
- Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
@@ -199,7 +195,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner
Q_OBJECT
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
- Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeFlow(QDeclarativeItem *parent=0);
@@ -214,7 +209,6 @@ public:
Q_SIGNALS:
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
- Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 96bd792c01..54ff406ec3 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1040,7 +1040,6 @@ void QDeclarativeText::setStyleColor(const QColor &color)
/*!
\qmlproperty enumeration Text::horizontalAlignment
\qmlproperty enumeration Text::verticalAlignment
- \qmlproperty enumeration Text::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the Text items
width and height. By default, the text is vertically aligned to the top. Horizontal
@@ -1056,10 +1055,10 @@ void QDeclarativeText::setStyleColor(const QColor &color)
need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to
that of the parent.
- When using the attached property LayoutMirroring::enabled to mirror application
+ When using the attached property \l {LayoutMirroring::enabled} to mirror application
layouts, the horizontal alignment of text will also be mirrored. However, the property
\c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
- of Text, use the read-only property \c effectiveHorizontalAlignment.
+ of Text, use the property \l {LayoutMirroring::enabled}.
*/
QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
{
@@ -1109,10 +1108,7 @@ bool QDeclarativeTextPrivate::setHAlign(QDeclarativeText::HAlignment alignment,
if (hAlign != alignment || forceAlign) {
QDeclarativeText::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
hAlign = alignment;
-
emit q->horizontalAlignmentChanged(hAlign);
- if (oldEffectiveHAlign != q->effectiveHAlign())
- emit q->effectiveHorizontalAlignmentChanged();
return true;
}
return false;
@@ -1134,7 +1130,6 @@ void QDeclarativeTextPrivate::mirrorChange()
if (q->isComponentComplete()) {
if (!hAlignImplicit && (hAlign == QDeclarativeText::AlignRight || hAlign == QDeclarativeText::AlignLeft)) {
updateLayout();
- emit q->effectiveHorizontalAlignmentChanged();
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h
index b711582535..1004b71739 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p.h
@@ -70,7 +70,6 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeText : public QDeclarativeImplici
Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged)
Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged)
Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
- Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
@@ -191,7 +190,6 @@ Q_SIGNALS:
void paintedSizeChanged();
Q_REVISION(1) void lineHeightChanged(qreal lineHeight);
Q_REVISION(1) void lineHeightModeChanged(LineHeightMode mode);
- Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 6806df0d7e..20b2e768df 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -458,7 +458,6 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
/*!
\qmlproperty enumeration TextEdit::horizontalAlignment
\qmlproperty enumeration TextEdit::verticalAlignment
- \qmlproperty enumeration TextEdit::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the TextEdit item's
width and height. By default, the text alignment follows the natural alignment
@@ -480,10 +479,10 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
\o TextEdit.AlignVCenter
\endlist
- When using the attached property LayoutMirroring::enabled to mirror application
+ When using the attached property \l {LayoutMirroring::enabled} to mirror application
layouts, the horizontal alignment of text will also be mirrored. However, the property
\c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
- of TextEdit, use the read-only property \c effectiveHorizontalAlignment.
+ of TextEdit, use the property \l {LayoutMirroring::enabled}.
*/
QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
{
@@ -538,8 +537,6 @@ bool QDeclarativeTextEditPrivate::setHAlign(QDeclarativeTextEdit::HAlignment ali
QDeclarativeTextEdit::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
hAlign = alignment;
emit q->horizontalAlignmentChanged(alignment);
- if (oldEffectiveHAlign != q->effectiveHAlign())
- emit q->effectiveHorizontalAlignmentChanged();
return true;
}
return false;
@@ -562,7 +559,6 @@ void QDeclarativeTextEditPrivate::mirrorChange()
if (!hAlignImplicit && (hAlign == QDeclarativeTextEdit::AlignRight || hAlign == QDeclarativeTextEdit::AlignLeft)) {
updateDefaultTextOption();
q->updateSize();
- emit q->effectiveHorizontalAlignmentChanged();
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index f9a6c73a39..d8fc3bc549 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -73,7 +73,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePa
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
- Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
@@ -249,7 +248,6 @@ Q_SIGNALS:
Q_REVISION(1) void linkActivated(const QString &link);
Q_REVISION(1) void canPasteChanged();
Q_REVISION(1) void inputMethodComposingChanged();
- Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
public Q_SLOTS:
void selectAll();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index dd5a58ebdc..bc9b6fd053 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -236,11 +236,11 @@ void QDeclarativeTextInput::setFont(const QFont &font)
if (oldFont != d->font) {
d->control->setFont(d->font);
+ updateSize();
+ updateCursorRectangle();
if(d->cursorItem){
d->cursorItem->setHeight(QFontMetrics(d->font).height());
- moveCursor();
}
- updateSize();
}
emit fontChanged(d->sourceFont);
}
@@ -326,7 +326,6 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
/*!
\qmlproperty enumeration TextInput::horizontalAlignment
- \qmlproperty enumeration TextInput::effectiveHorizontalAlignment
Sets the horizontal alignment of the text within the TextInput item's
width and height. By default, the text alignment follows the natural alignment
@@ -342,10 +341,10 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and
\c TextInput.AlignHCenter.
- When using the attached property LayoutMirroring::enabled to mirror application
+ When using the attached property \l {LayoutMirroring::enabled} to mirror application
layouts, the horizontal alignment of text will also be mirrored. However, the property
\c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
- of TextInput, use the read-only property \c effectiveHorizontalAlignment.
+ of TextInput, use the property \l {LayoutMirroring::enabled}.
*/
QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
{
@@ -359,8 +358,7 @@ void QDeclarativeTextInput::setHAlign(HAlignment align)
bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
d->hAlignImplicit = false;
if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
- updateRect();
- d->updateHorizontalScroll();
+ updateCursorRectangle();
}
}
@@ -369,8 +367,7 @@ void QDeclarativeTextInput::resetHAlign()
Q_D(QDeclarativeTextInput);
d->hAlignImplicit = true;
if (d->determineHorizontalAlignment() && isComponentComplete()) {
- updateRect();
- d->updateHorizontalScroll();
+ updateCursorRectangle();
}
}
@@ -400,8 +397,6 @@ bool QDeclarativeTextInputPrivate::setHAlign(QDeclarativeTextInput::HAlignment a
QDeclarativeTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
hAlign = alignment;
emit q->horizontalAlignmentChanged(alignment);
- if (oldEffectiveHAlign != q->effectiveHAlign())
- emit q->effectiveHorizontalAlignmentChanged();
return true;
}
return false;
@@ -423,9 +418,8 @@ void QDeclarativeTextInputPrivate::mirrorChange()
Q_Q(QDeclarativeTextInput);
if (q->isComponentComplete()) {
if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) {
- q->updateRect();
+ q->updateCursorRectangle();
updateHorizontalScroll();
- emit q->effectiveHorizontalAlignmentChanged();
}
}
}
@@ -683,7 +677,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b)
d->autoScroll = b;
//We need to repaint so that the scrolling is taking into account.
updateSize(true);
- d->updateHorizontalScroll();
+ updateCursorRectangle();
emit autoScrollChanged(d->autoScroll);
}
@@ -947,10 +941,6 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c)
d->cursorComponent = c;
if(!c){
//note that the components are owned by something else
- disconnect(d->control, SIGNAL(cursorPositionChanged(int,int)),
- this, SLOT(moveCursor()));
- disconnect(d->control, SIGNAL(updateMicroFocus()),
- this, SLOT(moveCursor()));
delete d->cursorItem;
}else{
d->startCreatingCursor();
@@ -962,10 +952,6 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c)
void QDeclarativeTextInputPrivate::startCreatingCursor()
{
Q_Q(QDeclarativeTextInput);
- q->connect(control, SIGNAL(cursorPositionChanged(int,int)),
- q, SLOT(moveCursor()), Qt::UniqueConnection);
- q->connect(control, SIGNAL(updateMicroFocus()),
- q, SLOT(moveCursor()), Qt::UniqueConnection);
if(cursorComponent->isReady()){
q->createCursor();
}else if(cursorComponent->isLoading()){
@@ -1001,15 +987,6 @@ void QDeclarativeTextInput::createCursor()
d->cursorItem->setHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
}
-void QDeclarativeTextInput::moveCursor()
-{
- Q_D(QDeclarativeTextInput);
- if(!d->cursorItem)
- return;
- d->updateHorizontalScroll();
- d->cursorItem->setX(d->control->cursorToX() - d->hscroll);
-}
-
/*!
\qmlmethod rect TextInput::positionToRectangle(int pos)
@@ -1118,8 +1095,6 @@ void QDeclarativeTextInput::inputMethodEvent(QInputMethodEvent *ev)
ev->ignore();
} else {
d->control->processInputMethodEvent(ev);
- updateSize();
- d->updateHorizontalScroll();
}
}
if (!ev->isAccepted())
@@ -1297,7 +1272,7 @@ void QDeclarativeTextInput::geometryChanged(const QRectF &newGeometry,
Q_D(QDeclarativeTextInput);
if (newGeometry.width() != oldGeometry.width()) {
updateSize();
- d->updateHorizontalScroll();
+ updateCursorRectangle();
}
QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
}
@@ -1643,7 +1618,6 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
{
Q_D(QDeclarativeTextInput);
d->control->moveCursor(position, true);
- d->updateHorizontalScroll();
}
/*!
@@ -1901,7 +1875,7 @@ void QDeclarativeTextInputPrivate::init()
canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
#endif // QT_NO_CLIPBOARD
q->connect(control, SIGNAL(updateMicroFocus()),
- q, SLOT(updateMicroFocus()));
+ q, SLOT(updateCursorRectangle()));
q->connect(control, SIGNAL(displayTextChanged(QString)),
q, SLOT(updateRect()));
q->updateSize();
@@ -1917,9 +1891,7 @@ void QDeclarativeTextInputPrivate::init()
void QDeclarativeTextInput::cursorPosChanged()
{
Q_D(QDeclarativeTextInput);
- d->updateHorizontalScroll();
- updateRect();//TODO: Only update rect between pos's
- updateMicroFocus();
+ updateCursorRectangle();
emit cursorPositionChanged();
d->control->resetCursorBlinkTimer();
@@ -1935,6 +1907,17 @@ void QDeclarativeTextInput::cursorPosChanged()
}
}
+void QDeclarativeTextInput::updateCursorRectangle()
+{
+ Q_D(QDeclarativeTextInput);
+ d->updateHorizontalScroll();
+ updateRect();//TODO: Only update rect between pos's
+ updateMicroFocus();
+ emit cursorRectangleChanged();
+ if (d->cursorItem)
+ d->cursorItem->setX(d->control->cursorToX() - d->hscroll);
+}
+
void QDeclarativeTextInput::selectionChanged()
{
Q_D(QDeclarativeTextInput);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index aaf8859150..2c2f230029 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -71,11 +71,10 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
- Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
- Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorPositionChanged)
+ Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
Q_PROPERTY(QDeclarativeComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged)
Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
@@ -221,6 +220,7 @@ public:
Q_SIGNALS:
void textChanged();
void cursorPositionChanged();
+ void cursorRectangleChanged();
void selectionStartChanged();
void selectionEndChanged();
void selectedTextChanged();
@@ -246,7 +246,6 @@ Q_SIGNALS:
Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
Q_REVISION(1) void canPasteChanged();
Q_REVISION(1) void inputMethodComposingChanged();
- Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -279,8 +278,8 @@ private Q_SLOTS:
void q_textChanged();
void selectionChanged();
void createCursor();
- void moveCursor();
void cursorPosChanged();
+ void updateCursorRectangle();
void updateRect(const QRect &r = QRect());
void q_canPasteChanged();
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index e642a67102..abde4adc81 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -622,6 +622,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
out->dumpInstructions();
if (compilerStatDump())
dumpStats();
+ Q_ASSERT(out->rootPropertyCache);
} else {
reset(out);
}
@@ -1218,6 +1219,11 @@ void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj)
id.setId.index = obj->idIndex;
output->bytecode << id;
}
+
+ if (obj == unitRoot) {
+ output->rootPropertyCache = output->types[obj->type].createPropertyCache(engine);
+ output->rootPropertyCache->addref();
+ }
}
bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index b81f631708..8679445b69 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -771,9 +771,6 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const
All required image providers should be added to the engine before any
QML sources files are loaded.
- Note that images loaded from a QDeclarativeImageProvider are cached
- by QPixmapCache, similar to any image loaded by QML.
-
\sa removeImageProvider()
*/
void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider)
@@ -1716,9 +1713,6 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
qsreal w = ctxt->argument(2).toNumber();
qsreal h = ctxt->argument(3).toNumber();
- if (w < 0 || h < 0)
- return engine->nullValue();
-
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
}
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index 559adf410e..fa88c008e4 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -136,7 +136,8 @@ public:
Image providers that support QImage loading automatically include support
for asychronous loading of images. To enable asynchronous loading for an
- \l Image source, set \l Image::asynchronous to \c true. When this is enabled,
+ image source, set the \c asynchronous property to \c true for the relevant
+ \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled,
the image request to the provider is run in a low priority thread,
allowing image loading to be executed in the background, and reducing the
performance impact on the user interface.
@@ -147,6 +148,17 @@ public:
\c true, the value is ignored and the image is loaded
synchronously.
+
+ \section2 Image caching
+
+ Images returned by a QDeclarativeImageProvider are automatically cached,
+ similar to any image loaded by the QML engine. When an image with a
+ "image://" prefix is loaded from cache, requestImage() and requestPixmap()
+ will not be called for the relevant image provider. If an image should always
+ be fetched from the image provider, and should not be cached at all, set the
+ \c cache property to \c false for the relevant \l Image, \l BorderImage or
+ \l AnimatedImage object.
+
\sa QDeclarativeEngine::addImageProvider()
*/
diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp
index 77587a4faa..168c1512e2 100644
--- a/src/declarative/qml/qdeclarativetypeloader.cpp
+++ b/src/declarative/qml/qdeclarativetypeloader.cpp
@@ -434,7 +434,7 @@ void QDeclarativeDataBlob::notifyComplete(QDeclarativeDataBlob *blob)
/*!
\class QDeclarativeDataLoader
-\brief The QDeclarativeDataLoader class abstracts loading files and their dependecies over the network.
+\brief The QDeclarativeDataLoader class abstracts loading files and their dependencies over the network.
\internal
The QDeclarativeDataLoader class is provided for the exclusive use of the QDeclarativeTypeLoader class.
@@ -453,9 +453,11 @@ are required before processing can fully complete.
To complete processing, the QDeclarativeDataBlob::done() callback is invoked. done() is called when
one of these three preconditions are met.
-1. The QDeclarativeDataBlob has no dependencies.
-2. The QDeclarativeDataBlob has an error set.
-3. All the QDeclarativeDataBlob's dependencies are themselves "done()".
+\list 1
+\o The QDeclarativeDataBlob has no dependencies.
+\o The QDeclarativeDataBlob has an error set.
+\o All the QDeclarativeDataBlob's dependencies are themselves "done()".
+\endlist
Thus QDeclarativeDataBlob::done() will always eventually be called, even if the blob has an error set.
*/
@@ -616,13 +618,17 @@ void QDeclarativeDataLoader::setData(QDeclarativeDataBlob *blob, const QByteArra
}
/*!
-\class QDeclarativeTypeLoader
+Constructs a new type loader that uses the given \a engine.
*/
QDeclarativeTypeLoader::QDeclarativeTypeLoader(QDeclarativeEngine *engine)
: QDeclarativeDataLoader(engine)
{
}
+/*!
+Destroys the type loader, first clearing the cache of any information about
+loaded files.
+*/
QDeclarativeTypeLoader::~QDeclarativeTypeLoader()
{
clearCache();
@@ -674,7 +680,7 @@ QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QByteArray &data, const
}
/*!
-Return a QDeclarativeScriptData for \a url. The QDeclarativeScriptData may be cached.
+Returns a QDeclarativeScriptData for \a url. The QDeclarativeScriptData may be cached.
*/
QDeclarativeScriptData *QDeclarativeTypeLoader::getScript(const QUrl &url)
{
@@ -695,7 +701,7 @@ QDeclarativeScriptData *QDeclarativeTypeLoader::getScript(const QUrl &url)
}
/*!
-Return a QDeclarativeQmldirData for \a url. The QDeclarativeQmldirData may be cached.
+Returns a QDeclarativeQmldirData for \a url. The QDeclarativeQmldirData may be cached.
*/
QDeclarativeQmldirData *QDeclarativeTypeLoader::getQmldir(const QUrl &url)
{
@@ -715,6 +721,10 @@ QDeclarativeQmldirData *QDeclarativeTypeLoader::getQmldir(const QUrl &url)
return qmldirData;
}
+/*!
+Clears cached information about loaded files, including any type data, scripts
+and qmldir information.
+*/
void QDeclarativeTypeLoader::clearCache()
{
for (TypeCache::Iterator iter = m_typeCache.begin(); iter != m_typeCache.end(); ++iter)
diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp
index 9fc0d35696..659a3391f1 100644
--- a/src/declarative/qml/qperformancetimer.cpp
+++ b/src/declarative/qml/qperformancetimer.cpp
@@ -45,14 +45,15 @@
#include <sys/time.h>
#include <unistd.h>
#include <mach/mach_time.h>
-#elif defined(Q_OS_UNIX)
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
#elif defined(Q_OS_SYMBIAN)
#include <e32std.h>
#include <sys/time.h>
#include <hal.h>
+#include <hal_data.h>
+#elif defined(Q_OS_UNIX)
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
#elif defined(Q_OS_WIN)
#include <windows.h>
#endif
@@ -84,6 +85,29 @@ qint64 QPerformanceTimer::elapsed() const
return absoluteToNSecs(cpu_time - t1);
}
+////////////////////////////// Symbian //////////////////////////////
+#elif defined(Q_OS_SYMBIAN)
+
+static qint64 getTimeFromTick(quint64 elapsed)
+{
+ static TInt freq = 0;
+ if (!freq)
+ HAL::Get(HALData::EFastCounterFrequency, freq);
+
+ return (elapsed * 1000000000) / freq;
+}
+
+void QPerformanceTimer::start()
+{
+ t1 = User::FastCounter();
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ return getTimeFromTick(User::FastCounter() - t1);
+}
+
+
////////////////////////////// Unix //////////////////////////////
#elif defined(Q_OS_UNIX)
@@ -158,29 +182,6 @@ qint64 QPerformanceTimer::elapsed() const
return sec * Q_INT64_C(1000000000) + frac;
}
-////////////////////////////// Symbian //////////////////////////////
-#elif defined(Q_OS_SYMBIAN)
-
-static qint64 getTimeFromTick(quint64 elapsed)
-{
- static TInt freq;
- if (!freq)
- HAL::Get(HALData::EFastCounterFrequency, freq);
-
- // ### not sure on units
- return elapsed / freq;
-}
-
-void QPerformanceTimer::start()
-{
- t1 = User::FastCounter();
-}
-
-qint64 QPerformanceTimer::elapsed() const
-{
- return getTimeFromTick(User::FastCounter() - t1);
-}
-
////////////////////////////// Windows //////////////////////////////
#elif defined(Q_OS_WIN)
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index efaa7f0cfd..ce21bcd30e 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -1522,6 +1522,7 @@ void QDeclarativeAnimationGroupPrivate::append_animation(QDeclarativeListPropert
QDeclarativeAnimationGroup *q = qobject_cast<QDeclarativeAnimationGroup *>(list->object);
if (q) {
a->setGroup(q);
+ // This is an optimization for the parenting that already occurs via addAnimation
QDeclarative_setParent_noEvent(a->qtAnimation(), q->d_func()->ag);
q->d_func()->ag->addAnimation(a->qtAnimation());
}
@@ -1531,9 +1532,12 @@ void QDeclarativeAnimationGroupPrivate::clear_animation(QDeclarativeListProperty
{
QDeclarativeAnimationGroup *q = qobject_cast<QDeclarativeAnimationGroup *>(list->object);
if (q) {
- for (int i = 0; i < q->d_func()->animations.count(); ++i)
- q->d_func()->animations.at(i)->setGroup(0);
- q->d_func()->animations.clear();
+ while (q->d_func()->animations.count()) {
+ QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0);
+ QDeclarative_setParent_noEvent(firstAnim->qtAnimation(), 0);
+ q->d_func()->ag->removeAnimation(firstAnim->qtAnimation());
+ firstAnim->setGroup(0);
+ }
}
}
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 07d39774b3..3557425df1 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -584,6 +584,7 @@ public:
void unreferencePixmap(QDeclarativePixmapData *);
void referencePixmap(QDeclarativePixmapData *);
+ void flushCache();
protected:
virtual void timerEvent(QTimerEvent *);
@@ -682,6 +683,14 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
}
}
+/*
+ Remove all unreferenced pixmaps from the cache.
+*/
+void QDeclarativePixmapStore::flushCache()
+{
+ shrinkCache(m_unreferencedCost);
+}
+
QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d)
: data(d), reader(0), requestSize(d->requestSize), loading(false), redirectCount(0)
{
@@ -1075,6 +1084,11 @@ bool QDeclarativePixmap::connectDownloadProgress(QObject *object, int method)
return QMetaObject::connect(d->reply, QDeclarativePixmapReply::downloadProgressIndex, object, method);
}
+void QDeclarativePixmap::flushCache()
+{
+ pixmapStore()->flushCache();
+}
+
QT_END_NAMESPACE
#include <qdeclarativepixmapcache.moc>
diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h
index 396c1963a3..4976906cf1 100644
--- a/src/declarative/util/qdeclarativepixmapcache_p.h
+++ b/src/declarative/util/qdeclarativepixmapcache_p.h
@@ -103,6 +103,8 @@ public:
bool connectDownloadProgress(QObject *, const char *);
bool connectDownloadProgress(QObject *, int);
+ static void flushCache();
+
private:
Q_DISABLE_COPY(QDeclarativePixmap)
QDeclarativePixmapData *d;
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 273060b9c1..b63407c66a 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -130,6 +130,9 @@ public:
endState->complete();
}
static void append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a);
+ static int animation_count(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list);
+ static QDeclarativeAbstractAnimation* animation_at(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, int pos);
+ static void clear_animations(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list);
QList<QDeclarativeAbstractAnimation *> animations;
};
@@ -141,6 +144,28 @@ void QDeclarativeTransitionPrivate::append_animation(QDeclarativeListProperty<QD
a->setDisableUserControl();
}
+int QDeclarativeTransitionPrivate::animation_count(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ return q->d_func()->animations.count();
+}
+
+QDeclarativeAbstractAnimation* QDeclarativeTransitionPrivate::animation_at(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, int pos)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ return q->d_func()->animations.at(pos);
+}
+
+void QDeclarativeTransitionPrivate::clear_animations(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ while (q->d_func()->animations.count()) {
+ QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0);
+ q->d_func()->group.removeAnimation(firstAnim->qtAnimation());
+ q->d_func()->animations.removeAll(firstAnim);
+ }
+}
+
void ParallelAnimationWrapper::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
{
QParallelAnimationGroup::updateState(newState, oldState);
@@ -309,7 +334,10 @@ void QDeclarativeTransition::setToState(const QString &t)
QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeTransition::animations()
{
Q_D(QDeclarativeTransition);
- return QDeclarativeListProperty<QDeclarativeAbstractAnimation>(this, &d->animations, QDeclarativeTransitionPrivate::append_animation);
+ return QDeclarativeListProperty<QDeclarativeAbstractAnimation>(this, &d->animations, QDeclarativeTransitionPrivate::append_animation,
+ QDeclarativeTransitionPrivate::animation_count,
+ QDeclarativeTransitionPrivate::animation_at,
+ QDeclarativeTransitionPrivate::clear_animations);
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp
index 944b37faf8..6e96ac914c 100644
--- a/src/declarative/util/qdeclarativetransitionmanager.cpp
+++ b/src/declarative/util/qdeclarativetransitionmanager.cpp
@@ -56,12 +56,12 @@ class QDeclarativeTransitionManagerPrivate
{
public:
QDeclarativeTransitionManagerPrivate()
- : state(0), transition(0) {}
+ : state(0) {}
void applyBindings();
typedef QList<QDeclarativeSimpleAction> SimpleActionList;
QDeclarativeState *state;
- QDeclarativeTransition *transition;
+ QDeclarativeGuard<QDeclarativeTransition> transition;
QDeclarativeStateOperation::ActionList bindingsList;
SimpleActionList completeList;
};
@@ -253,7 +253,7 @@ void QDeclarativeTransitionManager::cancel()
{
if (d->transition) {
// ### this could potentially trigger a complete in rare circumstances
- d->transition->stop();
+ d->transition->stop();
d->transition = 0;
}
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index f6be2d78d7..bab991b175 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -49,7 +49,7 @@
#include <qdeclarativeguard_p.h>
#include <private/qdeclarativedebugtrace_p.h>
-#include <private/qdeclarativeobserverservice_p.h>
+#include <private/qdeclarativeinspectorservice_p.h>
#include <qscriptvalueiterator.h>
#include <qdebug.h>
@@ -301,7 +301,7 @@ void QDeclarativeViewPrivate::init()
q->viewport()->setAttribute(Qt::WA_NoSystemBackground);
#endif
- QDeclarativeObserverService::instance()->addView(q);
+ QDeclarativeInspectorService::instance()->addView(q);
}
/*!
@@ -309,7 +309,7 @@ void QDeclarativeViewPrivate::init()
*/
QDeclarativeView::~QDeclarativeView()
{
- QDeclarativeObserverService::instance()->removeView(this);
+ QDeclarativeInspectorService::instance()->removeView(this);
}
/*! \property QDeclarativeView::source
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 00427eb046..337bb9992d 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -212,42 +212,101 @@ QT_BEGIN_NAMESPACE
This enum type defines accessible event types.
- \value AcceleratorChanged
- \value Alert A system alert (e.g., a message from a QMessageBox)
- \value ContextHelpEnd Context help (QWhatsThis) for an object is finished.
- \value ContextHelpStart Context help (QWhatsThis) for an object is initiated.
- \value DefaultActionChanged The default QAccessible::Action for the accessible object changed
- \value DescriptionChanged The objects QAccessible::Description changed.
- \value DialogEnd A dialog (QDialog) is been hidden
- \value DialogStart A dialog (QDialog) has been set visible.
- \value DragDropEnd A Drag & Drop operation is about to finished.
- \value DragDropStart A Drag & Drop operation is about to be initiated.
- \value Focus An object has gained keyboard focus.
- \value ForegroundChanged A window has been activated (i.e., a new window has gained focus on the desktop)
- \value HelpChanged The QAccessible::Help text property of an object has changed
- \value LocationChanged An objects location on the screen changed
- \value MenuCommand A menu item is triggered.
- \value MenuEnd A menu has been closed (Qt uses PopupMenuEnd for all menus)
- \value MenuStart A menu has been opened on the menubar (Qt uses PopupMenuStart for all menus)
- \value NameChanged The QAccessible::Name property of an object has changed
- \value ObjectCreated A new object is created.
- \value ObjectDestroyed An object is deleted.
- \value ObjectHide An object is hidden (i.e., with QWidget::hide()). Any children the object that is hidden has do not send this event.
- It is not send when an object is hidden as it is being obcured by others.
- \value ObjectReorder A layout or item view has added, removed, or moved an object (Qt does not use this event).
- \value ObjectShow An object is displayed (i.e., with QWidget::show()).
- \value ParentChanged An objects parent object changed.
- \value PopupMenuEnd A popup menu has closed.
- \value PopupMenuStart A popupmenu has opened.
- \value ScrollingEnd A scrollbar scroll operation has ended (the mouse has released the slider handle)
- \value ScrollingStart A scrollbar scroll operation is about to start (i.e., the mouse has pressed on the slider handle)
- \value Selection The selection has changed in a menu or item view.
- \value SelectionAdd An item has been added to the selection in an item view.
- \value SelectionRemove An item has been removed from an item view selection.
- \value SelectionWithin Several changes to a selection has occurred in an item view.
- \value SoundPlayed A sound has been played by an object
- \value StateChanged The QAccessible::State of an object has changed.
- \value ValueChanged The QAccessible::Value of an object has changed.
+ \value AcceleratorChanged The keyboard accelerator for an action has been changed.
+ \value ActionChanged An action has been changed.
+ \value ActiveDescendantChanged
+ \value Alert A system alert (e.g., a message from a QMessageBox)
+ \value AttributeChanged
+ \value ContextHelpEnd Context help (QWhatsThis) for an object is finished.
+ \value ContextHelpStart Context help (QWhatsThis) for an object is initiated.
+ \value DefaultActionChanged The default QAccessible::Action for the accessible
+ object has changed.
+ \value DescriptionChanged The object's QAccessible::Description changed.
+ \value DialogEnd A dialog (QDialog) has been hidden
+ \value DialogStart A dialog (QDialog) has been set visible.
+ \value DocumentContentChanged The contents of a text document have changed.
+ \value DocumentLoadComplete A document has been loaded.
+ \value DocumentLoadStopped A document load has been stopped.
+ \value DocumentReload A document reload has been initiated.
+ \value DragDropEnd A drag and drop operation is about to finished.
+ \value DragDropStart A drag and drop operation is about to be initiated.
+ \value Focus An object has gained keyboard focus.
+ \value ForegroundChanged A window has been activated (i.e., a new window has
+ gained focus on the desktop).
+ \value HelpChanged The QAccessible::Help text property of an object has
+ changed.
+ \value HyperlinkEndIndexChanged The end position of the display text for a hypertext
+ link has changed.
+ \value HyperlinkNumberOfAnchorsChanged The number of anchors in a hypertext link has changed,
+ perhaps because the display text has been split to
+ provide more than one link.
+ \value HyperlinkSelectedLinkChanged The link for the selected hypertext link has changed.
+ \value HyperlinkStartIndexChanged The start position of the display text for a hypertext
+ link has changed.
+ \value HypertextChanged The display text for a hypertext link has changed.
+ \value HypertextLinkActivated A hypertext link has been activated, perhaps by being
+ clicked or via a key press.
+ \value HypertextLinkSelected A hypertext link has been selected.
+ \value HypertextNLinksChanged
+ \value LocationChanged An object's location on the screen has changed.
+ \value MenuCommand A menu item is triggered.
+ \value MenuEnd A menu has been closed (Qt uses PopupMenuEnd for all
+ menus).
+ \value MenuStart A menu has been opened on the menubar (Qt uses
+ PopupMenuStart for all menus).
+ \value NameChanged The QAccessible::Name property of an object has changed.
+ \value ObjectAttributeChanged
+ \value ObjectCreated A new object is created.
+ \value ObjectDestroyed An object is deleted.
+ \value ObjectHide An object is hidden; for example, with QWidget::hide().
+ Any children the object that is hidden has do not send
+ this event. It is not sent when an object is hidden as
+ it is being obcured by others.
+ \value ObjectReorder A layout or item view has added, removed, or moved an
+ object (Qt does not use this event).
+ \value ObjectShow An object is displayed; for example, with
+ QWidget::show().
+ \value PageChanged
+ \value ParentChanged An object's parent object changed.
+ \value PopupMenuEnd A pop-up menu has closed.
+ \value PopupMenuStart A pop-up menu has opened.
+ \value ScrollingEnd A scrollbar scroll operation has ended (the mouse has
+ released the slider handle).
+ \value ScrollingStart A scrollbar scroll operation is about to start; this may
+ be caused by a mouse press on the slider handle, for
+ example.
+ \value SectionChanged
+ \value SelectionAdd An item has been added to the selection in an item view.
+ \value SelectionRemove An item has been removed from an item view selection.
+ \value Selection The selection has changed in a menu or item view.
+ \value SelectionWithin Several changes to a selection has occurred in an item
+ view.
+ \value SoundPlayed A sound has been played by an object
+ \value StateChanged The QAccessible::State of an object has changed.
+ \value TableCaptionChanged A table caption has been changed.
+ \value TableColumnDescriptionChanged The description of a table column, typically found in
+ the column's header, has been changed.
+ \value TableColumnHeaderChanged A table column header has been changed.
+ \value TableModelChanged The model providing data for a table has been changed.
+ \value TableRowDescriptionChanged The description of a table row, typically found in the
+ row's header, has been changed.
+ \value TableRowHeaderChanged A table row header has been changed.
+ \value TableSummaryChanged The summary of a table has been changed.
+ \value TextAttributeChanged
+ \value TextCaretMoved The caret has moved in an editable widget.
+ The caret represents the cursor position in an editable
+ widget with the input focus.
+ \value TextColumnChanged A text column has been changed.
+ \value TextInserted Text has been inserted into an editable widget.
+ \value TextRemoved Text has been removed from an editable widget.
+ \value TextSelectionChanged The selected text has changed in an editable widget.
+ \value TextUpdated The text has been update in an editable widget.
+ \value ValueChanged The QAccessible::Value of an object has changed.
+ \value VisibleDataChanged
+
+ The values for this enum are defined to be the same as those defined in the
+ \l{AccessibleEventID.idl File Reference}{IAccessible2} and
+ \l{Microsoft Active Accessibility Event Constants}{MSAA} specifications.
*/
/*!
diff --git a/src/gui/accessible/qaccessiblewidget.cpp b/src/gui/accessible/qaccessiblewidget.cpp
index 60ed48f76b..6a7d7e97cc 100644
--- a/src/gui/accessible/qaccessiblewidget.cpp
+++ b/src/gui/accessible/qaccessiblewidget.cpp
@@ -704,13 +704,16 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
int sibCount = pIface->childCount();
QAccessibleInterface *candidate = 0;
for (int i = 0; i < sibCount && entry; ++i) {
- pIface->navigate(Child, i+1, &candidate);
- Q_ASSERT(candidate);
- if (candidate->relationTo(0, this, 0) & Label)
+ const int childId = pIface->navigate(Child, i+1, &candidate);
+ Q_ASSERT(childId >= 0);
+ if (childId > 0)
+ candidate = pIface;
+ if (candidate->relationTo(childId, this, 0) & Label)
--entry;
if (!entry)
break;
- delete candidate;
+ if (candidate != pIface)
+ delete candidate;
candidate = 0;
}
if (!candidate) {
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri
index 6ba707c9d3..1dddb44aad 100644
--- a/src/gui/dialogs/dialogs.pri
+++ b/src/gui/dialogs/dialogs.pri
@@ -109,7 +109,11 @@ SOURCES += \
dialogs/qprintpreviewdialog.cpp
symbian:contains(QT_CONFIG, s60) {
- LIBS += -lCommonDialogs
+ contains(CONFIG, is_using_gnupoc) {
+ LIBS += -lcommondialogs
+ } else {
+ LIBS += -lCommonDialogs
+ }
SOURCES += dialogs/qfiledialog_symbian.cpp \
dialogs/qcolordialog_symbian.cpp
}
diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp
index a4a7a228ba..16ef5b6e3f 100644
--- a/src/gui/dialogs/qfiledialog_symbian.cpp
+++ b/src/gui/dialogs/qfiledialog_symbian.cpp
@@ -44,7 +44,7 @@
#ifndef QT_NO_FILEDIALOG
#include <private/qfiledialog_p.h>
-#if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
#include <driveinfo.h>
#include <AknCommonDialogsDynMem.h>
#include <CAknMemorySelectionDialogMultiDrive.h>
@@ -58,7 +58,7 @@ extern QStringList qt_make_filter_list(const QString &filter); // defined in qfi
extern QStringList qt_clean_filter_list(const QString &filter); // defined in qfiledialog.cpp
enum DialogMode { DialogOpen, DialogSave, DialogFolder };
-#if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
class CExtensionFilter : public MAknFileFilter
{
public:
@@ -104,7 +104,7 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st
const QString filter, DialogMode dialogMode)
{
QString selection;
-#if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
TFileName startFolder;
if (!startDirectory.isEmpty()) {
QString dir = QDir::toNativeSeparators(QFileDialogPrivate::workingDirectory(startDirectory));
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
index 9b0d82e69f..15e7cabedd 100644
--- a/src/gui/egl/qegl_p.h
+++ b/src/gui/egl/qegl_p.h
@@ -165,13 +165,21 @@ typedef int EGLImageKHR;
typedef void *EGLImageKHR;
#endif
+#if !defined(EGL_NO_IMAGE_KHR)
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
+#endif
+#if !defined(EGL_IMAGE_PRESERVED_KHR)
#define EGL_IMAGE_PRESERVED_KHR 0x30D2
+#endif
+#if !defined(EGL_KHR_image_base)
#define EGL_KHR_image_base
#endif
+#endif
-#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_pixmap)
+#if !defined(EGL_KHR_image)
#define EGL_NATIVE_PIXMAP_KHR 0x30B0
+#endif
+#if !defined(EGL_KHR_image_pixmap)
#define EGL_KHR_image_pixmap
#endif
diff --git a/src/gui/embedded/qkbd_qws.cpp b/src/gui/embedded/qkbd_qws.cpp
index 77ae47bc73..5edc4d9240 100644
--- a/src/gui/embedded/qkbd_qws.cpp
+++ b/src/gui/embedded/qkbd_qws.cpp
@@ -225,7 +225,7 @@ bool QWSKbPrivate::loadKeymap(const QString &file)
ds >> qmap_magic >> qmap_version >> qmap_keymap_size >> qmap_keycompose_size;
if (ds.status() != QDataStream::Ok || qmap_magic != QWSKeyboard::FileMagic || qmap_version != 1 || qmap_keymap_size == 0) {
- qWarning("'%s' is ot a valid.qmap keymap file.", qPrintable(file));
+ qWarning("'%s' is not a valid .qmap keymap file.", qPrintable(file));
return false;
}
diff --git a/src/gui/embedded/qkbdum_qws.cpp b/src/gui/embedded/qkbdum_qws.cpp
index 4fbe03e319..97561b5d80 100644
--- a/src/gui/embedded/qkbdum_qws.cpp
+++ b/src/gui/embedded/qkbdum_qws.cpp
@@ -40,7 +40,6 @@
****************************************************************************/
#include "qkbdum_qws.h"
-#include "qvfbhdr.h"
#if !defined(QT_NO_QWS_KEYBOARD) && !defined(QT_NO_QWS_KBD_UM)
@@ -55,6 +54,7 @@
#include <qwindowsystem_qws.h>
#include <qsocketnotifier.h>
#include "qplatformdefs.h"
+#include "qvfbhdr.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/embedded/qlock.cpp b/src/gui/embedded/qlock.cpp
index bb442e4aaf..ac154313cf 100644
--- a/src/gui/embedded/qlock.cpp
+++ b/src/gui/embedded/qlock.cpp
@@ -99,7 +99,6 @@ QT_END_NAMESPACE
#endif
#include <string.h>
#include <errno.h>
-#include <qdebug.h>
#include <private/qcore_unix_p.h> // overrides QT_OPEN
@@ -138,8 +137,6 @@ public:
*/
/*!
- \fn QLock::QLock(const QString &filename, char id, bool create)
-
Creates a lock. \a filename is the file path of the Unix-domain
socket the \l{Qt for Embedded Linux} client is using. \a id is the name of the
particular lock to be created on that socket. If \a create is true
@@ -147,76 +144,79 @@ public:
create is false the lock should exist already (as the Qt for Embedded Linux
client expects).
*/
-
QLock::QLock(const QString &filename, char id, bool create)
{
data = new QLockData;
data->count = 0;
#ifdef Q_NO_SEMAPHORE
- data->file = QString(filename+id).toLocal8Bit().constData();
- for(int x = 0; x < 2; x++) {
- data->id = QT_OPEN(data->file, O_RDWR | (x ? O_CREAT : 0), S_IRWXU);
- if(data->id != -1 || !create) {
+ data->file = filename.toLocal8Bit() + id;
+ for (int x = 0; x < 2; ++x) {
+ data->id = QT_OPEN(data->file.constData(), O_RDWR | (x ? O_CREAT : 0), S_IRWXU);
+ if (data->id != -1 || !create) {
data->owned = x;
break;
}
}
#else
key_t semkey = ftok(filename.toLocal8Bit().constData(), id);
- data->id = semget(semkey,0,0);
+ data->id = semget(semkey, 0, 0);
data->owned = create;
if (create) {
- qt_semun arg; arg.val = 0;
+ qt_semun arg;
+ arg.val = 0;
if (data->id != -1)
- semctl(data->id,0,IPC_RMID,arg);
- data->id = semget(semkey,1,IPC_CREAT|0600);
+ semctl(data->id, 0, IPC_RMID, arg);
+ data->id = semget(semkey, 1, IPC_CREAT | 0600);
arg.val = MAX_LOCKS;
- semctl(data->id,0,SETVAL,arg);
-
- QWSSignalHandler::instance()->addSemaphore(data->id);
+ semctl(data->id, 0, SETVAL, arg);
}
#endif
- if (data->id == -1) {
- int eno = errno;
- qWarning("Cannot %s semaphore %s '%c'", (create ? "create" : "get"),
- qPrintable(filename), id);
- qDebug() << "Error" << eno << strerror(eno);
+ if (!isValid()) {
+ qWarning("QLock::QLock: Cannot %s semaphore %s '%c' (%d, %s)",
+ (create ? "create" : "get"), qPrintable(filename), id,
+ errno, strerror(errno));
}
+
+#ifndef QT_NO_QWS_SIGNALHANDLER
+ QWSSignalHandler::instance()->addLock(this);
+#endif
}
/*!
- \fn QLock::~QLock()
-
Destroys a lock
*/
-
QLock::~QLock()
{
- if (locked())
+#ifndef QT_NO_QWS_SIGNALHANDLER
+ QWSSignalHandler::instance()->removeLock(this);
+#endif
+
+ while (locked())
unlock();
#ifdef Q_NO_SEMAPHORE
- if(isValid()) {
+ if (isValid())
QT_CLOSE(data->id);
- if(data->owned)
- unlink(data->file);
- }
+#endif
+ if (data->owned) {
+#ifdef Q_NO_SEMAPHORE
+ unlink(data->file.constData());
#else
- if(data->owned)
- QWSSignalHandler::instance()->removeSemaphore(data->id);
+ qt_semun semval;
+ semval.val = 0;
+ semctl(data->id, 0, IPC_RMID, semval);
#endif
+ }
delete data;
+ data = 0;
}
/*!
- \fn bool QLock::isValid() const
-
Returns true if the lock constructor was successful; returns false if
the lock could not be created or was not available to connect to.
*/
-
bool QLock::isValid() const
{
- return (data->id != -1);
+ return data && data->id != -1;
}
/*!
@@ -230,96 +230,72 @@ bool QLock::isValid() const
will only be unlocked after a corresponding number of unlock()
calls.
*/
-
void QLock::lock(Type t)
{
if (!data->count) {
+ type = t;
+
+ int rv;
#ifdef Q_NO_SEMAPHORE
- int op = LOCK_SH;
- if(t == Write)
- op = LOCK_EX;
- for(int rv=1; rv;) {
- rv = flock(data->id, op);
- if (rv == -1 && errno != EINTR)
- qDebug("Semop lock failure %s",strerror(errno));
- }
+ int op = type == Write ? LOCK_EX : LOCK_SH;
+
+ EINTR_LOOP(rv, flock(data->id, op));
#else
sembuf sops;
sops.sem_num = 0;
+ sops.sem_op = type == Write ? -MAX_LOCKS : -1;
sops.sem_flg = SEM_UNDO;
- if (t == Write) {
- sops.sem_op = -MAX_LOCKS;
- type = Write;
- } else {
- sops.sem_op = -1;
- type = Read;
- }
-
- int rv;
- do {
- rv = semop(data->id,&sops,1);
- if (rv == -1 && errno != EINTR)
- qDebug("Semop lock failure %s",strerror(errno));
- } while (rv == -1 && errno == EINTR);
+ EINTR_LOOP(rv, semop(data->id, &sops, 1));
#endif
+ if (rv == -1) {
+ qDebug("QLock::lock(): %s", strerror(errno));
+ return;
+ }
+ } else if (type == Read && t == Write) {
+ qDebug("QLock::lock(): Attempt to lock for write while locked for read");
}
data->count++;
}
/*!
- \fn void QLock::unlock()
-
Unlocks the semaphore. If other processes were blocking waiting to
lock() the semaphore, one of them will wake up and succeed in
- lock()ing.
+ locking.
*/
-
void QLock::unlock()
{
- if(data->count) {
+ if (data->count) {
data->count--;
- if(!data->count) {
+ if (!data->count) {
+ int rv;
#ifdef Q_NO_SEMAPHORE
- for(int rv=1; rv;) {
- rv = flock(data->id, LOCK_UN);
- if (rv == -1 && errno != EINTR)
- qDebug("Semop lock failure %s",strerror(errno));
- }
+ EINTR_LOOP(rv, flock(data->id, LOCK_UN));
#else
sembuf sops;
sops.sem_num = 0;
- sops.sem_op = 1;
+ sops.sem_op = type == Write ? MAX_LOCKS : 1;
sops.sem_flg = SEM_UNDO;
- if (type == Write)
- sops.sem_op = MAX_LOCKS;
- int rv;
- do {
- rv = semop(data->id,&sops,1);
- if (rv == -1 && errno != EINTR)
- qDebug("Semop unlock failure %s",strerror(errno));
- } while (rv == -1 && errno == EINTR);
+ EINTR_LOOP(rv, semop(data->id, &sops, 1));
#endif
+ if (rv == -1)
+ qDebug("QLock::unlock(): %s", strerror(errno));
}
} else {
- qDebug("Unlock without corresponding lock");
+ qDebug("QLock::unlock(): Unlock without corresponding lock");
}
}
/*!
- \fn bool QLock::locked() const
-
Returns true if the lock is currently held by the current process;
otherwise returns false.
*/
-
bool QLock::locked() const
{
- return (data->count > 0);
+ return isValid() && data->count > 0;
}
QT_END_NAMESPACE
#endif // QT_NO_QWS_MULTIPROCESS
-
diff --git a/src/gui/embedded/qmousepc_qws.cpp b/src/gui/embedded/qmousepc_qws.cpp
index 5d3b182d0a..c22cab91f2 100644
--- a/src/gui/embedded/qmousepc_qws.cpp
+++ b/src/gui/embedded/qmousepc_qws.cpp
@@ -261,7 +261,7 @@ public:
usleep(50000);
QT_WRITE(fd,"@EeI!",5);
usleep(10000);
- static const char ibuf[] = { 246, 244 };
+ static const unsigned char ibuf[] = { 246, 244 };
QT_WRITE(fd,ibuf,1);
QT_WRITE(fd,ibuf+1,1);
if (tcflush(fd,TCIOFLUSH) == -1) {
diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp
index 67c8a31cd9..4b41b5ba1b 100644
--- a/src/gui/embedded/qscreenlinuxfb_qws.cpp
+++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp
@@ -110,7 +110,9 @@ QLinuxFbScreenPrivate::QLinuxFbScreenPrivate()
#endif
ttyfd(-1), oldKdMode(KD_TEXT)
{
+#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addObject(this);
+#endif
}
QLinuxFbScreenPrivate::~QLinuxFbScreenPrivate()
@@ -263,6 +265,9 @@ QLinuxFbScreen::QLinuxFbScreen(int display_id)
QLinuxFbScreen::~QLinuxFbScreen()
{
+#ifdef QT_NO_QWS_SIGNALHANDLER
+ delete d_ptr;
+#endif
}
/*!
diff --git a/src/gui/embedded/qwindowsystem_qws.cpp b/src/gui/embedded/qwindowsystem_qws.cpp
index 0e4e27c852..36802a8ba8 100644
--- a/src/gui/embedded/qwindowsystem_qws.cpp
+++ b/src/gui/embedded/qwindowsystem_qws.cpp
@@ -2494,7 +2494,7 @@ QWSWindow *QWSServer::windowAt(const QPoint& pos)
}
#ifndef QT_NO_QWS_KEYBOARD
-static int keyUnicode(int keycode)
+static inline int keyUnicode(int keycode)
{
int code = 0xffff;
@@ -2550,18 +2550,16 @@ void QWSServer::sendKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers mod
void QWSServerPrivate::sendKeyEventUnfiltered(int unicode, int keycode, Qt::KeyboardModifiers modifiers,
bool isPress, bool autoRepeat)
{
+ QWSWindow *win = keyboardGrabber ? keyboardGrabber : qwsServerPrivate->focusw;
- QWSKeyEvent event;
- QWSWindow *win = keyboardGrabber ? keyboardGrabber :
- qwsServerPrivate->focusw;
-
- event.simpleData.window = win ? win->winId() : 0;
-
- event.simpleData.unicode =
#ifndef QT_NO_QWS_KEYBOARD
- unicode < 0 ? keyUnicode(keycode) :
+ if (unicode < 0)
+ unicode = keyUnicode(keycode);
#endif
- unicode;
+
+ QWSKeyEvent event;
+ event.simpleData.window = win ? win->winId() : 0;
+ event.simpleData.unicode = unicode;
event.simpleData.keycode = keycode;
event.simpleData.modifiers = modifiers;
event.simpleData.is_press = isPress;
@@ -4127,11 +4125,11 @@ void QWSServer::processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers
#endif
// If we press a key and it's going to be blocked, wake up the screen
- if ( block && isPress )
- qwsServerPrivate->_q_screenSaverWake();
-
- if ( block )
+ if (block) {
+ if (isPress)
+ qwsServerPrivate->_q_screenSaverWake();
return;
+ }
if (keyFilters) {
for (int i = 0; i < keyFilters->size(); ++i) {
diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp
index 0d65b61177..c14f50b1ae 100644
--- a/src/gui/embedded/qwslock.cpp
+++ b/src/gui/embedded/qwslock.cpp
@@ -45,8 +45,6 @@
#include "qwssignalhandler_p.h"
-#include <qglobal.h>
-#include <qdebug.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
@@ -68,164 +66,141 @@ QT_BEGIN_NAMESPACE
#error QWSLock currently requires semaphores
#endif
-QWSLock::QWSLock()
+QWSLock::QWSLock(int id) : semId(id)
{
- semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
+ static unsigned short initialValues[3] = { 1, 1, 0 };
- if (semId == -1) {
- perror("QWSLock::QWSLock");
- qFatal("Unable to create semaphore");
- }
- QWSSignalHandler::instance()->addSemaphore(semId);
-
- qt_semun semval;
- semval.val = 1;
-
- if (semctl(semId, BackingStore, SETVAL, semval) == -1) {
- perror("QWSLock::QWSLock");
- qFatal("Unable to initialize backingstore semaphore");
- }
- lockCount[BackingStore] = 0;
-
- if (semctl(semId, Communication, SETVAL, semval) == -1) {
- perror("QWSLock::QWSLock");
- qFatal("Unable to initialize communication semaphore");
- }
- lockCount[Communication] = 0;
+#ifndef QT_NO_QWS_SIGNALHANDLER
+ QWSSignalHandler::instance()->addWSLock(this);
+#endif
- semval.val = 0;
- if (semctl(semId, RegionEvent, SETVAL, semval) == -1) {
- perror("QWSLock::QWSLock");
- qFatal("Unable to initialize region event semaphore");
+ if (semId == -1) {
+ semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
+ if (semId == -1) {
+ perror("QWSLock::QWSLock");
+ qFatal("Unable to create semaphore");
+ }
+
+ qt_semun semval;
+ semval.array = initialValues;
+ if (semctl(semId, 0, SETALL, semval) == -1) {
+ perror("QWSLock::QWSLock");
+ qFatal("Unable to initialize semaphores");
+ }
}
-}
-QWSLock::QWSLock(int id)
-{
- semId = id;
- QWSSignalHandler::instance()->addSemaphore(semId);
lockCount[0] = lockCount[1] = 0;
}
QWSLock::~QWSLock()
{
- if (semId == -1)
- return;
- QWSSignalHandler::instance()->removeSemaphore(semId);
-}
+#ifndef QT_NO_QWS_SIGNALHANDLER
+ QWSSignalHandler::instance()->removeWSLock(this);
+#endif
-static bool forceLock(int semId, int semNum, int)
-{
- int ret;
- do {
- sembuf sops = { semNum, -1, 0 };
-
- // As the BackingStore lock is a mutex, and only one process may own
- // the lock, it's safe to use SEM_UNDO. On the other hand, the
- // Communication lock is locked by the client but unlocked by the
- // server and therefore can't use SEM_UNDO.
- if (semNum == QWSLock::BackingStore)
- sops.sem_flg |= SEM_UNDO;
-
- ret = semop(semId, &sops, 1);
- if (ret == -1 && errno != EINTR)
- qDebug("QWSLock::lock: %s", strerror(errno));
- } while (ret == -1 && errno == EINTR);
-
- return (ret != -1);
+ if (semId != -1) {
+ qt_semun semval;
+ semval.val = 0;
+ semctl(semId, 0, IPC_RMID, semval);
+ semId = -1;
+ }
}
-static bool up(int semId, int semNum)
+bool QWSLock::up(unsigned short semNum)
{
int ret;
- do {
- sembuf sops = { semNum, 1, 0 };
- ret = semop(semId, &sops, 1);
- if (ret == -1 && errno != EINTR)
- qDebug("QWSLock::up: %s", strerror(errno));
- } while (ret == -1 && errno == EINTR);
-
- return (ret != -1);
+
+ sembuf sops = { semNum, 1, 0 };
+ // As the BackingStore lock is a mutex, and only one process may own
+ // the lock, it's safe to use SEM_UNDO. On the other hand, the
+ // Communication lock is locked by the client but unlocked by the
+ // server and therefore can't use SEM_UNDO.
+ if (semNum == BackingStore)
+ sops.sem_flg |= SEM_UNDO;
+
+ EINTR_LOOP(ret, semop(semId, &sops, 1));
+ if (ret == -1) {
+ qDebug("QWSLock::up(): %s", strerror(errno));
+ return false;
+ }
+
+ return true;
}
-static bool down(int semId, int semNum)
+bool QWSLock::down(unsigned short semNum, int)
{
int ret;
- do {
- sembuf sops = { semNum, -1, 0 };
- ret = semop(semId, &sops, 1);
- if (ret == -1 && errno != EINTR)
- qDebug("QWSLock::down: %s", strerror(errno));
- } while (ret == -1 && errno == EINTR);
-
- return (ret != -1);
+
+ sembuf sops = { semNum, -1, 0 };
+ // As the BackingStore lock is a mutex, and only one process may own
+ // the lock, it's safe to use SEM_UNDO. On the other hand, the
+ // Communication lock is locked by the client but unlocked by the
+ // server and therefore can't use SEM_UNDO.
+ if (semNum == BackingStore)
+ sops.sem_flg |= SEM_UNDO;
+
+ EINTR_LOOP(ret, semop(semId, &sops, 1));
+ if (ret == -1) {
+ qDebug("QWSLock::down(): %s", strerror(errno));
+ return false;
+ }
+
+ return true;
}
-static int getValue(int semId, int semNum)
+int QWSLock::getValue(unsigned short semNum) const
{
- int ret;
- do {
- ret = semctl(semId, semNum, GETVAL, 0);
- if (ret == -1 && errno != EINTR)
- qDebug("QWSLock::getValue: %s", strerror(errno));
- } while (ret == -1 && errno == EINTR);
-
+ int ret = semctl(semId, semNum, GETVAL, 0);
+ if (ret == -1)
+ qDebug("QWSLock::getValue(): %s", strerror(errno));
return ret;
}
bool QWSLock::lock(LockType type, int timeout)
{
if (type == RegionEvent)
- return up(semId, RegionEvent);
+ return up(type);
- if (hasLock(type)) {
+ if (lockCount[type] > 0) {
++lockCount[type];
return true;
}
- if (!forceLock(semId, type, timeout))
- return false;
- ++lockCount[type];
- return true;
+ if (down(type, timeout)) {
+ ++lockCount[type];
+ return true;
+ }
+
+ return false;
}
bool QWSLock::hasLock(LockType type)
{
if (type == RegionEvent)
- return (getValue(semId, RegionEvent) == 0);
+ return getValue(type) == 0;
- return (lockCount[type] > 0);
+ return lockCount[type] > 0;
}
void QWSLock::unlock(LockType type)
{
if (type == RegionEvent) {
- down(semId, RegionEvent);
+ down(type, -1);
return;
}
- if (hasLock(type)) {
+ if (lockCount[type] > 0) {
--lockCount[type];
- if (hasLock(type))
+ if (lockCount[type] > 0)
return;
}
- const int semNum = type;
- int ret;
- do {
- sembuf sops = {semNum, 1, 0};
- if (semNum == QWSLock::BackingStore)
- sops.sem_flg |= SEM_UNDO;
-
- ret = semop(semId, &sops, 1);
- if (ret == -1 && errno != EINTR)
- qDebug("QWSLock::unlock: %s", strerror(errno));
- } while (ret == -1 && errno == EINTR);
+ up(type);
}
bool QWSLock::wait(LockType type, int timeout)
{
- bool ok = forceLock(semId, type, timeout);
+ bool ok = down(type, timeout);
if (ok)
unlock(type);
return ok;
diff --git a/src/gui/embedded/qwslock_p.h b/src/gui/embedded/qwslock_p.h
index 9a7f27979b..d020b22cb4 100644
--- a/src/gui/embedded/qwslock_p.h
+++ b/src/gui/embedded/qwslock_p.h
@@ -55,17 +55,16 @@
#include <qglobal.h>
-QT_BEGIN_NAMESPACE
-
#ifndef QT_NO_QWS_MULTIPROCESS
+QT_BEGIN_NAMESPACE
+
class QWSLock
{
public:
enum LockType { BackingStore, Communication, RegionEvent };
- QWSLock();
- QWSLock(int lockId);
+ QWSLock(int lockId = -1);
~QWSLock();
bool lock(LockType type, int timeout = -1);
@@ -75,11 +74,16 @@ public:
int id() const { return semId; }
private:
+ bool up(unsigned short semNum);
+ bool down(unsigned short semNum, int timeout);
+ int getValue(unsigned short semNum) const;
+
int semId;
int lockCount[2];
};
-
QT_END_NAMESPACE
+
#endif // QT_NO_QWS_MULTIPROCESS
+
#endif // QWSLOCK_P_H
diff --git a/src/gui/embedded/qwssharedmemory.cpp b/src/gui/embedded/qwssharedmemory.cpp
index 66bedee111..a677626678 100644
--- a/src/gui/embedded/qwssharedmemory.cpp
+++ b/src/gui/embedded/qwssharedmemory.cpp
@@ -43,51 +43,51 @@
#if !defined(QT_NO_QWS_MULTIPROCESS)
+#include <sys/types.h>
+#include <sys/ipc.h>
#include <sys/shm.h>
+//#define QT_SHM_DEBUG
+
QT_BEGIN_NAMESPACE
QWSSharedMemory::QWSSharedMemory()
- : shmBase(0), shmSize(0), character(0), shmId(-1), key(-1)
+ : shmId(-1), shmBase(0), shmSize(0)
{
}
-
QWSSharedMemory::~QWSSharedMemory()
{
detach();
}
-/*
- man page says:
- On Linux, it is possible to attach a shared memory segment even if it
- is already marked to be deleted. However, POSIX.1-2001 does not spec-
- ify this behaviour and many other implementations do not support it.
-*/
-
bool QWSSharedMemory::create(int size)
{
if (shmId != -1)
detach();
- shmId = shmget(IPC_PRIVATE, size, IPC_CREAT|0600);
+ shmId = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600);
if (shmId == -1) {
#ifdef QT_SHM_DEBUG
- perror("QWSSharedMemory::create allocating shared memory");
+ perror("QWSSharedMemory::create():");
qWarning("Error allocating shared memory of size %d", size);
#endif
return false;
}
- shmBase = shmat(shmId,0,0);
+ shmBase = shmat(shmId, 0, 0);
+ // On Linux, it is possible to attach a shared memory segment even if it
+ // is already marked to be deleted. However, POSIX.1-2001 does not specify
+ // this behaviour and many other implementations do not support it.
shmctl(shmId, IPC_RMID, 0);
- if (shmBase == (void*)-1) {
+ if (shmBase == (void*)-1 || !shmBase) {
#ifdef QT_SHM_DEBUG
- perror("QWSSharedMemory::create attaching to shared memory");
+ perror("QWSSharedMemory::create():");
qWarning("Error attaching to shared memory id %d", shmId);
#endif
- shmBase = 0;
+ detach();
return false;
}
+
return true;
}
@@ -95,91 +95,49 @@ bool QWSSharedMemory::attach(int id)
{
if (shmId == id)
return id != -1;
- if (shmId != -1)
- detach();
- shmBase = shmat(id,0,0);
- if (shmBase == (void*)-1) {
+ detach();
+
+ if (id == -1)
+ return false;
+
+ shmId = id;
+ shmBase = shmat(shmId, 0, 0);
+ if (shmBase == (void*)-1 || !shmBase) {
#ifdef QT_SHM_DEBUG
- perror("QWSSharedMemory::attach attaching to shared memory");
- qWarning("Error attaching to shared memory 0x%x of size %d",
- id, size());
+ perror("QWSSharedMemory::attach():");
+ qWarning("Error attaching to shared memory id %d", shmId);
#endif
- shmBase = 0;
+ detach();
return false;
}
- shmId = id;
+
return true;
}
-
-void QWSSharedMemory::detach ()
+void QWSSharedMemory::detach()
{
- if (!shmBase)
- return;
- shmdt (shmBase);
+ if (shmBase && shmBase != (void*)-1)
+ shmdt(shmBase);
shmBase = 0;
shmSize = 0;
shmId = -1;
}
-void QWSSharedMemory::setPermissions (mode_t mode)
+int QWSSharedMemory::size() const
{
- struct shmid_ds shm;
- shmctl (shmId, IPC_STAT, &shm);
- shm.shm_perm.mode = mode;
- shmctl (shmId, IPC_SET, &shm);
-}
-
-int QWSSharedMemory::size () const
-{
- struct shmid_ds shm;
- shmctl (shmId, IPC_STAT, &shm);
- return shm.shm_segsz;
-}
+ if (shmId == -1)
+ return 0;
+ if (!shmSize) {
+ struct shmid_ds shm;
+ shmctl(shmId, IPC_STAT, &shm);
+ const_cast<QWSSharedMemory *>(this)->shmSize = shm.shm_segsz;
+ }
-// old API
-
-
-
-QWSSharedMemory::QWSSharedMemory (int size, const QString &filename, char c)
-{
- shmSize = size;
- shmFile = filename;
- shmBase = 0;
- shmId = -1;
- character = c;
- key = ftok (shmFile.toLatin1().constData(), c);
-}
-
-
-
-bool QWSSharedMemory::create ()
-{
- shmId = shmget (key, shmSize, IPC_CREAT | 0666);
- return (shmId != -1);
-}
-
-void QWSSharedMemory::destroy ()
-{
- if (shmId != -1)
- shmctl(shmId, IPC_RMID, 0);
-}
-
-bool QWSSharedMemory::attach ()
-{
- if (shmId == -1)
- shmId = shmget (key, shmSize, 0);
-
- shmBase = shmat (shmId, 0, 0);
- if ((long)shmBase == -1)
- shmBase = 0;
-
- return (long)shmBase != 0;
+ return shmSize;
}
-
QT_END_NAMESPACE
#endif // QT_NO_QWS_MULTIPROCESS
diff --git a/src/gui/embedded/qwssharedmemory_p.h b/src/gui/embedded/qwssharedmemory_p.h
index 31e69c4a83..f3ce24101b 100644
--- a/src/gui/embedded/qwssharedmemory_p.h
+++ b/src/gui/embedded/qwssharedmemory_p.h
@@ -53,49 +53,31 @@
// We mean it.
//
-#include "qplatformdefs.h"
-#include "QtCore/qstring.h"
+#include <qplatformdefs.h>
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_QWS_MULTIPROCESS)
-class QWSSharedMemory {
+class QWSSharedMemory
+{
public:
-
QWSSharedMemory();
~QWSSharedMemory();
- void setPermissions(mode_t mode);
- int size() const;
- void *address() { return shmBase; }
-
- int id() const { return shmId; }
-
- void detach();
-
bool create(int size);
bool attach(int id);
+ void detach();
- //bool create(int size, const QString &filename, char c = 'Q');
- //bool attach(const QString &filename, char c = 'Q');
-// old API
-
- QWSSharedMemory(int, const QString &, char c = 'Q');
- void * base() { return address(); }
-
- bool create();
- void destroy();
+ int id() const { return shmId; }
- bool attach();
+ void *address() const { return shmBase; }
+ int size() const;
private:
+ int shmId;
void *shmBase;
int shmSize;
- QString shmFile;
- char character;
- int shmId;
- key_t key;
};
#endif // QT_NO_QWS_MULTIPROCESS
diff --git a/src/gui/embedded/qwssignalhandler.cpp b/src/gui/embedded/qwssignalhandler.cpp
index 730dbae138..b13a57d335 100644
--- a/src/gui/embedded/qwssignalhandler.cpp
+++ b/src/gui/embedded/qwssignalhandler.cpp
@@ -43,13 +43,10 @@
#ifndef QT_NO_QWS_SIGNALHANDLER
-#include <sys/types.h>
-#ifndef QT_NO_QWS_MULTIPROCESS
-# include <sys/ipc.h>
-# include <sys/sem.h>
+#include "qlock_p.h"
+#include "qwslock_p.h"
-# include <private/qcore_unix_p.h>
-#endif
+#include <sys/types.h>
#include <signal.h>
QT_BEGIN_NAMESPACE
@@ -87,42 +84,33 @@ QWSSignalHandler::QWSSignalHandler()
QWSSignalHandler::~QWSSignalHandler()
{
-#ifndef QT_NO_QWS_MULTIPROCESS
- while (!semaphores.isEmpty())
- removeSemaphore(semaphores.last());
-#endif
+ clear();
}
-#ifndef QT_NO_QWS_MULTIPROCESS
-void QWSSignalHandler::removeSemaphore(int semno)
+void QWSSignalHandler::clear()
{
- const int index = semaphores.lastIndexOf(semno);
- if (index != -1) {
- qt_semun semval;
- semval.val = 0;
- semctl(semaphores.at(index), 0, IPC_RMID, semval);
- semaphores.remove(index);
- }
+#if !defined(QT_NO_QWS_MULTIPROCESS)
+ // it is safe to call d-tors directly here since, on normal exit,
+ // lists should be empty; otherwise, we don't care about semi-alive objects
+ // and the only important thing here is to unregister the system semaphores.
+ while (!locks.isEmpty())
+ locks.takeLast()->~QLock();
+ while (!wslocks.isEmpty())
+ wslocks.takeLast()->~QWSLock();
+#endif
+ objects.clear();
}
-#endif // QT_NO_QWS_MULTIPROCESS
void QWSSignalHandler::handleSignal(int signum)
{
QWSSignalHandler *h = instance();
-
- signal(signum, h->oldHandlers[signum]);
-
-#ifndef QT_NO_QWS_MULTIPROCESS
- qt_semun semval;
- semval.val = 0;
- for (int i = 0; i < h->semaphores.size(); ++i)
- semctl(h->semaphores.at(i), 0, IPC_RMID, semval);
-#endif
-
- h->objects.clear();
+ if (h) {
+ signal(signum, h->oldHandlers[signum]);
+ h->clear();
+ }
raise(signum);
}
QT_END_NAMESPACE
-#endif // QT_QWS_NO_SIGNALHANDLER
+#endif // QT_NO_QWS_SIGNALHANDLER
diff --git a/src/gui/embedded/qwssignalhandler_p.h b/src/gui/embedded/qwssignalhandler_p.h
index dda9c76287..217eda1d8f 100644
--- a/src/gui/embedded/qwssignalhandler_p.h
+++ b/src/gui/embedded/qwssignalhandler_p.h
@@ -57,14 +57,17 @@
#ifndef QT_NO_QWS_SIGNALHANDLER
-#include <QtCore/qmap.h>
-#include <QtCore/qvector.h>
+#include <QtCore/qhash.h>
+#include <QtCore/qlist.h>
#include <QtCore/qobjectcleanuphandler.h>
QT_BEGIN_NAMESPACE
typedef void (*qt_sighandler_t)(int);
+class QLock;
+class QWSLock;
+
class QWSSignalHandlerPrivate;
class Q_GUI_EXPORT QWSSignalHandler
@@ -75,17 +78,24 @@ public:
~QWSSignalHandler();
#ifndef QT_NO_QWS_MULTIPROCESS
- inline void addSemaphore(int semno) { semaphores.append(semno); }
- void removeSemaphore(int semno);
+ inline void addLock(QLock *lock) { locks.append(lock); }
+ inline void removeLock(QLock *lock) { locks.removeOne(lock); }
+ inline void addWSLock(QWSLock *wslock) { wslocks.append(wslock); }
+ inline void removeWSLock(QWSLock *wslock) { wslocks.removeOne(wslock); }
#endif
inline void addObject(QObject *object) { (void)objects.add(object); }
private:
QWSSignalHandler();
+
+ void clear();
+
static void handleSignal(int signal);
- QMap<int, qt_sighandler_t> oldHandlers;
+
+ QHash<int, qt_sighandler_t> oldHandlers;
#ifndef QT_NO_QWS_MULTIPROCESS
- QVector<int> semaphores;
+ QList<QLock *> locks;
+ QList<QWSLock *> wslocks;
#endif
QObjectCleanupHandler objects;
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index cd6416c792..76d2d040c7 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -478,7 +478,7 @@ static bool g_instantInvalidatePropagation = false;
/*!
\internal
\since 4.8
- \see instantInvalidatePropagation
+ \sa instantInvalidatePropagation()
Calling this function with \a enable set to true will enable a feature that
makes propagation of invalidation up to ancestor layout items to be done in
@@ -489,7 +489,7 @@ static bool g_instantInvalidatePropagation = false;
invalid (not activated). This is the recommended behaviour.
If not set it will also propagate up the parentLayoutItem() hierarchy, but
- it will stop at the \i first \i widget it encounters, and post a layout
+ it will stop at the \e{first widget} it encounters, and post a layout
request to the widget. When the layout request is consumed, this might
cause it to continue propagation up to the parentLayoutItem() of the
widget. It will continue in this fashion until it has reached a widget with
@@ -508,7 +508,7 @@ void QGraphicsLayout::setInstantInvalidatePropagation(bool enable)
/*!
\internal
\since 4.8
- \see setInstantInvalidatePropagation
+ \sa setInstantInvalidatePropagation()
returns true if the complete widget/layout hierarchy is rearranged in one go.
*/
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 61a228dd3e..14322dc929 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2008,10 +2008,11 @@ void QImage::fill(uint pixel)
/*!
\fn void QImage::fill(Qt::GlobalColor color)
-
\overload
-
\since 4.8
+
+ Fills the image with the given \a color, described as a standard global
+ color.
*/
void QImage::fill(Qt::GlobalColor color)
@@ -2022,7 +2023,7 @@ void QImage::fill(Qt::GlobalColor color)
/*!
- \fn void QImage::fill(Qt::GlobalColor color)
+ \fn void QImage::fill(const QColor &color)
\overload
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index cb3016177d..bdf1f90d8c 100644
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -648,7 +648,7 @@ void QMacPixmapData::macCreatePixels()
}
if (pixels)
- memcpy(base_pixels, pixels, pixelsSize);
+ memcpy(base_pixels, pixels, qMin(pixelsSize, (uint) numBytes));
pixels = base_pixels;
pixelsSize = numBytes;
}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 433c0e9f02..5d3d8d9bf1 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -159,6 +159,7 @@ private:
MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler;
QBasicTimer m_tempPreeditStringTimeout;
bool m_hasTempPreeditString;
+ QString m_cachedPreeditString;
int m_splitViewResizeBy;
Qt::WindowStates m_splitViewPreviousWindowStates;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index daa448bcd8..ebf0ff8e57 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -141,6 +141,16 @@ QCoeFepInputContext::~QCoeFepInputContext()
void QCoeFepInputContext::reset()
{
+ Qt::InputMethodHints currentHints = Qt::ImhNone;
+ if (focusWidget()) {
+ QWidget *proxy = focusWidget()->focusProxy();
+ currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints();
+ }
+ // Store a copy of preedit text, if prediction is active and input context is reseted.
+ // This is to ensure that we can replace preedit string after losing focus to FEP manager's
+ // internal sub-windows.
+ if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText))
+ m_cachedPreeditString = m_preeditString;
commitCurrentString(true);
}
@@ -175,6 +185,8 @@ void QCoeFepInputContext::setFocusWidget(QWidget *w)
void QCoeFepInputContext::widgetDestroyed(QWidget *w)
{
+ m_cachedPreeditString.clear();
+
// Make sure that the input capabilities of whatever new widget got focused are queried.
CCoeControl *ctrl = w->effectiveWinId();
if (ctrl->IsFocused()) {
@@ -353,6 +365,11 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE
}
}
+ if (event->type() == QSymbianEvent::ResourceChangeEvent
+ && event->resourceChangeType() == KEikMessageFadeAllWindows) {
+ reset();
+ }
+
return false;
}
@@ -826,13 +843,6 @@ void QCoeFepInputContext::applyFormat(QList<QInputMethodEvent::Attribute> *attri
}
}
- if (attributes->size() == oldSize) {
- // S60 didn't provide any format, so let's give our own instead.
- attributes->append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat,
- 0,
- m_preeditString.size(),
- standardFormat(PreeditFormat)));
- }
}
void QCoeFepInputContext::queueInputCapabilitiesChanged()
@@ -862,6 +872,8 @@ void QCoeFepInputContext::ensureInputCapabilitiesChanged()
void QCoeFepInputContext::translateInputWidget()
{
QGraphicsView *gv = qobject_cast<QGraphicsView *>(S60->splitViewLastWidget);
+ if (!gv)
+ return;
QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
QRectF cursor = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
@@ -909,6 +921,8 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
if (!w)
return;
+ m_cachedPreeditString.clear();
+
commitTemporaryPreeditString();
QList<QInputMethodEvent::Attribute> attributes;
@@ -965,7 +979,10 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText,
QVariant()));
QString newPreeditString = qt_TDesC2QString(aNewInlineText);
QInputMethodEvent event(newPreeditString, attributes);
- if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) {
+ if (!m_cachedPreeditString.isEmpty()) {
+ event.setCommitString(QLatin1String(""), -m_cachedPreeditString.length(), m_cachedPreeditString.length());
+ m_cachedPreeditString.clear();
+ } else if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) {
// In Symbian world this means "erase last character".
event.setCommitString(QLatin1String(""), -1, 1);
}
@@ -1155,7 +1172,18 @@ void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction)
m_hasTempPreeditString = false;
- if (cancelFepTransaction) {
+ //Only cancel FEP transactions with prediction, when there is still active window.
+ Qt::InputMethodHints currentHints = Qt::ImhNone;
+ if (focusWidget()) {
+ if (focusWidget()->focusProxy())
+ currentHints = focusWidget()->focusProxy()->inputMethodHints();
+ else
+ currentHints = focusWidget()->inputMethodHints();
+ }
+ bool predictive = !(currentHints & Qt::ImhNoPredictiveText);
+ bool widgetAndWindowAvailable = QApplication::activeWindow() && focusWidget();
+
+ if (cancelFepTransaction && ((predictive && widgetAndWindowAvailable) || !predictive)) {
CCoeFep* fep = CCoeEnv::Static()->Fep();
if (fep)
fep->CancelTransaction();
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 52fbfa58cb..617409ff3f 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -1102,7 +1102,7 @@ void QTableView::setRootIndex(const QModelIndex &index)
}
/*!
- \reimp
+ \internal
*/
void QTableView::doItemsLayout()
{
diff --git a/src/gui/kernel/qactiongroup.cpp b/src/gui/kernel/qactiongroup.cpp
index 8029dfb4c2..cbab6aa93a 100644
--- a/src/gui/kernel/qactiongroup.cpp
+++ b/src/gui/kernel/qactiongroup.cpp
@@ -108,8 +108,8 @@ void QActionGroupPrivate::_q_actionHovered()
\ingroup mainwindow-classes
- In some situations it is useful to group actions together. For
- example, if you have a \gui{Left Align} action, a \gui{Right
+ In some situations it is useful to group QAction objects together.
+ For example, if you have a \gui{Left Align} action, a \gui{Right
Align} action, a \gui{Justify} action, and a \gui{Center} action,
only one of these actions should be active at any one time. One
simple way of achieving this is to group the actions together in
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index eb0fd8d057..343b68f8b6 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -715,6 +715,7 @@ void qt_event_request_showsheet(QWidget *w)
{
Q_ASSERT(qt_mac_is_macsheet(w));
#ifdef QT_MAC_USE_COCOA
+ w->repaint();
[NSApp beginSheet:qt_mac_window_for(w) modalForWindow:qt_mac_window_for(w->parentWidget())
modalDelegate:nil didEndSelector:nil contextInfo:0];
#else
@@ -2623,8 +2624,6 @@ OSStatus QApplicationPrivate::globalAppleEventProcessor(const AppleEvent *ae, Ap
Return true if you want to stop the event from being processed.
Return false for normal event dispatching. The default
implementation returns false.
-
- \sa macEventFilter(void *nsevent)
*/
bool QApplication::macEventFilter(EventHandlerCallRef, EventRef)
{
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp
index 98359e470c..b23c15cd53 100644
--- a/src/gui/kernel/qapplication_qpa.cpp
+++ b/src/gui/kernel/qapplication_qpa.cpp
@@ -444,6 +444,9 @@ void QApplication::alert(QWidget *, int)
{
}
+/*!
+ \internal
+*/
QPlatformNativeInterface *QApplication::platformNativeInterface()
{
QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
@@ -612,6 +615,9 @@ void QApplication::setMainWidget(QWidget *mainWidget)
void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e)
{
+ if (!e->widget)
+ return;
+
// qDebug() << "handleMouseEvent" << tlw << ev.pos() << ev.globalPos() << hex << ev.buttons();
static QWeakPointer<QWidget> implicit_mouse_grabber;
@@ -768,6 +774,10 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse
void QApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e)
{
+
+ if (!e->widget)
+ return;
+
// QPoint localPoint = ev.pos();
QPoint globalPoint = e->globalPos;
// bool trustLocalPoint = !!tlw; //is there something the local point can be local to?
@@ -842,12 +852,18 @@ void QApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEven
void QApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
{
+ if (!e->enter)
+ return;
+
QApplicationPrivate::dispatchEnterLeave(e->enter.data(),0);
qt_last_mouse_receiver = e->enter.data();
}
void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e)
{
+ if (!e->leave)
+ return;
+
QApplicationPrivate::dispatchEnterLeave(0,qt_last_mouse_receiver);
if (e->leave.data() && !e->leave.data()->isAncestorOf(qt_last_mouse_receiver)) //(???) this should not happen
@@ -858,6 +874,9 @@ void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Leave
void QApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)
{
+ if (!e->activated)
+ return;
+
QApplication::setActiveWindow(e->activated.data());
}
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index 14f779008c..abee361c0b 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -112,19 +112,6 @@
#include <qvfbhdr.h>
-#ifndef QT_NO_QWS_MULTIPROCESS
-#ifdef QT_NO_QSHM
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#ifndef Q_OS_DARWIN
-# include <sys/sem.h>
-#endif
-#include <sys/socket.h>
-#else
-#include "private/qwssharedmemory_p.h"
-#endif
-#endif
-
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DIRECTPAINTER
@@ -230,7 +217,7 @@ QString qws_dataDir()
qFatal("Qt for Embedded Linux data directory has incorrect permissions: %s", dataDir.constData());
#endif
- result.append("/");
+ result.append(QLatin1Char('/'));
return result;
}
@@ -2197,6 +2184,11 @@ void qt_init(QApplicationPrivate *priv, int type)
qws_screen_is_interlaced = read_bool_env_var("QWS_INTERLACE",false);
const char *display = ::getenv("QWS_DISPLAY");
+
+#ifdef QT_QWS_DEFAULT_DRIVER_NAME
+ if (!display) display = QT_QWS_DEFAULT_DRIVER_NAME;
+#endif
+
if (display)
qws_display_spec = display; // since we setenv later!
@@ -3565,13 +3557,8 @@ bool QETWidget::translateKeyEvent(const QWSKeyEvent *event, bool grab) /* grab i
QEvent::KeyPress : QEvent::KeyRelease;
bool autor = event->simpleData.is_auto_repeat;
QString text;
- char ascii = 0;
- if (event->simpleData.unicode) {
- QChar ch(event->simpleData.unicode);
- if (ch.unicode() != 0xffff)
- text += ch;
- ascii = ch.toLatin1();
- }
+ if (event->simpleData.unicode && event->simpleData.unicode != 0xffff)
+ text += QChar(event->simpleData.unicode);
code = event->simpleData.keycode;
#if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT)
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index e9d58c781c..31d02d4b06 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -74,6 +74,7 @@
# include <centralrepository.h>
# include "qs60mainappui.h"
# include "qinputcontext.h"
+# include <private/qgraphicssystemex_symbian_p.h>
#endif
#if defined(Q_WS_S60)
@@ -1694,7 +1695,7 @@ void qt_init(QApplicationPrivate * /* priv */, int)
if (commandLine) {
// After this construction, CEikonEnv will be available from CEikonEnv::Static().
// (much like our qApp).
- QtEikonEnv* coe = new QtEikonEnv;
+ CEikonEnv* coe = new CEikonEnv;
//not using QT_TRAP_THROWING, because coe owns the cleanupstack so it can't be pushed there.
TRAPD(err, coe->ConstructAppFromCommandLineL(factory, *commandLine));
if(err != KErrNone) {
@@ -1850,26 +1851,12 @@ void qt_init(QApplicationPrivate * /* priv */, int)
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true;
- const TUid KIvePropertyCat = {0x2726beef};
- enum TIvePropertyChipType {
- EVCBCM2727B1 = 0x00000000,
- EVCBCM2763A0 = 0x04000100,
- EVCBCM2763B0 = 0x04000102,
- EVCBCM2763C0 = 0x04000103,
- EVCBCM2763C1 = 0x04000104,
- EVCBCMUnknown = 0x7fffffff
- };
-
- TInt chipType = EVCBCMUnknown;
- if (RProperty::Get(KIvePropertyCat, 0 /*chip type*/, chipType) == KErrNone) {
- if (chipType == EVCBCM2727B1) {
- // We have only 32MB GPU memory. Use raster surfaces
- // for transparent TLWs.
- QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
- }
- } else {
+ if (QSymbianGraphicsSystemEx::hasBCM2727()) {
+ // We have only 32MB GPU memory. Use raster surfaces
+ // for transparent TLWs.
QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
}
+
if (QApplicationPrivate::graphics_system_name == QLatin1String("raster"))
QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
#else
@@ -2027,7 +2014,7 @@ void QApplicationPrivate::openPopup(QWidget *popup)
QApplicationPrivate::popupWidgets->append(popup);
// Cancel focus widget pointer capture and long tap timer
- if (QApplication::focusWidget()) {
+ if (QApplication::focusWidget() && QApplication::focusWidget()->effectiveWinId()) {
static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer();
QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false);
}
@@ -2278,6 +2265,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
case EEventDisplayChanged:
#endif
+ {
if (callSymbianEventFilters(symbianEvent))
return 1;
if (S60)
@@ -2289,6 +2277,12 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
QResizeEvent e(qt_desktopWidget->size(), oldSize);
QApplication::sendEvent(qt_desktopWidget, &e);
}
+ // Close non-native QMenus (that should act like context menus, i.e. close
+ // automatically when the orientation changes).
+ QMenu *activeMenu = qobject_cast<QMenu *>(QApplication::activePopupWidget());
+ if (activeMenu)
+ activeMenu->close();
+ }
return 0; // Propagate to CONE
case EEventWindowVisibilityChanged:
if (controlInMap) {
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 13ff85b24a..e32fdeb483 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -320,7 +320,7 @@ static int qCocoaViewCount = 0;
}
- CGContextFlush(context);
+ CGContextSynchronize(context);
qt_mac_release_graphics_context(context);
return;
}
diff --git a/src/gui/kernel/qdesktopwidget.qdoc b/src/gui/kernel/qdesktopwidget.qdoc
index f71155e117..b93bcb3405 100644
--- a/src/gui/kernel/qdesktopwidget.qdoc
+++ b/src/gui/kernel/qdesktopwidget.qdoc
@@ -151,6 +151,11 @@
on Mac OS X, or the task bar on Windows). The default screen is used if
\a screen is -1.
+ \note In Symbian devices the available geometry reported by QDesktopWidget is
+ not guaranteed to be correct at the time the geometry change resize event
+ is passed to widgets. The correct way to listen for available geometry changes
+ is to connect to the workAreaResized() signal of QDesktopWidget.
+
\sa screenNumber(), screenGeometry()
*/
@@ -179,6 +184,11 @@
Returns the geometry of the screen with index \a screen. The default
screen is used if \a screen is -1.
+ \note In Symbian devices the screen geometry reported by QDesktopWidget is
+ not guaranteed to be correct at the time the geometry change resize event
+ is passed to widgets. The correct way to listen for screen geometry changes
+ is to connect to the resized() signal of QDesktopWidget.
+
\sa screenNumber()
*/
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index bdd2fe402b..de2d87e126 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3103,10 +3103,10 @@ QUrl QFileOpenEvent::url() const
}
/*!
- \fn bool openFile(QFile &file, QIODevice::OpenMode flags) const
+ \fn bool QFileOpenEvent::openFile(QFile &file, QIODevice::OpenMode flags) const
- Opens a QFile on the file referenced by this event.
- Returns true if successful; otherwise returns false.
+ Opens a QFile on the \a file referenced by this event in the mode specified
+ by \a flags. Returns true if successful; otherwise returns false.
This is necessary as some files cannot be opened by name, but require specific
information stored in this event.
diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp
index 3f20c08084..d5a276183f 100644
--- a/src/gui/kernel/qeventdispatcher_s60.cpp
+++ b/src/gui/kernel/qeventdispatcher_s60.cpp
@@ -45,62 +45,6 @@
QT_BEGIN_NAMESPACE
-QtEikonEnv::QtEikonEnv()
- : m_lastIterationCount(0)
- , m_savedStatusCode(KRequestPending)
- , m_hasAlreadyRun(false)
-{
-}
-
-QtEikonEnv::~QtEikonEnv()
-{
-}
-
-void QtEikonEnv::RunL()
-{
- QEventDispatcherS60 *dispatcher = qobject_cast<QEventDispatcherS60 *>(QAbstractEventDispatcher::instance());
- if (!dispatcher) {
- CEikonEnv::RunL();
- return;
- }
-
- if (m_lastIterationCount != dispatcher->iterationCount()) {
- m_hasAlreadyRun = false;
- m_lastIterationCount = dispatcher->iterationCount();
- }
-
- if (m_hasAlreadyRun) {
- // Fool the active scheduler into believing we are still waiting for events.
- // The window server thinks we are not, however.
- m_savedStatusCode = iStatus.Int();
- iStatus = KRequestPending;
- SetActive();
- dispatcher->queueDeferredActiveObjectsCompletion();
- } else {
- m_hasAlreadyRun = true;
- CEikonEnv::RunL();
- }
-}
-
-void QtEikonEnv::DoCancel()
-{
- complete();
-
- CEikonEnv::DoCancel();
-}
-
-void QtEikonEnv::complete()
-{
- if (m_hasAlreadyRun) {
- if (m_savedStatusCode != KRequestPending) {
- TRequestStatus *status = &iStatus;
- QEventDispatcherSymbian::RequestComplete(status, m_savedStatusCode);
- m_savedStatusCode = KRequestPending;
- }
- m_hasAlreadyRun = false;
- }
-}
-
QEventDispatcherS60::QEventDispatcherS60(QObject *parent)
: QEventDispatcherSymbian(parent),
m_noInputEvents(false)
@@ -183,14 +127,4 @@ void QEventDispatcherS60::removeInputEventsForWidget(QObject *object)
}
}
-// reimpl
-void QEventDispatcherS60::reactivateDeferredActiveObjects()
-{
- if (S60->qtOwnsS60Environment) {
- static_cast<QtEikonEnv *>(CCoeEnv::Static())->complete();
- }
-
- QEventDispatcherSymbian::reactivateDeferredActiveObjects();
-}
-
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h
index 49ec568097..c7cf2b22d8 100644
--- a/src/gui/kernel/qeventdispatcher_s60_p.h
+++ b/src/gui/kernel/qeventdispatcher_s60_p.h
@@ -62,31 +62,6 @@ QT_BEGIN_NAMESPACE
class QEventDispatcherS60;
-class QtEikonEnv : public CEikonEnv
-{
-public:
- QtEikonEnv();
- ~QtEikonEnv();
-
- // from CActive.
- void RunL();
- void DoCancel();
-
- void complete();
-
-private:
- // Workaround for a BC break from S60 3.2 -> 5.0, where the CEikonEnv override was removed.
- // To avoid linking to that when we build against 3.2, define an empty body here.
- // Reserved_*() have been verified to be empty in the S60 code.
- void Reserved_1() {}
- void Reserved_2() {}
-
-private:
- int m_lastIterationCount;
- TInt m_savedStatusCode;
- bool m_hasAlreadyRun;
-};
-
class Q_GUI_EXPORT QEventDispatcherS60 : public QEventDispatcherSymbian
{
Q_OBJECT
@@ -102,8 +77,6 @@ public:
void saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event);
- void reactivateDeferredActiveObjects();
-
private:
bool sendDeferredInputEvents();
diff --git a/src/gui/kernel/qgenericplugin_qpa.cpp b/src/gui/kernel/qgenericplugin_qpa.cpp
index ca2fe7a076..e7b65b730e 100644
--- a/src/gui/kernel/qgenericplugin_qpa.cpp
+++ b/src/gui/kernel/qgenericplugin_qpa.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\brief The QGenericPlugin class is an abstract base class for
window-system related plugins in Qt QPA.
- Note that this class is only available in \l{Qt QPA}.
+ Note that this class is only available in Qt QPA.
A mouse plugin can be created by subclassing
QGenericPlugin and reimplementing the pure virtual keys() and
diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.cpp b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
index 8db22fb897..fb6a0d85fd 100644
--- a/src/gui/kernel/qgenericpluginfactory_qpa.cpp
+++ b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
@@ -65,8 +65,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
\brief The QGenericPluginFactory class creates window-system
related plugin drivers in Qt QPA.
- Note that this class is only available in \l{Qt QPA}.
-
+ Note that this class is only available in Qt QPA.
\sa QGenericPlugin
*/
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp
index 7905185eac..f8e4b629b6 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.cpp
+++ b/src/gui/kernel/qplatformclipboard_qpa.cpp
@@ -83,7 +83,7 @@ QPlatformClipboard::~QPlatformClipboard()
}
-const QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode) const
+QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode)
{
//we know its clipboard
Q_UNUSED(mode);
diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h
index 41aa951615..6a40fbc86c 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.h
+++ b/src/gui/kernel/qplatformclipboard_qpa.h
@@ -59,7 +59,7 @@ class Q_GUI_EXPORT QPlatformClipboard
public:
virtual ~QPlatformClipboard();
- virtual const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard ) const;
+ virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
virtual bool supportsMode(QClipboard::Mode mode) const;
void emitChanged(QClipboard::Mode mode);
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index e612e2dbb8..06954864f2 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -52,48 +52,46 @@ QT_BEGIN_NAMESPACE
QList <QWeakPointer<QPlatformCursor> > QPlatformCursorPrivate::instances;
/*!
- \class QGraphicsSystemCursor
+ \class QPlatformCursor
- \brief The QGraphicsSystemCursor class provides information about
+ \brief The QPlatformCursor class provides information about
pointer device events (movement, buttons), and requests to change
the currently displayed cursor.
- Note that QGraphicsSystemCursor does not include any graphics for
+ Note that QPlatformCursor does not include any graphics for
display. An application that sets a QCursor may provide its own
graphics.
- \sa QGraphicsSystemCursorImage
+ \sa QPlatformCursorImage
*/
/*!
- \fn virtual void QGraphicsSystemCursor::pointerEvent(const QMouseEvent & event)
+ \fn virtual void QPlatformCursor::pointerEvent(const QMouseEvent & event)
This method is called by Qt whenever a QMouseEvent is generated by the
underlying pointer input. \a event is a reference to the QMouseEvent in
question. A default do-nothing implementation is provided.
-
- \sa QApplicationPrivate::handleMouseEvent()
*/
/*!
- \fn virtual void QGraphicsSystemCursor::changeCursor(QCursor * widgetCursor, QWidget * widget)
+ \fn virtual void QPlatformCursor::changeCursor(QCursor * widgetCursor, QWidget * widget)
\brief This method is called by Qt whenever the cursor graphic should be changed.
- Implementation of this method is mandatory for a subclass of QGraphicsSystemCursor.
+ Implementation of this method is mandatory for a subclass of QPlatformCursor.
\a widgetCursor is a pointer to the QCursor that should be displayed.
\a widget is a pointer to the widget currently displayed at QCursor::pos(). Note
that this may be 0 if the current position is not occupied by a displayed widget.
- \sa QApplicationPrivate::handleMouseEvent(), QCursor::pos()
+ \sa QCursor::pos()
*/
/*!
- \fn QGraphicsSystemCursor::QGraphicsSystemCursor()
+ \fn QPlatformCursor::QPlatformCursor(QPlatformScreen *screen)
- \brief Constructs a QGraphicsSystemCursor
+ Constructs a QPlatformCursor for the given \a screen.
*/
QPlatformCursor::QPlatformCursor(QPlatformScreen *scr )
: screen(scr)
@@ -106,12 +104,12 @@ QPlatformCursor::QPlatformCursor(QPlatformScreen *scr )
// from src/gui/embedded/QGraphicsSystemCursorImage_qws.cpp
/*!
- \class QGraphicsSystemCursorImage
+ \class QPlatformCursorImage
- \brief The QGraphicsSystemCursorImage class provides a set of graphics
+ \brief The QPlatformCursorImage class provides a set of graphics
intended to be used as cursors.
- \sa QGraphicsSystemCursor
+ \sa QPlatformCursor
*/
static QPlatformCursorImage *systemCursorTable[Qt::LastCursor+1];
@@ -502,7 +500,7 @@ void QPlatformCursorImage::createSystemCursor(int id)
}
/*!
- \fn void QGraphicsSystemCursorImage::set(Qt::CursorShape id)
+ \fn void QPlatformCursorImage::set(Qt::CursorShape id)
\brief Calling this method sets the cursor image to the specified shape
@@ -531,15 +529,8 @@ void QPlatformCursorImage::set(Qt::CursorShape id)
}
/*!
- \fn void QGraphicsSystemCursorImage::set(const QImage * image, int hx, int hy)
-
- \brief Set the cursor image to the specified QImage, with the hotsport at (hx, hy)
-
- \a image A pointer to a QImage
-
- \a hx The x coordinate of the cursor's hotspot
-
- \a hy the y coordinate of the cursor's hotspot
+ Sets the cursor image to the given \a image, with the hotspot at the
+ point specified by (\a hx, \a hy).
*/
void QPlatformCursorImage::set(const QImage &image, int hx, int hy)
@@ -550,22 +541,19 @@ void QPlatformCursorImage::set(const QImage &image, int hx, int hy)
}
/*!
- \fn void QGraphicsSystemCursorImage::set(const uchar *data, const uchar *mask, int width, int height, int hx, int hy)
-
- \brief set the cursor image to the graphic represented by the combination of data, mask,
- width, and height
-
- \a data The pixel data of the graphic
-
- \a mask Mask data for the graphic. pixels in data with a corresponding mask bit of 0 are not drawn
+ \fn void QPlatformCursorImage::set(const uchar *data, const uchar *mask, int width, int height, int hx, int hy)
- \a width The width of the graphic in pixels
+ Sets the cursor image to the graphic represented by the combination of
+ \a data and \a mask, with dimensions given by \a width and \a height and a
+ hotspot at the point specified by (\a hx, \a hy).
- \a height The height of the graphic in pixels
+ The image data specified by \a data must be supplied in the format
+ described by QImage::Format_Indexed8.
- \a hx The X hotspot of the cursor graphic
-
- \a hy The Y hotspot of the cursor graphic
+ The corresponding mask data specified by \a mask must be supplied in a
+ character array containing packed 1 bit per pixel format data, with any
+ padding bits at the end of the array. Bits of value 0 represent transparent
+ pixels in the image data.
*/
void QPlatformCursorImage::set(const uchar *data, const uchar *mask,
int width, int height, int hx, int hy)
@@ -625,34 +613,23 @@ void QPlatformCursorImage::set(const uchar *data, const uchar *mask,
}
/*!
- \fn QGraphicsSystemCursorImage::QGraphicsSystemCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
-
- \brief set the cursor image to the graphic represented by the combination of data, mask,
- width, and height
-
- \a data The pixel data of the graphic
-
- \a mask Mask data for the graphic. pixels in data with a corresponding mask bit of 0 are not drawn
-
- \a width The width of the graphic in pixels
-
- \a height The height of the graphic in pixels
-
- \a hotX The X hotspot of the cursor graphic
+ \fn QPlatformCursorImage::QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
- \a hotY The Y hotspot of the cursor graphic
+ Sets the cursor image to the graphic represented by the combination of
+ \a data and \a mask, with dimensions given by \a width and \a height and a
+ hotspot at the point specified by (\a hotX, \a hotY).
- \sa set
+ \sa set()
*/
/*!
- \fn QImage *QGraphicsSystemCursorImage::image()
+ \fn QImage *QPlatformCursorImage::image()
\brief Return the cursor graphic as a pointer to a QImage
*/
/*!
- \fn QPoint QGraphicsSystemCursorImage::hotspot()
+ \fn QPoint QPlatformCursorImage::hotspot()
\brief Return the cursor's hotspot
*/
diff --git a/src/gui/kernel/qplatformglcontext_qpa.cpp b/src/gui/kernel/qplatformglcontext_qpa.cpp
index 8daa5d423b..5c56efbf2f 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.cpp
+++ b/src/gui/kernel/qplatformglcontext_qpa.cpp
@@ -191,17 +191,17 @@ void QPlatformGLContext::deleteQGLContext()
which maps to the QPlatformGLContext.
*/
-/*! \fn void swapBuffers()
+/*! \fn void QPlatformGLContext::swapBuffers()
Reimplement in subclass to native swap buffers calls
*/
-/*! getProcAddress(const QString& procName)
+/*! \fn void *QPlatformGLContext::getProcAddress(const QString &procName)
Reimplement in subclass to native getProcAddr calls.
Note: its convenient to use qPrintable(const QString &str) to get the const char * pointer
*/
-/*! platformWindowFormat() const
+/*! \fn QPlatformWindowFormat QPlatformGLContext::platformWindowFormat() const
QWidget has the function qplatformWindowFormat(). That function is for the application
programmer to request the format of the window and the context that he wants.
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 972fb0a74c..29287fe71c 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -132,20 +132,20 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
the recommended approach for making new platform plugin is to copy an existing plugin inside
the QTSRCTREE/src/plugins/platform and develop the plugin inside the source tree.
- The minimal platformintegration is the smallest platform integration it is possible to make,
+ The minimal platform integration is the smallest platform integration it is possible to make,
which makes it an ideal starting point for new plugins. For a slightly more advanced plugin,
consider reviewing the directfb plugin, or the testlite plugin.
*/
/*!
- \fn QPixmapData *createPixmapData(QPixmapData::PixelType type) const
+ \fn QPixmapData *QPlatformIntegration::createPixmapData(QPixmapData::PixelType type) const
Factory function for QPixmapData. PixelType can be either PixmapType or BitmapType.
\sa QPixmapData
*/
/*!
- \fn QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const
+ \fn QPlatformWindow *QPlatformIntegration::createPlatformWindow(QWidget *widget, WId winId = 0) const
Factory function for QPlatformWindow. The widget parameter is a pointer to the top level
widget(tlw) which the QPlatformWindow is suppose to be created for. The WId handle is actually
@@ -162,7 +162,7 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
*/
/*!
- \fn QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const
+ \fn QWindowSurface *QPlatformIntegration::createWindowSurface(QWidget *widget, WId winId) const
Factory function for QWindowSurface. The QWidget parameter is a pointer to the
top level widget(tlw) the window surface is created for. A QPlatformWindow is always created
@@ -175,7 +175,7 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
*/
/*!
- \fn void moveToScreen(QWidget *window, int screen)
+ \fn void QPlatformIntegration::moveToScreen(QWidget *window, int screen)
This function is called when a QWidget is displayed on screen, or the QWidget is to be
displayed on a new screen. The QWidget parameter is a pointer to the top level widget and
@@ -187,14 +187,14 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
*/
/*!
- \fn QList<QPlatformScreen *> screens() const
+ \fn QList<QPlatformScreen *> QPlatformIntegration::screens() const
Accessor function to a list of all the screens on the current system. The screen with the
index == 0 is the default/main screen.
*/
/*!
- \fn bool isVirtualDesktop()
+ \fn bool QPlatformIntegration::isVirtualDesktop()
Returns if the current windowing system configuration defines all the screens to be one
desktop(virtual desktop), or if each screen is a desktop of its own.
@@ -203,7 +203,7 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
*/
/*!
- \fn QPixmap grabWindow(WId window, int x, int y, int width, int height) const
+ \fn QPixmap QPlatformIntegration::grabWindow(WId window, int x, int y, int width, int height) const
This function is called when Qt needs to be able to grab the content of a window.
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index 87e40e44ba..2a1e7e4b9a 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -66,12 +66,15 @@ QWidget *QPlatformScreen::topLevelAt(const QPoint & pos) const
return 0;
}
-/*! \fn physicalSize() const
- Reimplement in subclass to return the physical size of the screen. This function is used by
- QFont to convert point sizes to pixel sizes.
-
- Default implementation takes the pixel size of the screen, considers a dpi of 100 and returns
- the calculated (and probably wrong) physical size
+/*!
+ Reimplement this function in subclass to return the physical size of the
+ screen. This function is used by QFont to convert point sizes to pixel
+ sizes.
+
+ The default implementation takes the pixel size of the screen, considers a
+ resolution of 100 dots per inch, and returns the calculated physical size.
+ A device with a screen that has different resolutions will need to be
+ supported by a suitable reimplementation of this function.
*/
QSize QPlatformScreen::physicalSize() const
{
@@ -110,20 +113,20 @@ QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget
QPlatformScreen is also used by the public api QDesktopWidget for information about the desktop.
*/
-/*! \fn geometry() const
+/*! \fn QRect QPlatformScreen::geometry() const = 0
Reimplement in subclass to return the pixel geometry of the screen
*/
-/*! \fn availableGeometry() const
+/*! \fn QRect QPlatformScreen::availableGeometry() const
Reimplement in subclass to return the pixel geometry of the available space
This normally is the desktop screen minus the task manager, global menubar etc.
*/
-/*! \fn depth() const
+/*! \fn int QPlatformScreen::depth() const = 0
Reimplement in subclass to return current depth of the screen
*/
-/*! \fn format() const
+/*! \fn QImage::Format QPlatformScreen::format() const = 0
Reimplement in subclass to return the image format which corresponds to the screen format
*/
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.cpp b/src/gui/kernel/qplatformwindowformat_qpa.cpp
index e89b458f75..482ae68a2b 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.cpp
+++ b/src/gui/kernel/qplatformwindowformat_qpa.cpp
@@ -122,8 +122,6 @@ public:
\i \link setStencil() Stencil buffer.\endlink
\i \link setStereo() Stereo buffers.\endlink
\i \link setDirectRendering() Direct rendering.\endlink
- \i \link setOverlay() Presence of an overlay.\endlink
- \i \link setPlane() Plane of an overlay.\endlink
\i \link setSampleBuffers() Multisample buffers.\endlink
\endlist
@@ -168,7 +166,7 @@ public:
United States and other countries.
\endlegalese
- \sa QPlatformContext, QWidget
+ \sa QPlatformGLContext, QWidget
*/
/*!
@@ -182,8 +180,6 @@ public:
\i \link setStencil() Stencil buffer:\endlink Enabled.
\i \link setStereo() Stereo:\endlink Disabled.
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
- \i \link setOverlay() Overlay:\endlink Disabled.
- \i \link setPlane() Plane:\endlink 0 (i.e., normal plane).
\i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
\endlist
*/
@@ -207,14 +203,10 @@ QPlatformWindowFormat::QPlatformWindowFormat()
\snippet doc/src/snippets/code/src_opengl_qgl.cpp 3
Note that there are QGL::FormatOption values to turn format settings
- both on and off, e.g. QGL::DepthBuffer and QGL::NoDepthBuffer,
+ both on and off; e.g., QGL::DepthBuffer and QGL::NoDepthBuffer,
QGL::DirectRendering and QGL::IndirectRendering, etc.
- The \a plane parameter defaults to 0 and is the plane which this
- format should be associated with. Not all OpenGL implementations
- supports overlay/underlay rendering planes.
-
- \sa defaultFormat(), setOption(), setPlane()
+ \sa defaultFormat(), setOption()
*/
QPlatformWindowFormat::QPlatformWindowFormat(QPlatformWindowFormat::FormatOptions options)
@@ -619,8 +611,6 @@ QPlatformGLContext *QPlatformWindowFormat::sharedGLContext() const
Otherwise returns false.
WindowSurface is enabled by default.
-
- \sa setOverlay()
*/
/*!
@@ -628,9 +618,7 @@ QPlatformGLContext *QPlatformWindowFormat::sharedGLContext() const
otherwise the QWidget will only have a QPlatformWindow.
- This is useful for ie. QGLWidget where the QPlatformGLContext controls the surface.
-
- \sa hasOverlay()
+ This is useful for QGLWidget where the QPlatformGLContext controls the surface.
*/
void QPlatformWindowFormat::setWindowSurface(bool enable)
@@ -894,7 +882,7 @@ void QPlatformWindowFormat::setDefaultFormat(const QPlatformWindowFormat &f)
}
-/*!
+/*
Returns the default QPlatformWindowFormat for overlay contexts.
The default overlay format is:
@@ -907,9 +895,7 @@ void QPlatformWindowFormat::setDefaultFormat(const QPlatformWindowFormat &f)
\i \link setStencil() Stencil buffer:\endlink Disabled.
\i \link setStereo() Stereo:\endlink Disabled.
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
- \i \link setOverlay() Overlay:\endlink Disabled.
\i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
- \i \link setPlane() Plane:\endlink 1 (i.e., first overlay plane).
\endlist
\sa setDefaultFormat()
diff --git a/src/gui/kernel/qsessionmanager_qws.cpp b/src/gui/kernel/qsessionmanager_qws.cpp
index efe688e0e5..e4376354d6 100644
--- a/src/gui/kernel/qsessionmanager_qws.cpp
+++ b/src/gui/kernel/qsessionmanager_qws.cpp
@@ -43,6 +43,9 @@
#ifndef QT_NO_SESSIONMANAGER
+#include <qapplication.h>
+#include <private/qobject_p.h>
+
QT_BEGIN_NAMESPACE
class QSessionManagerPrivate : public QObjectPrivate
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 7d7c56fe84..a866da3245 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -48,9 +48,6 @@
#ifdef Q_WS_S60
#include "private/qsoftkeymanager_s60_p.h"
-#endif
-
-#ifdef SYMBIAN_VERSION_SYMBIAN3
#include "private/qt_s60_p.h"
#endif
@@ -105,7 +102,7 @@ QSoftKeyManager::QSoftKeyManager() :
QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget)
{
QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget);
-#ifdef SYMBIAN_VERSION_SYMBIAN3
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
int key = 0;
switch (standardKey) {
case OkSoftKey:
@@ -171,7 +168,7 @@ void QSoftKeyManager::cleanupHash(QObject *obj)
Q_D(QSoftKeyManager);
QAction *action = qobject_cast<QAction*>(obj);
d->keyedActions.remove(action);
-#ifdef SYMBIAN_VERSION_SYMBIAN3
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
d->softKeyCommandActions.remove(action);
#endif
}
@@ -193,6 +190,11 @@ void QSoftKeyManager::sendKeyEvent()
void QSoftKeyManager::updateSoftKeys()
{
+#ifdef Q_WS_S60
+ // Do not adjust softkeys if application is not the topmost one
+ if (S60->wsSession().GetFocusWindowGroup() != S60->windowGroup().WindowGroupId())
+ return;
+#endif
QSoftKeyManager::instance()->d_func()->pendingUpdate = true;
QEvent *event = new QEvent(QEvent::UpdateSoftKeys);
QApplication::postEvent(QSoftKeyManager::instance(), event);
diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h
index bf4c747223..5b76e60e9f 100644
--- a/src/gui/kernel/qsoftkeymanager_common_p.h
+++ b/src/gui/kernel/qsoftkeymanager_common_p.h
@@ -72,7 +72,7 @@ protected:
QMultiHash<int, QAction*> requestedSoftKeyActions;
QWidget *initialSoftKeySource;
bool pendingUpdate;
-#ifdef SYMBIAN_VERSION_SYMBIAN3
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
QHash<QAction*, int> softKeyCommandActions;
#endif
};
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index ab710648c2..acdb0e5838 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -113,7 +113,7 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG
void QSoftKeyManagerPrivateS60::clearSoftkeys(CEikButtonGroupContainer &cba)
{
-#ifdef SYMBIAN_VERSION_SYMBIAN3
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
QT_TRAP_THROWING(
//EAknSoftkeyEmpty is used, because using -1 adds softkeys without actions on Symbian3
cba.SetCommandL(0, EAknSoftkeyEmpty, KNullDesC);
@@ -297,7 +297,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
QString text = softkeyText(*action);
TPtrC nativeText = qt_QString2TPtrC(text);
int command = S60_COMMAND_START + position;
-#ifdef SYMBIAN_VERSION_SYMBIAN3
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
if (softKeyCommandActions.contains(action))
command = softKeyCommandActions.value(action);
#endif
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp
index a9bfba63e8..56c3010535 100644
--- a/src/gui/kernel/qwidget_qpa.cpp
+++ b/src/gui/kernel/qwidget_qpa.cpp
@@ -129,6 +129,11 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
{
Q_D(QWidget);
+ d->aboutToDestroy();
+ if (!isWindow() && parentWidget())
+ parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
+ d->deactivateWidgetCleanup();
+
if ((windowType() == Qt::Popup))
qApp->d_func()->closePopup(this);
@@ -136,6 +141,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
if (this == QApplicationPrivate::active_window)
QApplication::setActiveWindow(0);
+ setAttribute(Qt::WA_WState_Created, false);
+
if (windowType() != Qt::Desktop) {
if (destroySubWindows) {
QObjectList childList(children());
@@ -155,6 +162,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
d->hide_sys();
}
}
+
+ d->setWinId(0);
}
}
@@ -412,6 +421,7 @@ void QWidgetPrivate::hide_sys()
{
Q_Q(QWidget);
q->setAttribute(Qt::WA_Mapped, false);
+ deactivateWidgetCleanup();
if (!q->isWindow()) {
QWidget *p = q->parentWidget();
if (p &&p->isVisible()) {
@@ -681,8 +691,10 @@ int QWidget::metric(PaintDeviceMetric m) const
/*!
\preliminary
- Sets the window to be the \a window specified.
- The QWidget takes ownership of the \a surface.
+ Sets the window to be the platform \a window specified.
+
+ The widget takes ownership of the \a window. Any platform window
+ previously set on the widget will be destroyed.
*/
void QWidget::setPlatformWindow(QPlatformWindow *window)
{
@@ -711,6 +723,9 @@ QPlatformWindow *QWidget::platformWindow() const
return 0;
}
+/*!
+ Sets the platform window format for the widget to the \a format specified.
+*/
void QWidget::setPlatformWindowFormat(const QPlatformWindowFormat &format)
{
if (isWindow() || testAttribute(Qt::WA_NativeWindow)) {
@@ -727,16 +742,26 @@ void QWidget::setPlatformWindowFormat(const QPlatformWindowFormat &format)
}
}
+/*!
+ Returns the platform window format for the widget.
+*/
QPlatformWindowFormat QWidget::platformWindowFormat() const
{
Q_D(const QWidget);
+ QPlatformWindowFormat format;
+
QTLWExtra *extra = d->maybeTopData();
if (extra){
- return extra->platformWindowFormat;
+ format = extra->platformWindowFormat;
} else {
- return QPlatformWindowFormat::defaultFormat();
+ format = QPlatformWindowFormat::defaultFormat();
}
+
+ if (testAttribute(Qt::WA_TranslucentBackground))
+ format.setAlpha(true);
+
+ return format;
}
void QWidgetPrivate::createSysExtra()
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index f1496b1b10..d5ae364e7d 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -6,6 +6,7 @@ HEADERS += \
painting/qcolor.h \
painting/qcolor_p.h \
painting/qcolormap.h \
+ painting/qcosmeticstroker_p.h \
painting/qdrawutil.h \
painting/qemulationpaintengine_p.h \
painting/qgraphicssystem_p.h \
@@ -15,7 +16,7 @@ HEADERS += \
painting/qoutlinemapper_p.h \
painting/qpaintdevice.h \
painting/qpaintengine.h \
- painting/qpaintengine_p.h \
+ painting/qpaintengine_p.h \
painting/qpaintengine_alpha_p.h \
painting/qpaintengine_preview_p.h \
painting/qpaintengineex_p.h \
@@ -54,6 +55,7 @@ SOURCES += \
painting/qbrush.cpp \
painting/qcolor.cpp \
painting/qcolor_p.cpp \
+ painting/qcosmeticstroker.cpp \
painting/qcssutil.cpp \
painting/qdrawutil.cpp \
painting/qemulationpaintengine.cpp \
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 5d8f43b386..79c4c4e4e4 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -1826,9 +1826,9 @@ static QPointF qt_radial_gradient_adapt_focal_point(const QPointF &center,
radius and \a focalPoint.
\note If the given focal point is outside the circle defined by the
- center (\a cx, \a cy) and the \a radius it will be re-adjusted to
- the intersection between the line from the center to the focal point
- and the circle.
+ \a center point and \a radius, it will be re-adjusted to lie at a point on
+ the circle where it intersects with the line from \a center to
+ \a focalPoint.
\sa QGradient::setColorAt(), QGradient::setStops()
*/
@@ -1947,11 +1947,9 @@ QRadialGradient::QRadialGradient(const QPointF &center, qreal centerRadius, cons
/*!
\since 4.8
- Constructs an extended radial gradient with the given \a center, \a
- centerRadius, \a focalPoint, and \a focalRadius.
- Constructs a radial gradient with the given center (\a cx, \a cy),
- center radius \a centerRadius, focal point (\a fx, \a fy), and
- focal radius \a focalRadius.
+ Constructs an extended radial gradient with the given center
+ (\a cx, \a cy), center radius, \a centerRadius, focal point, (\a fx, \a fy),
+ and focal radius \a focalRadius.
*/
QRadialGradient::QRadialGradient(qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius)
{
@@ -2049,7 +2047,7 @@ qreal QRadialGradient::centerRadius() const
return m_data.radial.cradius;
}
-/*
+/*!
\since 4.8
Sets the center radius of this radial gradient in logical coordinates
@@ -2080,7 +2078,7 @@ qreal QRadialGradient::focalRadius() const
return u.f;
}
-/*
+/*!
\since 4.8
Sets the focal radius of this radial gradient in logical coordinates
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
new file mode 100644
index 0000000000..cdc0978ed7
--- /dev/null
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -0,0 +1,1010 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 "qcosmeticstroker_p.h"
+#include "private/qpainterpath_p.h"
+#include <qdebug.h>
+#include <math.h>
+
+QT_BEGIN_NAMESPACE
+
+#if 0
+inline QString capString(int caps)
+{
+ QString str;
+ if (caps & QCosmeticStroker::CapBegin) {
+ str += "CapBegin ";
+ }
+ if (caps & QCosmeticStroker::CapEnd) {
+ str += "CapEnd ";
+ }
+ return str;
+}
+#endif
+
+#define toF26Dot6(x) ((int)((x)*64.))
+
+static inline uint sourceOver(uint d, uint color)
+{
+ return color + BYTE_MUL(d, qAlpha(~color));
+}
+
+inline static int F16Dot16FixedDiv(int x, int y)
+{
+ if (qAbs(x) > 0x7fff)
+ return (((qlonglong)x) << 16) / y;
+ return (x << 16) / y;
+}
+
+typedef void (*DrawPixel)(QCosmeticStroker *stroker, int x, int y, int coverage);
+
+namespace {
+
+struct Dasher {
+ QCosmeticStroker *stroker;
+ int *pattern;
+ int offset;
+ int dashIndex;
+ int dashOn;
+
+ Dasher(QCosmeticStroker *s, bool reverse, int start, int stop)
+ : stroker(s)
+ {
+ int delta = stop - start;
+ if (reverse) {
+ pattern = stroker->reversePattern;
+ offset = stroker->patternLength - stroker->patternOffset - delta - ((start & 63) - 32);
+ dashOn = 0;
+ } else {
+ pattern = stroker->pattern;
+ offset = stroker->patternOffset - ((start & 63) - 32);
+ dashOn = 1;
+ }
+ offset %= stroker->patternLength;
+ if (offset < 0)
+ offset += stroker->patternLength;
+
+ dashIndex = 0;
+ while (offset>= pattern[dashIndex])
+ ++dashIndex;
+
+// qDebug() << " dasher" << offset/64. << reverse << dashIndex;
+ stroker->patternOffset += delta;
+ stroker->patternOffset %= stroker->patternLength;
+ }
+
+ bool on() const {
+ return (dashIndex + dashOn) & 1;
+ }
+ void adjust() {
+ offset += 64;
+ if (offset >= pattern[dashIndex]) {
+ ++dashIndex;
+ dashIndex %= stroker->patternSize;
+ }
+ offset %= stroker->patternLength;
+// qDebug() << "dasher.adjust" << offset/64. << dashIndex;
+ }
+};
+
+struct NoDasher {
+ NoDasher(QCosmeticStroker *, bool, int, int) {}
+ bool on() const { return true; }
+ void adjust(int = 0) {}
+};
+
+};
+
+template<DrawPixel drawPixel, class Dasher>
+static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
+template<DrawPixel drawPixel, class Dasher>
+static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
+
+inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage)
+{
+ const QRect &cl = stroker->clip;
+ if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom())
+ return;
+
+ int lastx = stroker->spans[stroker->current_span-1].x + stroker->spans[stroker->current_span-1].len ;
+ int lasty = stroker->spans[stroker->current_span-1].y;
+
+ if (stroker->current_span == QCosmeticStroker::NSPANS || y < lasty || (y == lasty && x < lastx)) {
+ stroker->blend(stroker->current_span, stroker->spans, &stroker->state->penData);
+ stroker->current_span = 0;
+ }
+
+ stroker->spans[stroker->current_span].x = ushort(x);
+ stroker->spans[stroker->current_span].len = 1;
+ stroker->spans[stroker->current_span].y = y;
+ stroker->spans[stroker->current_span].coverage = coverage*stroker->opacity >> 8;
+ ++stroker->current_span;
+}
+
+inline void drawPixelARGB32(QCosmeticStroker *stroker, int x, int y, int coverage)
+{
+ const QRect &cl = stroker->clip;
+ if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom())
+ return;
+
+ int offset = x + stroker->ppl*y;
+ uint c = BYTE_MUL(stroker->color, coverage);
+ stroker->pixels[offset] = sourceOver(stroker->pixels[offset], c);
+}
+
+inline void drawPixelARGB32Opaque(QCosmeticStroker *stroker, int x, int y, int)
+{
+ const QRect &cl = stroker->clip;
+ if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom())
+ return;
+
+ int offset = x + stroker->ppl*y;
+ stroker->pixels[offset] = sourceOver(stroker->pixels[offset], stroker->color);
+}
+
+enum StrokeSelection {
+ Aliased = 0,
+ AntiAliased = 1,
+ Solid = 0,
+ Dashed = 2,
+ RegularDraw = 0,
+ FastDraw = 4
+};
+
+static StrokeLine strokeLine(int strokeSelection)
+{
+ StrokeLine stroke;
+
+ switch (strokeSelection) {
+ case Aliased|Solid|RegularDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixel, NoDasher>;
+ break;
+ case Aliased|Solid|FastDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixelARGB32Opaque, NoDasher>;
+ break;
+ case Aliased|Dashed|RegularDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixel, Dasher>;
+ break;
+ case Aliased|Dashed|FastDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixelARGB32Opaque, Dasher>;
+ break;
+ case AntiAliased|Solid|RegularDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixel, NoDasher>;
+ break;
+ case AntiAliased|Solid|FastDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixelARGB32, NoDasher>;
+ break;
+ case AntiAliased|Dashed|RegularDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixel, Dasher>;
+ break;
+ case AntiAliased|Dashed|FastDraw:
+ stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixelARGB32, Dasher>;
+ break;
+ default:
+ Q_ASSERT(false);
+ stroke = 0;
+ }
+ return stroke;
+}
+
+void QCosmeticStroker::setup()
+{
+ blend = state->penData.blend;
+ if (state->clip && state->clip->enabled && state->clip->hasRectClip && !state->clip->clipRect.isEmpty()) {
+ clip &= state->clip->clipRect;
+ blend = state->penData.unclipped_blend;
+ }
+
+ int strokeSelection = 0;
+ if (blend == state->penData.unclipped_blend
+ && state->penData.type == QSpanData::Solid
+ && (state->penData.rasterBuffer->format == QImage::Format_ARGB32_Premultiplied
+ || state->penData.rasterBuffer->format == QImage::Format_RGB32)
+ && state->compositionMode() == QPainter::CompositionMode_SourceOver)
+ strokeSelection |= FastDraw;
+
+ if (state->renderHints & QPainter::Antialiasing)
+ strokeSelection |= AntiAliased;
+
+ const QVector<qreal> &penPattern = state->lastPen.dashPattern();
+ if (penPattern.isEmpty()) {
+ Q_ASSERT(!pattern && !reversePattern);
+ pattern = 0;
+ reversePattern = 0;
+ patternLength = 0;
+ patternSize = 0;
+ } else {
+ pattern = (int *)malloc(penPattern.size()*sizeof(int));
+ reversePattern = (int *)malloc(penPattern.size()*sizeof(int));
+ patternSize = penPattern.size();
+
+ patternLength = 0;
+ for (int i = 0; i < patternSize; ++i) {
+ patternLength += (int) qMax(1. , penPattern.at(i)*64.);
+ pattern[i] = patternLength;
+ }
+ patternLength = 0;
+ for (int i = 0; i < patternSize; ++i) {
+ patternLength += (int) qMax(1., penPattern.at(patternSize - 1 - i)*64.);
+ reversePattern[i] = patternLength;
+ }
+ strokeSelection |= Dashed;
+// qDebug() << "setup: size=" << patternSize << "length=" << patternLength/64.;
+ }
+
+ stroke = strokeLine(strokeSelection);
+
+ qreal width = state->lastPen.widthF();
+ if (width == 0)
+ opacity = 256;
+ else if (state->lastPen.isCosmetic())
+ opacity = (int) 256*width;
+ else
+ opacity = (int) 256*width*state->txscale;
+ opacity = qBound(0, opacity, 256);
+
+ drawCaps = state->lastPen.capStyle() != Qt::FlatCap;
+
+ if (strokeSelection & FastDraw) {
+ color = INTERPOLATE_PIXEL_256(state->penData.solid.color, opacity, 0, 0);
+ QRasterBuffer *buffer = state->penData.rasterBuffer;
+ pixels = (uint *)buffer->buffer();
+ ppl = buffer->bytesPerLine()>>2;
+ }
+
+ // setup FP clip bounds
+ xmin = clip.left() - 1;
+ xmax = clip.right() + 2;
+ ymin = clip.top() - 1;
+ ymax = clip.bottom() + 2;
+
+ lastPixel.x = -1;
+}
+
+// returns true if the whole line gets clipped away
+bool QCosmeticStroker::clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2)
+{
+ // basic/rough clipping is done in floating point coordinates to avoid
+ // integer overflow problems.
+ if (x1 < xmin) {
+ if (x2 <= xmin)
+ goto clipped;
+ y1 += (y2 - y1)/(x2 - x1) * (xmin - x1);
+ x1 = xmin;
+ } else if (x1 > xmax) {
+ if (x2 >= xmax)
+ goto clipped;
+ y1 += (y2 - y1)/(x2 - x1) * (xmax - x1);
+ x1 = xmax;
+ }
+ if (x2 < xmin) {
+ lastPixel.x = -1;
+ y2 += (y2 - y1)/(x2 - x1) * (xmin - x2);
+ x2 = xmin;
+ } else if (x2 > xmax) {
+ lastPixel.x = -1;
+ y2 += (y2 - y1)/(x2 - x1) * (xmax - x2);
+ x2 = xmax;
+ }
+
+ if (y1 < ymin) {
+ if (y2 <= ymin)
+ goto clipped;
+ x1 += (x2 - x1)/(y2 - y1) * (ymin - y1);
+ y1 = ymin;
+ } else if (y1 > ymax) {
+ if (y2 >= ymax)
+ goto clipped;
+ x1 += (x2 - x1)/(y2 - y1) * (ymax - y1);
+ y1 = ymax;
+ }
+ if (y2 < ymin) {
+ lastPixel.x = -1;
+ x2 += (x2 - x1)/(y2 - y1) * (ymin - y2);
+ y2 = ymin;
+ } else if (y2 > ymax) {
+ lastPixel.x = -1;
+ x2 += (x2 - x1)/(y2 - y1) * (ymax - y2);
+ y2 = ymax;
+ }
+
+ return false;
+
+ clipped:
+ lastPixel.x = -1;
+ return true;
+}
+
+
+void QCosmeticStroker::drawLine(const QPointF &p1, const QPointF &p2)
+{
+ QPointF start = p1 * state->matrix;
+ QPointF end = p2 * state->matrix;
+
+ patternOffset = state->lastPen.dashOffset()*64;
+ lastPixel.x = -1;
+
+ stroke(this, start.x(), start.y(), end.x(), end.y(), drawCaps ? CapBegin|CapEnd : 0);
+
+ blend(current_span, spans, &state->penData);
+ current_span = 0;
+}
+
+void QCosmeticStroker::drawPoints(const QPoint *points, int num)
+{
+ const QPoint *end = points + num;
+ while (points < end) {
+ QPointF p = QPointF(*points) * state->matrix;
+ drawPixel(this, qRound(p.x()), qRound(p.y()), 255);
+ ++points;
+ }
+
+ blend(current_span, spans, &state->penData);
+ current_span = 0;
+}
+
+void QCosmeticStroker::drawPoints(const QPointF *points, int num)
+{
+ const QPointF *end = points + num;
+ while (points < end) {
+ QPointF p = (*points) * state->matrix;
+ drawPixel(this, qRound(p.x()), qRound(p.y()), 255);
+ ++points;
+ }
+
+ blend(current_span, spans, &state->penData);
+ current_span = 0;
+}
+
+void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal ry2)
+{
+ // this is basically the same code as used in the aliased stroke method,
+ // but it only determines the direction and last point of a line
+ //
+ // This is being used to have proper dropout control for closed contours
+ // by calculating the direction and last pixel of the last segment in the contour.
+ // the info is then used to perform dropout control when drawing the first line segment
+ // of the contour
+ lastPixel.x = -1;
+ lastPixel.y = -1;
+
+ if (clipLine(rx1, ry1, rx2, ry2))
+ return;
+
+ const int half = 32;
+ int x1 = toF26Dot6(rx1) + half;
+ int y1 = toF26Dot6(ry1) + half;
+ int x2 = toF26Dot6(rx2) + half;
+ int y2 = toF26Dot6(ry2) + half;
+
+ int dx = qAbs(x2 - x1);
+ int dy = qAbs(y2 - y1);
+
+ if (dx < dy) {
+ // vertical
+ bool swapped = false;
+ if (y1 > y2) {
+ swapped = true;
+ qSwap(y1, y2);
+ qSwap(x1, x2);
+ --x1; --x2; --y1; --y2;
+ }
+ int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1);
+ int x = x1 << 10;
+
+ int y = (y1+32) >> 6;
+ int ys = (y2+32) >> 6;
+
+ if (y != ys) {
+ x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6;
+
+ if (swapped) {
+ lastPixel.x = x >> 16;
+ lastPixel.y = y;
+ lastDir = QCosmeticStroker::BottomToTop;
+ } else {
+ lastPixel.x = (x + (ys - y - 1)*xinc) >> 16;
+ lastPixel.y = ys - 1;
+ lastDir = QCosmeticStroker::TopToBottom;
+ }
+ lastAxisAligned = qAbs(xinc) < (1 << 14);
+ }
+ } else {
+ // horizontal
+ if (!dx)
+ return;
+
+ bool swapped = false;
+ if (x1 > x2) {
+ swapped = true;
+ qSwap(x1, x2);
+ qSwap(y1, y2);
+ --x1; --x2; --y1; --y2;
+ }
+ int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1);
+ int y = y1 << 10;
+
+ int x = (x1+32) >> 6;
+ int xs = (x2+32) >> 6;
+
+ if (x != xs) {
+ y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6;
+
+ if (swapped) {
+ lastPixel.x = x;
+ lastPixel.y = y >> 16;
+ lastDir = QCosmeticStroker::RightToLeft;
+ } else {
+ lastPixel.x = xs - 1;
+ lastPixel.y = (y + (xs - x - 1)*yinc) >> 16;
+ lastDir = QCosmeticStroker::LeftToRight;
+ }
+ lastAxisAligned = qAbs(yinc) < (1 << 14);
+ }
+ }
+// qDebug() << " moveTo: setting last pixel to x/y dir" << lastPixel.x << lastPixel.y << lastDir;
+}
+
+static inline const QPainterPath::ElementType *subPath(const QPainterPath::ElementType *t, const QPainterPath::ElementType *end,
+ const qreal *points, bool *closed)
+{
+ const QPainterPath::ElementType *start = t;
+ ++t;
+
+ // find out if the subpath is closed
+ while (t < end) {
+ if (*t == QPainterPath::MoveToElement)
+ break;
+ ++t;
+ }
+
+ int offset = t - start - 1;
+// qDebug() << "subpath" << offset << points[0] << points[1] << points[2*offset] << points[2*offset+1];
+ *closed = (points[0] == points[2*offset] && points[1] == points[2*offset + 1]);
+
+ return t;
+}
+
+void QCosmeticStroker::drawPath(const QVectorPath &path)
+{
+// qDebug() << ">>>> drawpath" << path.convertToPainterPath()
+// << "antialiasing:" << (bool)(state->renderHints & QPainter::Antialiasing) << " implicit close:" << path.hasImplicitClose();
+ if (path.isEmpty())
+ return;
+
+ const qreal *points = path.points();
+ const QPainterPath::ElementType *type = path.elements();
+
+ if (type) {
+ const QPainterPath::ElementType *end = type + path.elementCount();
+
+ while (type < end) {
+ Q_ASSERT(type == path.elements() || *type == QPainterPath::MoveToElement);
+
+ QPointF p = QPointF(points[0], points[1]) * state->matrix;
+ QPointF movedTo = p;
+ patternOffset = state->lastPen.dashOffset()*64;
+ lastPixel.x = -1;
+
+ bool closed;
+ const QPainterPath::ElementType *e = subPath(type, end, points, &closed);
+ if (closed) {
+ const qreal *p = points + 2*(e-type);
+ QPointF p1 = QPointF(p[-4], p[-3]) * state->matrix;
+ QPointF p2 = QPointF(p[-2], p[-1]) * state->matrix;
+ calculateLastPoint(p1.x(), p1.y(), p2.x(), p2.y());
+ }
+ int caps = (!closed & drawCaps) ? CapBegin : NoCaps;
+// qDebug() << "closed =" << closed << capString(caps);
+
+ points += 2;
+ ++type;
+
+ while (type < e) {
+ QPointF p2 = QPointF(points[0], points[1]) * state->matrix;
+ switch (*type) {
+ case QPainterPath::MoveToElement:
+ Q_ASSERT(!"Logic error");
+ break;
+
+ case QPainterPath::LineToElement:
+ if (!closed && drawCaps && type == e - 1)
+ caps |= CapEnd;
+ stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps);
+ p = p2;
+ points += 2;
+ ++type;
+ break;
+
+ case QPainterPath::CurveToElement: {
+ if (!closed && drawCaps && type == e - 3)
+ caps |= CapEnd;
+ QPointF p3 = QPointF(points[2], points[3]) * state->matrix;
+ QPointF p4 = QPointF(points[4], points[5]) * state->matrix;
+ renderCubic(p, p2, p3, p4, caps);
+ p = p4;
+ type += 3;
+ points += 6;
+ break;
+ }
+ case QPainterPath::CurveToDataElement:
+ Q_ASSERT(!"QPainterPath::toSubpathPolygons(), bad element type");
+ break;
+ }
+ caps = NoCaps;
+ }
+ }
+ } else { // !type, simple polygon
+ QPointF p = QPointF(points[0], points[1]) * state->matrix;
+ QPointF movedTo = p;
+ patternOffset = state->lastPen.dashOffset()*64;
+ lastPixel.x = -1;
+
+ const qreal *end = points + 2*path.elementCount();
+ // handle closed path case
+ bool closed = path.hasImplicitClose() || (points[0] == end[-2] && points[1] == end[-1]);
+ int caps = (!closed & drawCaps) ? CapBegin : NoCaps;
+ if (closed) {
+ QPointF p2 = QPointF(end[-2], end[-1]) * state->matrix;
+ calculateLastPoint(p2.x(), p2.y(), p.x(), p.y());
+ }
+
+ points += 2;
+ while (points < end) {
+ QPointF p2 = QPointF(points[0], points[1]) * state->matrix;
+
+ if (!closed && drawCaps && points == end - 2)
+ caps |= CapEnd;
+
+ stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps);
+
+ p = p2;
+ points += 2;
+ caps = NoCaps;
+ }
+ if (path.hasImplicitClose())
+ stroke(this, p.x(), p.y(), movedTo.x(), movedTo.y(), NoCaps);
+ }
+
+
+ blend(current_span, spans, &state->penData);
+ current_span = 0;
+}
+
+void QCosmeticStroker::renderCubic(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4, int caps)
+{
+// qDebug() << ">>>> renderCubic" << p1 << p2 << p3 << p4 << capString(caps);
+ const int maxSubDivisions = 6;
+ PointF points[3*maxSubDivisions + 4];
+
+ points[3].x = p1.x();
+ points[3].y = p1.y();
+ points[2].x = p2.x();
+ points[2].y = p2.y();
+ points[1].x = p3.x();
+ points[1].y = p3.y();
+ points[0].x = p4.x();
+ points[0].y = p4.y();
+
+ PointF *p = points;
+ int level = maxSubDivisions;
+
+ renderCubicSubdivision(p, level, caps);
+}
+
+static void splitCubic(QCosmeticStroker::PointF *points)
+{
+ const qreal half = .5;
+ qreal a, b, c, d;
+
+ points[6].x = points[3].x;
+ c = points[1].x;
+ d = points[2].x;
+ points[1].x = a = ( points[0].x + c ) * half;
+ points[5].x = b = ( points[3].x + d ) * half;
+ c = ( c + d ) * half;
+ points[2].x = a = ( a + c ) * half;
+ points[4].x = b = ( b + c ) * half;
+ points[3].x = ( a + b ) * half;
+
+ points[6].y = points[3].y;
+ c = points[1].y;
+ d = points[2].y;
+ points[1].y = a = ( points[0].y + c ) * half;
+ points[5].y = b = ( points[3].y + d ) * half;
+ c = ( c + d ) * half;
+ points[2].y = a = ( a + c ) * half;
+ points[4].y = b = ( b + c ) * half;
+ points[3].y = ( a + b ) * half;
+}
+
+void QCosmeticStroker::renderCubicSubdivision(QCosmeticStroker::PointF *points, int level, int caps)
+{
+ if (level) {
+ qreal dx = points[3].x - points[0].x;
+ qreal dy = points[3].y - points[0].y;
+ qreal len = ((qreal).25) * (qAbs(dx) + qAbs(dy));
+
+ if (qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) >= len ||
+ qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) >= len) {
+ splitCubic(points);
+
+ --level;
+ renderCubicSubdivision(points + 3, level, caps & CapBegin);
+ renderCubicSubdivision(points, level, caps & CapEnd);
+ return;
+ }
+ }
+
+ stroke(this, points[3].x, points[3].y, points[0].x, points[0].y, caps);
+}
+
+static inline int swapCaps(int caps)
+{
+ return ((caps & QCosmeticStroker::CapBegin) << 1) |
+ ((caps & QCosmeticStroker::CapEnd) >> 1);
+}
+
+// adjust line by half a pixel
+static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc)
+{
+ if (caps & QCosmeticStroker::CapBegin) {
+ x1 -= 32;
+ y -= yinc >> 1;
+ }
+ if (caps & QCosmeticStroker::CapEnd) {
+ x2 += 32;
+ }
+}
+
+/*
+ The hard part about this is dropout control and avoiding douple drawing of points when
+ the drawing shifts from horizontal to vertical or back.
+ */
+template<DrawPixel drawPixel, class Dasher>
+static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps)
+{
+ if (stroker->clipLine(rx1, ry1, rx2, ry2))
+ return;
+
+ static const int half = 32;
+ int x1 = toF26Dot6(rx1) + half;
+ int y1 = toF26Dot6(ry1) + half;
+ int x2 = toF26Dot6(rx2) + half;
+ int y2 = toF26Dot6(ry2) + half;
+
+ int dx = qAbs(x2 - x1);
+ int dy = qAbs(y2 - y1);
+
+ QCosmeticStroker::Point last = stroker->lastPixel;
+
+// qDebug() << "stroke" << x1/64. << y1/64. << x2/64. << y2/64. << capString(caps);
+
+ if (dx < dy) {
+ // vertical
+
+ bool swapped = false;
+ if (y1 > y2) {
+ swapped = true;
+ qSwap(y1, y2);
+ qSwap(x1, x2);
+ caps = swapCaps(caps);
+ --x1; --x2; --y1; --y2;
+ }
+ int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1);
+ int x = x1 << 10;
+
+ capAdjust(caps, y1, y2, x, xinc);
+
+ int y = (y1+32) >> 6;
+ int ys = (y2+32) >> 6;
+
+ if (y != ys) {
+ x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6;
+
+ // calculate first and last pixel and perform dropout control
+ QCosmeticStroker::Direction dir = QCosmeticStroker::TopToBottom;
+ QCosmeticStroker::Point first;
+ first.x = x >> 16;
+ first.y = y;
+ last.x = (x + (ys - y - 1)*xinc) >> 16;
+ last.y = ys - 1;
+ if (swapped) {
+ qSwap(first, last);
+ dir = QCosmeticStroker::BottomToTop;
+ }
+ bool axisAligned = qAbs(xinc) < (1 << 14);
+ if (stroker->lastPixel.x >= 0) {
+ if (first.x == stroker->lastPixel.x &&
+ first.y == stroker->lastPixel.y) {
+ // remove duplicated pixel
+ if (swapped) {
+ --ys;
+ } else {
+ ++y;
+ x += xinc;
+ }
+ } else if (stroker->lastDir != dir &&
+ (((axisAligned && stroker->lastAxisAligned) &&
+ stroker->lastPixel.x != first.x && stroker->lastPixel.y != first.y) ||
+ (qAbs(stroker->lastPixel.x - first.x) > 1 &&
+ qAbs(stroker->lastPixel.y - first.y) > 1))) {
+ // have a missing pixel, insert it
+ if (swapped) {
+ ++ys;
+ } else {
+ --y;
+ x -= xinc;
+ }
+ }
+ }
+ stroker->lastDir = dir;
+ stroker->lastAxisAligned = axisAligned;
+
+ Dasher dasher(stroker, swapped, y << 6, ys << 6);
+
+ do {
+ if (dasher.on())
+ drawPixel(stroker, x >> 16, y, 255);
+ dasher.adjust();
+ x += xinc;
+ } while (++y < ys);
+ }
+ } else {
+ // horizontal
+ if (!dx)
+ return;
+
+ bool swapped = false;
+ if (x1 > x2) {
+ swapped = true;
+ qSwap(x1, x2);
+ qSwap(y1, y2);
+ caps = swapCaps(caps);
+ --x1; --x2; --y1; --y2;
+ }
+ int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1);
+ int y = y1 << 10;
+
+ capAdjust(caps, x1, x2, y, yinc);
+
+ int x = (x1+32) >> 6;
+ int xs = (x2+32) >> 6;
+
+
+ if (x != xs) {
+ y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6;
+
+ // calculate first and last pixel to perform dropout control
+ QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight;
+ QCosmeticStroker::Point first;
+ first.x = x;
+ first.y = y >> 16;
+ last.x = xs - 1;
+ last.y = (y + (xs - x - 1)*yinc) >> 16;
+ if (swapped) {
+ qSwap(first, last);
+ dir = QCosmeticStroker::RightToLeft;
+ }
+ bool axisAligned = qAbs(yinc) < (1 << 14);
+ if (stroker->lastPixel.x >= 0) {
+ if (first.x == stroker->lastPixel.x && first.y == stroker->lastPixel.y) {
+ // remove duplicated pixel
+ if (swapped) {
+ --xs;
+ } else {
+ ++x;
+ y += yinc;
+ }
+ } else if (stroker->lastDir != dir &&
+ (((axisAligned && stroker->lastAxisAligned) &&
+ stroker->lastPixel.x != first.x && stroker->lastPixel.y != first.y) ||
+ (qAbs(stroker->lastPixel.x - first.x) > 1 &&
+ qAbs(stroker->lastPixel.y - first.y) > 1))) {
+ // have a missing pixel, insert it
+ if (swapped) {
+ ++xs;
+ } else {
+ --x;
+ y -= yinc;
+ }
+ }
+ }
+ stroker->lastDir = dir;
+ stroker->lastAxisAligned = axisAligned;
+
+ Dasher dasher(stroker, swapped, x << 6, xs << 6);
+
+ do {
+ if (dasher.on())
+ drawPixel(stroker, x, y >> 16, 255);
+ dasher.adjust();
+ y += yinc;
+ } while (++x < xs);
+ }
+ }
+ stroker->lastPixel = last;
+}
+
+
+template<DrawPixel drawPixel, class Dasher>
+static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps)
+{
+ if (stroker->clipLine(rx1, ry1, rx2, ry2))
+ return;
+
+ int x1 = toF26Dot6(rx1);
+ int y1 = toF26Dot6(ry1);
+ int x2 = toF26Dot6(rx2);
+ int y2 = toF26Dot6(ry2);
+
+ int dx = x2 - x1;
+ int dy = y2 - y1;
+
+ if (qAbs(dx) < qAbs(dy)) {
+ // vertical
+
+ int xinc = F16Dot16FixedDiv(dx, dy);
+
+ bool swapped = false;
+ if (y1 > y2) {
+ qSwap(y1, y2);
+ qSwap(x1, x2);
+ swapped = true;
+ caps = swapCaps(caps);
+ }
+
+ int x = (x1 - 32) << 10;
+ x -= ( ((y1 & 63) - 32) * xinc ) >> 6;
+
+ capAdjust(caps, y1, y2, x, xinc);
+
+ Dasher dasher(stroker, swapped, y1, y2);
+
+ int y = y1 >> 6;
+ int ys = y2 >> 6;
+
+ int alphaStart, alphaEnd;
+ if (y == ys) {
+ alphaStart = y2 - y1;
+ Q_ASSERT(alphaStart >= 0 && alphaStart < 64);
+ alphaEnd = 0;
+ } else {
+ alphaStart = 64 - (y1 & 63);
+ alphaEnd = (y2 & 63);
+ }
+// qDebug() << "vertical" << x1/64. << y1/64. << x2/64. << y2/64.;
+// qDebug() << " x=" << x << "dx=" << dx << "xi=" << (x>>16) << "xsi=" << ((x+(ys-y)*dx)>>16) << "y=" << y << "ys=" << ys;
+
+ // draw first pixel
+ if (dasher.on()) {
+ uint alpha = (quint8)(x >> 8);
+ drawPixel(stroker, x>>16, y, (255-alpha) * alphaStart >> 6);
+ drawPixel(stroker, (x>>16) + 1, y, alpha * alphaStart >> 6);
+ }
+ dasher.adjust();
+ x += xinc;
+ ++y;
+ if (y < ys) {
+ do {
+ if (dasher.on()) {
+ uint alpha = (quint8)(x >> 8);
+ drawPixel(stroker, x>>16, y, (255-alpha));
+ drawPixel(stroker, (x>>16) + 1, y, alpha);
+ }
+ dasher.adjust();
+ x += xinc;
+ } while (++y < ys);
+ }
+ // draw last pixel
+ if (alphaEnd && dasher.on()) {
+ uint alpha = (quint8)(x >> 8);
+ drawPixel(stroker, x>>16, y, (255-alpha) * alphaEnd >> 6);
+ drawPixel(stroker, (x>>16) + 1, y, alpha * alphaEnd >> 6);
+ }
+ } else {
+ // horizontal
+ if (!dx)
+ return;
+
+ int yinc = F16Dot16FixedDiv(dy, dx);
+
+ bool swapped = false;
+ if (x1 > x2) {
+ qSwap(x1, x2);
+ qSwap(y1, y2);
+ swapped = true;
+ caps = swapCaps(caps);
+ }
+
+ int y = (y1 - 32) << 10;
+ y -= ( ((x1 & 63) - 32) * yinc ) >> 6;
+
+ capAdjust(caps, x1, x2, y, yinc);
+
+ Dasher dasher(stroker, swapped, x1, x2);
+
+ int x = x1 >> 6;
+ int xs = x2 >> 6;
+
+// qDebug() << "horizontal" << x1/64. << y1/64. << x2/64. << y2/64.;
+// qDebug() << " y=" << y << "dy=" << dy << "x=" << x << "xs=" << xs << "yi=" << (y>>16) << "ysi=" << ((y+(xs-x)*dy)>>16);
+ int alphaStart, alphaEnd;
+ if (x == xs) {
+ alphaStart = x2 - x1;
+ Q_ASSERT(alphaStart >= 0 && alphaStart < 64);
+ alphaEnd = 0;
+ } else {
+ alphaStart = 64 - (x1 & 63);
+ alphaEnd = (x2 & 63);
+ }
+
+ // draw first pixel
+ if (dasher.on()) {
+ uint alpha = (quint8)(y >> 8);
+ drawPixel(stroker, x, y>>16, (255-alpha) * alphaStart >> 6);
+ drawPixel(stroker, x, (y>>16) + 1, alpha * alphaStart >> 6);
+ }
+ dasher.adjust();
+ y += yinc;
+ ++x;
+ // draw line
+ if (x < xs) {
+ do {
+ if (dasher.on()) {
+ uint alpha = (quint8)(y >> 8);
+ drawPixel(stroker, x, y>>16, (255-alpha));
+ drawPixel(stroker, x, (y>>16) + 1, alpha);
+ }
+ dasher.adjust();
+ y += yinc;
+ } while (++x < xs);
+ }
+ // draw last pixel
+ if (alphaEnd && dasher.on()) {
+ uint alpha = (quint8)(y >> 8);
+ drawPixel(stroker, x, y>>16, (255-alpha) * alphaEnd >> 6);
+ drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6);
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
new file mode 100644
index 0000000000..0aa71fc9cd
--- /dev/null
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QCOSMETICSTROKER_P_H
+#define QCOSMETICSTROKER_P_H
+
+#include <private/qdrawhelper_p.h>
+#include <private/qvectorpath_p.h>
+#include <private/qpaintengine_raster_p.h>
+#include <qpen.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QCosmeticStroker;
+
+
+typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
+
+class QCosmeticStroker
+{
+public:
+ struct Point {
+ int x;
+ int y;
+ };
+ struct PointF {
+ qreal x;
+ qreal y;
+ };
+
+ enum Caps {
+ NoCaps = 0,
+ CapBegin = 0x1,
+ CapEnd = 0x2,
+ };
+
+ // used to avoid drop outs or duplicated points
+ enum Direction {
+ TopToBottom,
+ BottomToTop,
+ LeftToRight,
+ RightToLeft
+ };
+
+ QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr)
+ : state(s),
+ clip(dr),
+ pattern(0),
+ reversePattern(0),
+ patternSize(0),
+ patternLength(0),
+ patternOffset(0),
+ current_span(0),
+ lastDir(LeftToRight),
+ lastAxisAligned(false)
+ { setup(); }
+ ~QCosmeticStroker() { free(pattern); free(reversePattern); }
+ void drawLine(const QPointF &p1, const QPointF &p2);
+ void drawPath(const QVectorPath &path);
+ void drawPoints(const QPoint *points, int num);
+ void drawPoints(const QPointF *points, int num);
+
+
+ QRasterPaintEngineState *state;
+ QRect clip;
+ // clip bounds in real
+ qreal xmin, xmax;
+ qreal ymin, ymax;
+
+ StrokeLine stroke;
+ bool drawCaps;
+
+ int *pattern;
+ int *reversePattern;
+ int patternSize;
+ int patternLength;
+ int patternOffset;
+
+ enum { NSPANS = 255 };
+ QT_FT_Span spans[NSPANS];
+ int current_span;
+ ProcessSpans blend;
+
+ int opacity;
+
+ uint color;
+ uint *pixels;
+ int ppl;
+
+ Direction lastDir;
+ Point lastPixel;
+ bool lastAxisAligned;
+
+private:
+ void setup();
+
+ void renderCubic(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4, int caps);
+ void renderCubicSubdivision(PointF *points, int level, int caps);
+ // used for closed subpaths
+ void calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal ry2);
+
+public:
+ bool clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2);
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QCOSMETICLINE_H
diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp
index b53353bf3a..4469704668 100644
--- a/src/gui/painting/qgraphicssystemex_symbian.cpp
+++ b/src/gui/painting/qgraphicssystemex_symbian.cpp
@@ -44,10 +44,39 @@
#include "private/qbackingstore_p.h"
#include "private/qapplication_p.h"
-#include <QDebug>
+#include <e32property.h>
QT_BEGIN_NAMESPACE
+static bool bcm2727Initialized = false;
+static bool bcm2727 = false;
+
+bool QSymbianGraphicsSystemEx::hasBCM2727()
+{
+ if (bcm2727Initialized)
+ return bcm2727;
+
+ const TUid KIvePropertyCat = {0x2726beef};
+ enum TIvePropertyChipType {
+ EVCBCM2727B1 = 0x00000000,
+ EVCBCM2763A0 = 0x04000100,
+ EVCBCM2763B0 = 0x04000102,
+ EVCBCM2763C0 = 0x04000103,
+ EVCBCM2763C1 = 0x04000104,
+ EVCBCMUnknown = 0x7fffffff
+ };
+
+ TInt chipType = EVCBCMUnknown;
+ if (RProperty::Get(KIvePropertyCat, 0, chipType) == KErrNone) {
+ if (chipType == EVCBCM2727B1)
+ bcm2727 = true;
+ }
+
+ bcm2727Initialized = true;
+
+ return bcm2727;
+}
+
void QSymbianGraphicsSystemEx::releaseCachedGpuResources()
{
// Do nothing here
@@ -64,11 +93,6 @@ void QSymbianGraphicsSystemEx::releaseAllGpuResources()
}
}
-bool QSymbianGraphicsSystemEx::hasBCM2727()
-{
- return !QApplicationPrivate::instance()->useTranslucentEGLSurfaces;
-}
-
void QSymbianGraphicsSystemEx::forceToRaster(QWidget *window)
{
if (window && window->isWindow()) {
diff --git a/src/gui/painting/qgraphicssystemex_symbian_p.h b/src/gui/painting/qgraphicssystemex_symbian_p.h
index c1d1bdf2e3..1f2a7c650c 100644
--- a/src/gui/painting/qgraphicssystemex_symbian_p.h
+++ b/src/gui/painting/qgraphicssystemex_symbian_p.h
@@ -62,9 +62,10 @@ class QWidget;
class Q_GUI_EXPORT QSymbianGraphicsSystemEx : public QGraphicsSystemEx
{
public:
+ static bool hasBCM2727();
+
virtual void releaseCachedGpuResources();
virtual void releaseAllGpuResources();
- virtual bool hasBCM2727();
virtual void forceToRaster(QWidget *window);
};
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index 7c17c1b46e..8b607b28b8 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -47,6 +47,8 @@
QT_BEGIN_NAMESPACE
+static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
+
#define qreal_to_fixed_26_6(f) (int(f * 64))
@@ -214,6 +216,13 @@ void QOutlineMapper::endOutline()
elements = m_elements_dev.data();
}
+ if (m_round_coords) {
+ // round coordinates to match outlines drawn with drawLine_midpoint_i
+ for (int i = 0; i < m_elements.size(); ++i)
+ elements[i] = QPointF(qFloor(elements[i].x() + aliasedCoordinateDelta),
+ qFloor(elements[i].y() + aliasedCoordinateDelta));
+ }
+
controlPointRect = boundingRect(elements, element_count);
#ifdef QT_DEBUG_CONVERT
diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h
index 1432d6fc4b..388858ca44 100644
--- a/src/gui/painting/qoutlinemapper_p.h
+++ b/src/gui/painting/qoutlinemapper_p.h
@@ -95,7 +95,8 @@ public:
m_tags(0),
m_contours(0),
m_polygon_dev(0),
- m_in_clip_elements(false)
+ m_in_clip_elements(false),
+ m_round_coords(false)
{
}
@@ -201,6 +202,8 @@ public:
QT_FT_Outline *convertPath(const QPainterPath &path);
QT_FT_Outline *convertPath(const QVectorPath &path);
+ void setCoordinateRounding(bool coordinateRounding) { m_round_coords = coordinateRounding; }
+
inline QPainterPath::ElementType *elementTypes() const { return m_element_types.size() == 0 ? 0 : m_element_types.data(); }
public:
@@ -234,6 +237,9 @@ public:
bool m_valid;
bool m_in_clip_elements;
+
+private:
+ bool m_round_coords;
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 9562d83932..c46513a07c 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -387,6 +387,7 @@ void QPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDraw
\value MaxUser Last user type ID
\value OpenGL2
\value PaintBuffer
+ \value Blitter
*/
/*!
diff --git a/src/gui/painting/qpaintengine_mac_p.h b/src/gui/painting/qpaintengine_mac_p.h
index c87501ee1a..2434011e52 100644
--- a/src/gui/painting/qpaintengine_mac_p.h
+++ b/src/gui/painting/qpaintengine_mac_p.h
@@ -121,6 +121,8 @@ public:
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode)
{ QPaintEngine::drawPolygon(points, pointCount, mode); }
+ bool supportsTransformations(qreal, const QTransform &) const { return true; };
+
protected:
friend class QMacPrintEngine;
friend class QMacPrintEnginePrivate;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 5ce94f84ec..30553b5972 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -69,6 +69,7 @@
// #include <private/qrasterizer_p.h>
#include <private/qimage_p.h>
#include <private/qstatictext_p.h>
+#include <private/qcosmeticstroker_p.h>
#include "qmemrotate_p.h"
#include "qpaintengine_raster_p.h"
@@ -126,6 +127,9 @@ void dumpClip(int width, int height, const QClipData *clip);
// 4 pixels.
#define int_dim(pos, dim) (int(pos+dim) - int(pos))
+// use the same rounding as in qrasterizer.cpp (6 bit fixed point)
+static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
+
#ifdef Q_WS_WIN
extern bool qt_cleartype_enabled;
#endif
@@ -156,16 +160,6 @@ enum LineDrawMode {
LineDrawIncludeLastPixel
};
-static void drawLine_midpoint_i(int x1, int y1, int x2, int y2, ProcessSpans span_func, QSpanData *data,
- LineDrawMode style, const QIntRect &rect);
-static void drawLine_midpoint_dashed_i(int x1, int y1, int x2, int y2,
- QPen *pen, ProcessSpans span_func, QSpanData *data,
- LineDrawMode style, const QIntRect &devRect,
- int *patternOffset);
-// static void drawLine_midpoint_f(qreal x1, qreal y1, qreal x2, qreal y2,
-// ProcessSpans span_func, QSpanData *data,
-// LineDrawMode style, const QRect &devRect);
-
static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
ProcessSpans pen_func, ProcessSpans brush_func,
QSpanData *pen_data, QSpanData *brush_data);
@@ -789,14 +783,12 @@ void QRasterPaintEngine::updatePen(const QPen &pen)
s->stroker = 0;
}
+ ensureState(); // needed because of tx_noshear...
s->flags.fast_pen = pen_style > Qt::NoPen
- && s->penData.blend
- && !s->flags.antialiased
- && (penWidth == 0 || (penWidth <= 1
- && (s->matrix.type() <= QTransform::TxTranslate
- || pen.isCosmetic())));
+ && s->penData.blend
+ && ((pen.isCosmetic() && penWidth <= 1)
+ || (s->flags.tx_noshear && penWidth * s->txscale <= 1));
- ensureState(); // needed because of tx_noshear...
s->flags.non_complex_pen = qpen_capStyle(s->lastPen) <= Qt::SquareCap && s->flags.tx_noshear;
s->strokeFlags = 0;
@@ -1513,6 +1505,7 @@ void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount)
qDebug(" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount);
#endif
Q_D(QRasterPaintEngine);
+ ensureState();
QRasterPaintEngineState *s = state();
// Fill
@@ -1541,32 +1534,14 @@ void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount)
ensurePen();
if (s->penData.blend) {
- if (s->flags.fast_pen && s->lastPen.brush().isOpaque()) {
- const QRect *r = rects;
- const QRect *lastRect = rects + rectCount;
- while (r < lastRect) {
- int left = r->x();
- int right = r->x() + r->width();
- int top = r->y();
- int bottom = r->y() + r->height();
-
-#ifdef Q_WS_MAC
- int pts[] = { top, left,
- top, right,
- bottom, right,
- bottom, left };
-#else
- int pts[] = { left, top,
- right, top,
- right, bottom,
- left, bottom };
-#endif
-
- strokePolygonCosmetic((QPoint *) pts, 4, WindingMode);
- ++r;
+ QRectVectorPath path;
+ if (s->flags.fast_pen) {
+ QCosmeticStroker stroker(s, d->deviceRect);
+ for (int i = 0; i < rectCount; ++i) {
+ path.set(rects[i]);
+ stroker.drawPath(path);
}
} else {
- QRectVectorPath path;
for (int i = 0; i < rectCount; ++i) {
path.set(rects[i]);
stroke(path, s->pen);
@@ -1581,13 +1556,13 @@ void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount)
void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount)
{
#ifdef QT_DEBUG_DRAW
- qDebug(" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount);
+ qDebug(" - QRasterPaintEngine::drawRect(QRectF*), rectCount=%d", rectCount);
#endif
#ifdef QT_FAST_SPANS
Q_D(QRasterPaintEngine);
+ ensureState();
QRasterPaintEngineState *s = state();
- ensureState();
if (s->flags.tx_noshear) {
ensureBrush();
@@ -1605,59 +1580,17 @@ void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount)
ensurePen();
if (s->penData.blend) {
- qreal width = s->pen.isCosmetic()
- ? (s->lastPen.widthF() == 0 ? 1 : s->lastPen.widthF())
- : s->lastPen.widthF() * s->txscale;
-
- if (s->flags.fast_pen && s->lastPen.brush().isOpaque()) {
- for (int i = 0; i < rectCount; ++i) {
- const QRectF &r = rects[i];
- qreal left = r.x();
- qreal right = r.x() + r.width();
- qreal top = r.y();
- qreal bottom = r.y() + r.height();
- qreal pts[] = { left, top,
- right, top,
- right, bottom,
- left, bottom };
- strokePolygonCosmetic((QPointF *) pts, 4, WindingMode);
- }
- } else if (width <= 1 && qpen_style(s->lastPen) == Qt::SolidLine) {
- d->initializeRasterizer(&s->penData);
-
+ QRectVectorPath path;
+ if (s->flags.fast_pen) {
+ QCosmeticStroker stroker(s, d->deviceRect);
for (int i = 0; i < rectCount; ++i) {
- const QRectF &rect = rects[i].normalized();
- if (rect.isEmpty()) {
- qreal pts[] = { rect.left(), rect.top(), rect.right(), rect.bottom() };
- QVectorPath vp(pts, 2, 0, QVectorPath::LinesHint);
- QPaintEngineEx::stroke(vp, s->lastPen);
- } else {
- const QPointF tl = s->matrix.map(rect.topLeft());
- const QPointF tr = s->matrix.map(rect.topRight());
- const QPointF bl = s->matrix.map(rect.bottomLeft());
- const QPointF br = s->matrix.map(rect.bottomRight());
- const qreal w = width / (rect.width() * s->txscale);
- const qreal h = width / (rect.height() * s->txscale);
- d->rasterizer->rasterizeLine(tl, tr, w); // top
- d->rasterizer->rasterizeLine(bl, br, w); // bottom
- d->rasterizer->rasterizeLine(bl, tl, h); // left
- d->rasterizer->rasterizeLine(br, tr, h); // right
- }
+ path.set(rects[i]);
+ stroker.drawPath(path);
}
} else {
for (int i = 0; i < rectCount; ++i) {
- const QRectF &r = rects[i];
- qreal left = r.x();
- qreal right = r.x() + r.width();
- qreal top = r.y();
- qreal bottom = r.y() + r.height();
- qreal pts[] = { left, top,
- right, top,
- right, bottom,
- left, bottom,
- left, top };
- QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
- QPaintEngineEx::stroke(vp, s->lastPen);
+ path.set(rects[i]);
+ QPaintEngineEx::stroke(path, s->lastPen);
}
}
}
@@ -1674,36 +1607,16 @@ void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount)
*/
void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
{
+ Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
+
ensurePen(pen);
if (!s->penData.blend)
return;
- if (s->flags.fast_pen && !path.isCurved()
- && s->lastPen.brush().isOpaque()) {
- int count = path.elementCount();
- QPointF *points = (QPointF *) path.points();
- const QPainterPath::ElementType *types = path.elements();
- if (types) {
- int first = 0;
- int last;
- while (first < count) {
- while (first < count && types[first] != QPainterPath::MoveToElement) ++first;
- last = first + 1;
- while (last < count && types[last] == QPainterPath::LineToElement) ++last;
- strokePolygonCosmetic(points + first, last - first,
- path.hasImplicitClose() && last == count // only close last one..
- ? WindingMode
- : PolylineMode);
- first = last;
- }
- } else {
- strokePolygonCosmetic(points, count,
- path.hasImplicitClose()
- ? WindingMode
- : PolylineMode);
- }
-
+ if (s->flags.fast_pen) {
+ QCosmeticStroker stroker(s, d->deviceRect);
+ stroker.drawPath(path);
} else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) {
qreal width = s->lastPen.isCosmetic()
? (qpen_widthf(s->lastPen) == 0 ? 1 : qpen_widthf(s->lastPen))
@@ -1760,10 +1673,10 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
static inline QRect toNormalizedFillRect(const QRectF &rect)
{
- int x1 = qRound(rect.x());
- int y1 = qRound(rect.y());
- int x2 = qRound(rect.right());
- int y2 = qRound(rect.bottom());
+ int x1 = qRound(rect.x() + aliasedCoordinateDelta);
+ int y1 = qRound(rect.y() + aliasedCoordinateDelta);
+ int x2 = qRound(rect.right() + aliasedCoordinateDelta);
+ int y2 = qRound(rect.bottom() + aliasedCoordinateDelta);
if (x2 < x1)
qSwap(x1, x2);
@@ -1818,26 +1731,6 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
}
}
- if (path.shape() == QVectorPath::EllipseHint) {
- if (!s->flags.antialiased && s->matrix.type() <= QTransform::TxScale) {
- const qreal *p = path.points();
- QPointF tl = QPointF(p[0], p[1]) * s->matrix;
- QPointF br = QPointF(p[4], p[5]) * s->matrix;
- QRectF r = s->matrix.mapRect(QRectF(tl, br));
-
- ProcessSpans penBlend = d->getPenFunc(r, &s->penData);
- ProcessSpans brushBlend = d->getBrushFunc(r, &s->brushData);
- const QRect brect = QRect(int(r.x()), int(r.y()),
- int_dim(r.x(), r.width()),
- int_dim(r.y(), r.height()));
- if (brect == r) {
- drawEllipse_midpoint_i(brect, d->deviceRect, penBlend, brushBlend,
- &s->penData, &s->brushData);
- return;
- }
- }
- }
-
// ### Optimize for non transformed ellipses and rectangles...
QRectF cpRect = path.controlPointRect();
const QRect deviceRect = s->matrix.mapRect(cpRect).toRect();
@@ -2032,6 +1925,7 @@ void QRasterPaintEngine::fillPolygon(const QPointF *points, int pointCount, Poly
*/
void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
{
+ Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
#ifdef QT_DEBUG_DRAW
@@ -2048,20 +1942,23 @@ void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly
}
ensurePen();
- ensureBrush();
if (mode != PolylineMode) {
// Do the fill...
+ ensureBrush();
if (s->brushData.blend) {
+ d->outlineMapper->setCoordinateRounding(s->penData.blend && s->flags.fast_pen && s->lastPen.brush().isOpaque());
fillPolygon(points, pointCount, mode);
+ d->outlineMapper->setCoordinateRounding(false);
}
}
// Do the outline...
if (s->penData.blend) {
- if (s->flags.fast_pen && s->lastPen.brush().isOpaque())
- strokePolygonCosmetic(points, pointCount, mode);
- else {
- QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
+ QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
+ if (s->flags.fast_pen) {
+ QCosmeticStroker stroker(s, d->deviceRect);
+ stroker.drawPath(vp);
+ } else {
QPaintEngineEx::stroke(vp, s->lastPen);
}
}
@@ -2090,13 +1987,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
return;
}
- ensureState();
ensurePen();
- if (!(s->flags.int_xform && s->flags.fast_pen && (!s->penData.blend || s->pen.brush().isOpaque()))) {
- // this calls the float version
- QPaintEngineEx::drawPolygon(points, pointCount, mode);
- return;
- }
// Do the fill
if (mode != PolylineMode) {
@@ -2104,6 +1995,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
if (s->brushData.blend) {
// Compose polygon fill..,
ensureOutlineMapper();
+ d->outlineMapper->setCoordinateRounding(s->penData.blend != 0);
d->outlineMapper->beginOutline(mode == WindingMode ? Qt::WindingFill : Qt::OddEvenFill);
d->outlineMapper->moveTo(*points);
const QPoint *p = points;
@@ -2117,235 +2009,30 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
&s->brushData);
d->rasterize(d->outlineMapper->outline(), brushBlend, &s->brushData, d->rasterBuffer.data());
+ d->outlineMapper->setCoordinateRounding(false);
}
}
// Do the outline...
if (s->penData.blend) {
- if (s->flags.fast_pen && s->lastPen.brush().isOpaque())
- strokePolygonCosmetic(points, pointCount, mode);
- else {
- int count = pointCount * 2;
- QVarLengthArray<qreal> fpoints(count);
-#ifdef Q_WS_MAC
- for (int i=0; i<count; i+=2) {
- fpoints[i] = ((int *) points)[i+1];
- fpoints[i+1] = ((int *) points)[i];
- }
-#else
- for (int i=0; i<count; ++i)
- fpoints[i] = ((int *) points)[i];
-#endif
- QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
- QPaintEngineEx::stroke(vp, s->lastPen);
+ int count = pointCount * 2;
+ QVarLengthArray<qreal> fpoints(count);
+ #ifdef Q_WS_MAC
+ for (int i=0; i<count; i+=2) {
+ fpoints[i] = ((int *) points)[i+1];
+ fpoints[i+1] = ((int *) points)[i];
}
- }
-}
-
-/*!
- \internal
-*/
-void QRasterPaintEngine::strokePolygonCosmetic(const QPointF *points, int pointCount, PolygonDrawMode mode)
-{
- Q_D(QRasterPaintEngine);
- QRasterPaintEngineState *s = state();
-
- Q_ASSERT(s->penData.blend);
- Q_ASSERT(s->flags.fast_pen);
-
- bool needs_closing = mode != PolylineMode && points[0] != points[pointCount-1];
-
- // Use fast path for 0 width / trivial pens.
- QIntRect devRect;
- devRect.set(d->deviceRect);
-
- LineDrawMode mode_for_last = (s->lastPen.capStyle() != Qt::FlatCap
- ? LineDrawIncludeLastPixel
- : LineDrawNormal);
- int dashOffset = int(s->lastPen.dashOffset());
-
- // Draw all the line segments.
- for (int i=1; i<pointCount; ++i) {
-
- QPointF lp1 = points[i-1] * s->matrix;
- QPointF lp2 = points[i] * s->matrix;
-
- const QRectF brect(lp1, lp2);
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine) {
- drawLine_midpoint_i(qFloor(lp1.x()), qFloor(lp1.y()),
- qFloor(lp2.x()), qFloor(lp2.y()),
- penBlend, &s->penData,
- i == pointCount - 1 ? mode_for_last : LineDrawIncludeLastPixel,
- devRect);
+ #else
+ for (int i=0; i<count; ++i)
+ fpoints[i] = ((int *) points)[i];
+ #endif
+ QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
+
+ if (s->flags.fast_pen) {
+ QCosmeticStroker stroker(s, d->deviceRect);
+ stroker.drawPath(vp);
} else {
- drawLine_midpoint_dashed_i(qFloor(lp1.x()), qFloor(lp1.y()),
- qFloor(lp2.x()), qFloor(lp2.y()),
- &s->lastPen,
- penBlend, &s->penData,
- i == pointCount - 1 ? mode_for_last : LineDrawIncludeLastPixel,
- devRect, &dashOffset);
- }
- }
-
- // Polygons are implicitly closed.
- if (needs_closing) {
- QPointF lp1 = points[pointCount-1] * s->matrix;
- QPointF lp2 = points[0] * s->matrix;
-
- const QRectF brect(lp1, lp2);
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine) {
- drawLine_midpoint_i(qFloor(lp1.x()), qFloor(lp1.y()),
- qFloor(lp2.x()), qFloor(lp2.y()),
- penBlend, &s->penData,
- LineDrawIncludeLastPixel,
- devRect);
- } else {
- drawLine_midpoint_dashed_i(qFloor(lp1.x()), qFloor(lp1.y()),
- qFloor(lp2.x()), qFloor(lp2.y()),
- &s->lastPen,
- penBlend, &s->penData,
- LineDrawIncludeLastPixel,
- devRect, &dashOffset);
- }
- }
-
-}
-
-/*!
- \internal
-*/
-void QRasterPaintEngine::strokePolygonCosmetic(const QPoint *points, int pointCount, PolygonDrawMode mode)
-{
- Q_D(QRasterPaintEngine);
- QRasterPaintEngineState *s = state();
-
- // We assert here because this function is called from drawRects
- // and drawPolygon and they already do ensurePen(), so we skip that
- // here to avoid duplicate checks..
- Q_ASSERT(s->penData.blend);
-
- bool needs_closing = mode != PolylineMode && points[0] != points[pointCount-1];
-
- QIntRect devRect;
- devRect.set(d->deviceRect);
-
- LineDrawMode mode_for_last = (s->lastPen.capStyle() != Qt::FlatCap
- ? LineDrawIncludeLastPixel
- : LineDrawNormal);
-
- int m11 = int(s->matrix.m11());
- int m22 = int(s->matrix.m22());
- int dx = int(s->matrix.dx());
- int dy = int(s->matrix.dy());
- int m13 = int(s->matrix.m13());
- int m23 = int(s->matrix.m23());
- bool affine = !m13 && !m23;
-
- int dashOffset = int(s->lastPen.dashOffset());
-
- if (affine) {
- // Draw all the line segments.
- for (int i=1; i<pointCount; ++i) {
- const QPoint lp1 = points[i-1] * s->matrix;
- const QPoint lp2 = points[i] * s->matrix;
- const QRect brect(lp1, lp2);
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
-
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(lp1.x(), lp1.y(),
- lp2.x(), lp2.y(),
- penBlend, &s->penData,
- i == pointCount - 1 ? mode_for_last : LineDrawIncludeLastPixel,
- devRect);
- else
- drawLine_midpoint_dashed_i(lp1.x(), lp1.y(),
- lp2.x(), lp2.y(),
- &s->lastPen,
- penBlend, &s->penData,
- i == pointCount - 1 ? mode_for_last : LineDrawIncludeLastPixel,
- devRect, &dashOffset);
-
- }
-
- // Polygons are implicitly closed.
- if (needs_closing) {
- const QPoint lp1 = points[pointCount - 1] * s->matrix;
- const QPoint lp2 = points[0] * s->matrix;
- const QRect brect(lp1, lp2);
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
-
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(lp1.x(), lp1.y(),
- lp2.x(), lp2.y(),
- penBlend, &s->penData, LineDrawIncludeLastPixel,
- devRect);
- else
- drawLine_midpoint_dashed_i(lp1.x(), lp1.y(),
- lp2.x(), lp2.y(),
- &s->lastPen,
- penBlend, &s->penData, LineDrawIncludeLastPixel,
- devRect, &dashOffset);
- }
- } else {
- // Draw all the line segments.
- for (int i=1; i<pointCount; ++i) {
- int x1 = points[i-1].x() * m11 + dx;
- int y1 = points[i-1].y() * m22 + dy;
- qreal w = m13*points[i-1].x() + m23*points[i-1].y() + 1.;
- w = 1/w;
- x1 = int(x1*w);
- y1 = int(y1*w);
- int x2 = points[i].x() * m11 + dx;
- int y2 = points[i].y() * m22 + dy;
- w = m13*points[i].x() + m23*points[i].y() + 1.;
- w = 1/w;
- x2 = int(x2*w);
- y2 = int(y2*w);
-
- const QRect brect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(x1, y1, x2, y2,
- penBlend, &s->penData,
- i == pointCount - 1 ? mode_for_last : LineDrawIncludeLastPixel,
- devRect);
- else
- drawLine_midpoint_dashed_i(x1, y1, x2, y2,
- &s->lastPen,
- penBlend, &s->penData,
- i == pointCount - 1 ? mode_for_last : LineDrawIncludeLastPixel,
- devRect, &dashOffset);
-
- }
-
- int x1 = points[pointCount-1].x() * m11 + dx;
- int y1 = points[pointCount-1].y() * m22 + dy;
- qreal w = m13*points[pointCount-1].x() + m23*points[pointCount-1].y() + 1.;
- w = 1/w;
- x1 = int(x1*w);
- y1 = int(y1*w);
- int x2 = points[0].x() * m11 + dx;
- int y2 = points[0].y() * m22 + dy;
- w = m13*points[0].x() + m23*points[0].y() + 1.;
- w = 1/w;
- x2 = int(x2 * w);
- y2 = int(y2 * w);
- // Polygons are implicitly closed.
-
- if (needs_closing) {
- const QRect brect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(x1, y1, x2, y2,
- penBlend, &s->penData, LineDrawIncludeLastPixel,
- devRect);
- else
- drawLine_midpoint_dashed_i(x1, y1, x2, y2,
- &s->lastPen,
- penBlend, &s->penData, LineDrawIncludeLastPixel,
- devRect, &dashOffset);
+ QPaintEngineEx::stroke(vp, s->lastPen);
}
}
}
@@ -2579,7 +2266,10 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
int sr_b = qCeil(sr.bottom()) - 1;
if (s->matrix.type() <= QTransform::TxScale && !s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) {
+ // as fillRect will apply the aliased coordinate delta we need to
+ // subtract it here as we don't use it for image drawing
QTransform old = s->matrix;
+ s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta);
// Do whatever fillRect() does, but without premultiplying the color if it's already premultiplied.
QRgb color = img.pixel(sr_l, sr_t);
@@ -2723,9 +2413,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
d->initializeRasterizer(&d->image_filler_xform);
d->rasterizer->setAntialiased(s->flags.antialiased);
+ const QPointF offs = s->flags.antialiased ? QPointF() : QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta);
+
const QRectF &rect = r.normalized();
- const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f);
- const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f);
+ const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f) - offs;
+ const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f) - offs;
if (s->flags.tx_noshear)
d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
@@ -2734,12 +2426,13 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
return;
}
#endif
+ const qreal offs = s->flags.antialiased ? qreal(0) : aliasedCoordinateDelta;
QPainterPath path;
path.addRect(r);
QTransform m = s->matrix;
s->matrix = QTransform(m.m11(), m.m12(), m.m13(),
m.m21(), m.m22(), m.m23(),
- m.m31(), m.m32(), m.m33());
+ m.m31() - offs, m.m32() - offs, m.m33());
fillPath(path, &d->image_filler_xform);
s->matrix = m;
} else {
@@ -3167,7 +2860,15 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
} else
#endif
{
- QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(fontEngine->glyphFormat) : d->glyphCacheType;
+ QFontEngineGlyphCache::Type glyphType;
+ if (fontEngine->glyphFormat >= 0) {
+ glyphType = QFontEngineGlyphCache::Type(fontEngine->glyphFormat);
+ } else if (s->matrix.type() > QTransform::TxTranslate
+ && d->glyphCacheType == QFontEngineGlyphCache::Raster_RGBMask) {
+ glyphType = QFontEngineGlyphCache::Raster_A8;
+ } else {
+ glyphType = d->glyphCacheType;
+ }
QImageTextureGlyphCache *cache =
static_cast<QImageTextureGlyphCache *>(fontEngine->glyphCache(0, glyphType, s->matrix));
@@ -3191,6 +2892,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
rightShift = 3; // divide by 8
int margin = cache->glyphMargin();
+ const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta);
const uchar *bits = image.bits();
for (int i=0; i<numGlyphs; ++i) {
@@ -3201,7 +2903,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
continue;
int x = qFloor(positions[i].x) + c.baseLineX - margin;
- int y = qFloor(positions[i].y) - c.baseLineY - margin;
+ int y = qFloor(positions[i].y + offs) - c.baseLineY - margin;
// printf("drawing [%d %d %d %d] baseline [%d %d], glyph: %d, to: %d %d, pos: %d %d\n",
// c.x, c.y,
@@ -3239,13 +2941,15 @@ void QRasterPaintEngine::drawGlyphsS60(const QPointF &p, const QTextItemInt &ti)
fe->setFontScale(matrix.m11());
ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
+ const QFixed aliasDelta = QFixed::fromReal(aliasedCoordinateDelta);
+
for (int i=0; i<glyphs.size(); ++i) {
TOpenFontCharMetrics tmetrics;
const TUint8 *glyphBitmapBytes;
TSize glyphBitmapSize;
fe->getCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize);
- const int x = qFloor(positions[i].x + tmetrics.HorizBearingX());
- const int y = qFloor(positions[i].y - tmetrics.HorizBearingY());
+ const int x = qFloor(positions[i].x + tmetrics.HorizBearingX() + aliasDelta);
+ const int y = qFloor(positions[i].y - tmetrics.HorizBearingY() + aliasDelta);
alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight);
}
@@ -3346,19 +3050,6 @@ QRasterPaintEnginePrivate::getBrushFunc(const QRectF &rect,
}
inline ProcessSpans
-QRasterPaintEnginePrivate::getPenFunc(const QRect &rect,
- const QSpanData *data) const
-{
- Q_Q(const QRasterPaintEngine);
- const QRasterPaintEngineState *s = q->state();
-
- if (!s->flags.fast_pen && s->matrix.type() > QTransform::TxTranslate)
- return data->blend;
- const int penWidth = s->flags.fast_pen ? 1 : qCeil(s->pen.widthF());
- return isUnclipped(rect, penWidth) ? data->unclipped_blend : data->blend;
-}
-
-inline ProcessSpans
QRasterPaintEnginePrivate::getPenFunc(const QRectF &rect,
const QSpanData *data) const
{
@@ -3379,8 +3070,13 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
ensurePen();
ensureState();
- drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
- textItem->fontEngine());
+ QFontEngine *fontEngine = textItem->fontEngine();
+ if (!supportsTransformations(fontEngine)) {
+ drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
+ fontEngine);
+ } else {
+ QPaintEngineEx::drawStaticTextItem(textItem);
+ }
}
/*!
@@ -3403,36 +3099,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
#if defined (Q_WS_WIN) || defined(Q_WS_MAC)
- bool drawCached = true;
-
- if (s->matrix.type() >= QTransform::TxProject)
- drawCached = false;
-
- // don't try to cache huge fonts
- const qreal pixelSize = ti.fontEngine->fontDef.pixelSize;
- if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) >= 64 * 64)
- drawCached = false;
-
- // ### Remove the TestFontEngine and Box engine crap, in these
- // ### cases we should delegate painting to the font engine
- // ### directly...
-
-#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE)
- QFontEngine::Type fontEngineType = ti.fontEngine->type();
- // qDebug() << "type" << fontEngineType << s->matrix.type();
- if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) ti.fontEngine)->ttf && s->matrix.type() > QTransform::TxTranslate)
- || (s->matrix.type() <= QTransform::TxTranslate
- && (fontEngineType == QFontEngine::TestFontEngine
- || fontEngineType == QFontEngine::Box))) {
- drawCached = false;
- }
-#else
- if (s->matrix.type() > QTransform::TxTranslate)
- drawCached = false;
-#endif
- if (drawCached) {
- QRasterPaintEngineState *s = state();
-
+ if (!supportsTransformations(ti.fontEngine)) {
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> glyphs;
@@ -3467,7 +3134,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
|| (fontEngine->type() == QFontEngine::Proxy
&& !(static_cast<QProxyFontEngine *>(fontEngine)->drawAsOutline()))
)) {
- fontEngine->draw(this, qFloor(p.x()), qFloor(p.y()), ti);
+ fontEngine->draw(this, qFloor(p.x() + aliasedCoordinateDelta), qFloor(p.y() + aliasedCoordinateDelta), ti);
return;
}
#endif // Q_WS_QWS
@@ -3490,6 +3157,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
for(int i = 0; i < glyphs.size(); i++) {
QImage img = fontEngine->alphaMapForGlyph(glyphs[i]);
glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[i]);
+ // ### hm, perhaps an QFixed offs = QFixed::fromReal(aliasedCoordinateDelta) is needed here?
alphaPenBlt(img.bits(), img.bytesPerLine(), img.depth(),
qRound(positions[i].x + metrics.x),
qRound(positions[i].y + metrics.y),
@@ -3544,48 +3212,16 @@ void QRasterPaintEngine::drawPoints(const QPointF *points, int pointCount)
QRasterPaintEngineState *s = state();
ensurePen();
- qreal pw = s->lastPen.widthF();
- if (!s->flags.fast_pen && (s->matrix.type() > QTransform::TxTranslate || pw > 1)) {
- QPaintEngineEx::drawPoints(points, pointCount);
-
- } else {
- if (!s->penData.blend)
- return;
-
- QVarLengthArray<QT_FT_Span, 4096> array(pointCount);
- QT_FT_Span span = { 0, 1, 0, 255 };
- const QPointF *end = points + pointCount;
- qreal trans_x, trans_y;
- int x, y;
- int left = d->deviceRect.x();
- int right = left + d->deviceRect.width();
- int top = d->deviceRect.y();
- int bottom = top + d->deviceRect.height();
- int count = 0;
- while (points < end) {
- s->matrix.map(points->x(), points->y(), &trans_x, &trans_y);
- x = qFloor(trans_x);
- y = qFloor(trans_y);
- if (x >= left && x < right && y >= top && y < bottom) {
- if (count > 0) {
- const QT_FT_Span &last = array[count - 1];
- // spans must be sorted on y (primary) and x (secondary)
- if (y < last.y || (y == last.y && x < last.x)) {
- s->penData.blend(count, array.constData(), &s->penData);
- count = 0;
- }
- }
-
- span.x = x;
- span.y = y;
- array[count++] = span;
- }
- ++points;
- }
+ if (!s->penData.blend)
+ return;
- if (count > 0)
- s->penData.blend(count, array.constData(), &s->penData);
+ if (!s->flags.fast_pen) {
+ QPaintEngineEx::drawPoints(points, pointCount);
+ return;
}
+
+ QCosmeticStroker stroker(s, d->deviceRect);
+ stroker.drawPoints(points, pointCount);
}
@@ -3595,48 +3231,16 @@ void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount)
QRasterPaintEngineState *s = state();
ensurePen();
- double pw = s->lastPen.widthF();
- if (!s->flags.fast_pen && (s->matrix.type() > QTransform::TxTranslate || pw > 1)) {
- QPaintEngineEx::drawPoints(points, pointCount);
-
- } else {
- if (!s->penData.blend)
- return;
-
- QVarLengthArray<QT_FT_Span, 4096> array(pointCount);
- QT_FT_Span span = { 0, 1, 0, 255 };
- const QPoint *end = points + pointCount;
- qreal trans_x, trans_y;
- int x, y;
- int left = d->deviceRect.x();
- int right = left + d->deviceRect.width();
- int top = d->deviceRect.y();
- int bottom = top + d->deviceRect.height();
- int count = 0;
- while (points < end) {
- s->matrix.map(points->x(), points->y(), &trans_x, &trans_y);
- x = qFloor(trans_x);
- y = qFloor(trans_y);
- if (x >= left && x < right && y >= top && y < bottom) {
- if (count > 0) {
- const QT_FT_Span &last = array[count - 1];
- // spans must be sorted on y (primary) and x (secondary)
- if (y < last.y || (y == last.y && x < last.x)) {
- s->penData.blend(count, array.constData(), &s->penData);
- count = 0;
- }
- }
-
- span.x = x;
- span.y = y;
- array[count++] = span;
- }
- ++points;
- }
+ if (!s->penData.blend)
+ return;
- if (count > 0)
- s->penData.blend(count, array.constData(), &s->penData);
+ if (!s->flags.fast_pen) {
+ QPaintEngineEx::drawPoints(points, pointCount);
+ return;
}
+
+ QCosmeticStroker stroker(s, d->deviceRect);
+ stroker.drawPoints(points, pointCount);
}
/*!
@@ -3645,59 +3249,22 @@ void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount)
void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount)
{
#ifdef QT_DEBUG_DRAW
- qDebug() << " - QRasterPaintEngine::drawLine()";
+ qDebug() << " - QRasterPaintEngine::drawLines(QLine*)" << lineCount;
#endif
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
ensurePen();
+ if (!s->penData.blend)
+ return;
+
if (s->flags.fast_pen) {
- QIntRect bounds; bounds.set(d->deviceRect);
- LineDrawMode mode = s->lastPen.capStyle() == Qt::FlatCap
- ? LineDrawNormal
- : LineDrawIncludeLastPixel;
-
- int m11 = int(s->matrix.m11());
- int m22 = int(s->matrix.m22());
- int dx = qFloor(s->matrix.dx());
- int dy = qFloor(s->matrix.dy());
+ QCosmeticStroker stroker(s, d->deviceRect);
for (int i=0; i<lineCount; ++i) {
- int dashOffset = int(s->lastPen.dashOffset());
- if (s->flags.int_xform) {
- const QLine &l = lines[i];
- int x1 = l.x1() * m11 + dx;
- int y1 = l.y1() * m22 + dy;
- int x2 = l.x2() * m11 + dx;
- int y2 = l.y2() * m22 + dy;
-
- const QRect brect(QPoint(x1, y1), QPoint(x2, y2));
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(x1, y1, x2, y2,
- penBlend, &s->penData, mode, bounds);
- else
- drawLine_midpoint_dashed_i(x1, y1, x2, y2,
- &s->lastPen, penBlend,
- &s->penData, mode, bounds,
- &dashOffset);
- } else {
- QLineF line = lines[i] * s->matrix;
- const QRectF brect(QPointF(line.x1(), line.y1()),
- QPointF(line.x2(), line.y2()));
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(int(line.x1()), int(line.y1()),
- int(line.x2()), int(line.y2()),
- penBlend, &s->penData, mode, bounds);
- else
- drawLine_midpoint_dashed_i(int(line.x1()), int(line.y1()),
- int(line.x2()), int(line.y2()),
- &s->lastPen, penBlend,
- &s->penData, mode, bounds,
- &dashOffset);
- }
+ const QLine &l = lines[i];
+ stroker.drawLine(l.p1(), l.p2());
}
- } else if (s->penData.blend) {
+ } else {
QPaintEngineEx::drawLines(lines, lineCount);
}
}
@@ -3754,7 +3321,7 @@ void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line,
void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount)
{
#ifdef QT_DEBUG_DRAW
- qDebug() << " - QRasterPaintEngine::drawLine()";
+ qDebug() << " - QRasterPaintEngine::drawLines(QLineF *)" << lineCount;
#endif
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
@@ -3763,28 +3330,10 @@ void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount)
if (!s->penData.blend)
return;
if (s->flags.fast_pen) {
- QIntRect bounds;
- bounds.set(d->deviceRect);
- LineDrawMode mode = s->lastPen.capStyle() == Qt::FlatCap
- ? LineDrawNormal
- : LineDrawIncludeLastPixel;
-
+ QCosmeticStroker stroker(s, d->deviceRect);
for (int i=0; i<lineCount; ++i) {
- int dashOffset = int(s->lastPen.dashOffset());
- QLineF line = lines[i] * s->matrix;
- const QRectF brect(QPointF(line.x1(), line.y1()),
- QPointF(line.x2(), line.y2()));
- ProcessSpans penBlend = d->getPenFunc(brect, &s->penData);
- if (qpen_style(s->lastPen) == Qt::SolidLine)
- drawLine_midpoint_i(int(line.x1()), int(line.y1()),
- int(line.x2()), int(line.y2()),
- penBlend, &s->penData, mode, bounds);
- else
- drawLine_midpoint_dashed_i(int(line.x1()), int(line.y1()),
- int(line.x2()), int(line.y2()),
- &s->lastPen,
- penBlend, &s->penData, mode,
- bounds, &dashOffset);
+ QLineF line = lines[i];
+ stroker.drawLine(line.p1(), line.p2());
}
} else {
QPaintEngineEx::drawLines(lines, lineCount);
@@ -3802,7 +3351,8 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect)
ensurePen();
if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen)
- || (qpen_style(s->lastPen) == Qt::NoPen && !s->flags.antialiased))
+ || (qpen_style(s->lastPen) == Qt::NoPen))
+ && !s->flags.antialiased
&& qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT
&& !rect.isEmpty()
&& s->matrix.type() <= QTransform::TxScale) // no shear
@@ -3870,6 +3420,37 @@ void QRasterPaintEngine::releaseDC(HDC) const
#endif
+bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const
+{
+ const QTransform &m = state()->matrix;
+#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE)
+ QFontEngine::Type fontEngineType = fontEngine->type();
+ if ((fontEngineType == QFontEngine::Win && !((QFontEngineWin *) fontEngine)->ttf && m.type() > QTransform::TxTranslate)
+ || (m.type() <= QTransform::TxTranslate
+ && (fontEngineType == QFontEngine::TestFontEngine
+ || fontEngineType == QFontEngine::Box))) {
+ return true;
+ }
+#endif
+ return supportsTransformations(fontEngine->fontDef.pixelSize, m);
+}
+
+bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const
+{
+#if defined(Q_WS_MAC)
+ // Mac font engines don't support scaling and rotation
+ if (m.type() > QTransform::TxTranslate)
+#else
+ if (m.type() >= QTransform::TxProject)
+#endif
+ return true;
+
+ if (pixelSize * pixelSize * qAbs(m.determinant()) >= 64 * 64)
+ return true;
+
+ return false;
+}
+
/*!
\internal
*/
@@ -4821,7 +4402,7 @@ static void qt_span_fill_clipped(int spanCount, const QSpan *spans, void *userDa
while (spans < end) {
QSpan *clipped = cspans;
spans = qt_intersect_spans(fillData->clip, &currentClip, spans, end, &clipped, NSPANS);
-// qDebug() << "processed " << processed << "clipped" << clipped-cspans
+// qDebug() << "processed " << spanCount - (end - spans) << "clipped" << clipped-cspans
// << "span:" << cspans->x << cspans->y << cspans->len << spans->coverage;
if (clipped - cspans)
@@ -5473,759 +5054,6 @@ void QSpanData::initTexture(const QImage *image, int alpha, QTextureData::Type _
adjustSpanMethods();
}
-#ifdef Q_WS_WIN
-
-
-#endif
-
-
-/*!
- \internal
-
- Draws a line using the floating point midpoint algorithm. The line
- \a line is already in device coords at this point.
-*/
-
-static void drawLine_midpoint_i(int x1, int y1, int x2, int y2, ProcessSpans span_func, QSpanData *data,
- LineDrawMode style, const QIntRect &devRect)
-{
-#ifdef QT_DEBUG_DRAW
- qDebug() << " - drawLine_midpoint_i" << QLine(QPoint(x1, y1), QPoint(x2, y2));
-#endif
-
- int x, y;
- int dx, dy, d, incrE, incrNE;
-
- dx = x2 - x1;
- dy = y2 - y1;
-
- const int NSPANS = 256;
- QT_FT_Span spans[NSPANS];
- int current = 0;
- bool ordered = true;
-
- if (dy == 0) {
- // specialcase horizontal lines
- if (y1 >= devRect.y1 && y1 < devRect.y2) {
- int start = qMax(devRect.x1, qMin(x1, x2));
- int stop = qMax(x1, x2) + 1;
- int stop_clipped = qMin(devRect.x2, stop);
- int len = stop_clipped - start;
- if (style == LineDrawNormal && stop == stop_clipped)
- len--;
- if (len > 0) {
- spans[0].x = ushort(start);
- spans[0].len = ushort(len);
- spans[0].y = y1;
- spans[0].coverage = 255;
- span_func(1, spans, data);
- }
- }
- return;
- } else if (dx == 0) {
- // specialcase vertical lines
- if (x1 >= devRect.x1 && x1 < devRect.x2) {
- int start = qMax(devRect.y1, qMin(y1, y2));
- int stop = qMax(y1, y2) + 1;
- int stop_clipped = qMin(devRect.y2, stop);
- int len = stop_clipped - start;
- if (style == LineDrawNormal && stop == stop_clipped)
- len--;
- // hw: create spans directly instead to possibly avoid clipping
- if (len > 0)
- fillRect_normalized(QRect(x1, start, 1, len).normalized(), data, 0);
- }
- return;
- }
-
-
- if (qAbs(dx) >= qAbs(dy)) { /* if x is the major axis: */
-
- if (x2 < x1) { /* if coordinates are out of order */
- qt_swap_int(x1, x2);
- dx = -dx;
-
- qt_swap_int(y1, y2);
- dy = -dy;
- }
-
- int x_lower_limit = - 128;
- if (x1 < x_lower_limit) {
- int cy = dy * (x_lower_limit - x1) / dx + y1;
- drawLine_midpoint_i(x_lower_limit, cy, x2, y2, span_func, data, style, devRect);
- return;
- }
-
- if (style == LineDrawNormal)
- --x2;
-
- // In the loops below we increment before call the span function so
- // we need to stop one pixel before
- x2 = qMin(x2, devRect.x2 - 1);
-
- // completely clipped, so abort
- if (x2 <= x1) {
- return;
- }
-
- int x = x1;
- int y = y1;
-
- if (y2 <= y1)
- ordered = false;
-
- {
- const int index = (ordered ? current : NSPANS - 1 - current);
- spans[index].coverage = 255;
- spans[index].x = x;
- spans[index].y = y;
-
- if (x >= devRect.x1 && y >= devRect.y1 && y < devRect.y2)
- spans[index].len = 1;
- else
- spans[index].len = 0;
- }
-
- if (y2 > y1) { // 315 -> 360 and 135 -> 180 (unit circle degrees)
- y2 = qMin(y2, devRect.y2 - 1);
-
- incrE = dy * 2;
- d = incrE - dx;
- incrNE = (dy - dx) * 2;
-
- if (y > y2)
- goto flush_and_return;
-
- while (x < x2) {
- ++x;
- if (d > 0) {
- if (spans[current].len > 0)
- ++current;
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
-
- ++y;
- d += incrNE;
- if (y > y2)
- goto flush_and_return;
-
- spans[current].len = 0;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- } else {
- d += incrE;
- if (x == devRect.x1)
- spans[current].x = devRect.x1;
- }
-
- if (x < devRect.x1 || y < devRect.y1)
- continue;
-
- Q_ASSERT(x<devRect.x2);
- Q_ASSERT(y<devRect.y2);
- Q_ASSERT(spans[current].y == y);
- spans[current].len++;
- }
- if (spans[current].len > 0) {
- ++current;
- }
- } else { // 0-45 and 180->225 (unit circle degrees)
-
- y1 = qMin(y1, devRect.y2 - 1);
-
- incrE = dy * 2;
- d = incrE + dx;
- incrNE = (dy + dx) * 2;
-
- if (y < devRect.y1)
- goto flush_and_return;
-
- while (x < x2) {
- ++x;
- if (d < 0) {
- if (spans[NSPANS - 1 - current].len > 0)
- ++current;
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
-
- --y;
- d += incrNE;
- if (y < devRect.y1)
- goto flush_and_return;
-
- const int index = NSPANS - 1 - current;
- spans[index].len = 0;
- spans[index].coverage = 255;
- spans[index].x = x;
- spans[index].y = y;
- } else {
- d += incrE;
- if (x == devRect.x1)
- spans[NSPANS - 1 - current].x = devRect.x1;
- }
-
- if (x < devRect.x1 || y > y1)
- continue;
-
- Q_ASSERT(x<devRect.x2 && y<devRect.y2);
- Q_ASSERT(spans[NSPANS - 1 - current].y == y);
- spans[NSPANS - 1 - current].len++;
- }
- if (spans[NSPANS - 1 - current].len > 0) {
- ++current;
- }
- }
-
- } else {
-
- // if y is the major axis:
-
- if (y2 < y1) { /* if coordinates are out of order */
- qt_swap_int(y1, y2);
- dy = -dy;
-
- qt_swap_int(x1, x2);
- dx = -dx;
- }
-
- int y_lower_limit = - 128;
- if (y1 < y_lower_limit) {
- int cx = dx * (y_lower_limit - y1) / dy + x1;
- drawLine_midpoint_i(cx, y_lower_limit, x2, y2, span_func, data, style, devRect);
- return;
- }
-
- if (style == LineDrawNormal)
- --y2;
-
- // In the loops below we increment before call the span function so
- // we need to stop one pixel before
- y2 = qMin(y2, devRect.y2 - 1);
-
- // completely clipped, so abort
- if (y2 <= y1) {
- return;
- }
-
- x = x1;
- y = y1;
-
- if (x>=devRect.x1 && y>=devRect.y1 && x < devRect.x2) {
- Q_ASSERT(x >= devRect.x1 && y >= devRect.y1 && x < devRect.x2 && y < devRect.y2);
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
-
- if (x2 > x1) { // 90 -> 135 and 270 -> 315 (unit circle degrees)
- x2 = qMin(x2, devRect.x2 - 1);
- incrE = dx * 2;
- d = incrE - dy;
- incrNE = (dx - dy) * 2;
-
- if (x > x2)
- goto flush_and_return;
-
- while (y < y2) {
- if (d > 0) {
- ++x;
- d += incrNE;
- if (x > x2)
- goto flush_and_return;
- } else {
- d += incrE;
- }
- ++y;
- if (x < devRect.x1 || y < devRect.y1)
- continue;
- Q_ASSERT(x<devRect.x2 && y<devRect.y2);
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- } else { // 45 -> 90 and 225 -> 270 (unit circle degrees)
- x1 = qMin(x1, devRect.x2 - 1);
- incrE = dx * 2;
- d = incrE + dy;
- incrNE = (dx + dy) * 2;
-
- if (x < devRect.x1)
- goto flush_and_return;
-
- while (y < y2) {
- if (d < 0) {
- --x;
- d += incrNE;
- if (x < devRect.x1)
- goto flush_and_return;
- } else {
- d += incrE;
- }
- ++y;
- if (y < devRect.y1 || x > x1)
- continue;
- Q_ASSERT(x>=devRect.x1 && x<devRect.x2 && y>=devRect.y1 && y<devRect.y2);
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- }
- }
-flush_and_return:
- if (current > 0)
- span_func(current, ordered ? spans : spans + (NSPANS - current), data);
-}
-
-static void offset_pattern(int offset, bool *inDash, int *dashIndex, int *currentOffset, const QVarLengthArray<qreal> &pattern)
-{
- while (offset--) {
- if (--*currentOffset == 0) {
- *inDash = !*inDash;
- *dashIndex = ((*dashIndex + 1) % pattern.size());
- *currentOffset = int(pattern[*dashIndex]);
- }
- }
-}
-
-static void drawLine_midpoint_dashed_i(int x1, int y1, int x2, int y2,
- QPen *pen,
- ProcessSpans span_func, QSpanData *data,
- LineDrawMode style, const QIntRect &devRect,
- int *patternOffset)
-{
-#ifdef QT_DEBUG_DRAW
- qDebug() << " - drawLine_midpoint_dashed_i" << x1 << y1 << x2 << y2 << *patternOffset;
-#endif
-
- int x, y;
- int dx, dy, d, incrE, incrNE;
-
- dx = x2 - x1;
- dy = y2 - y1;
-
- Q_ASSERT(*patternOffset >= 0);
-
- const QVector<qreal> penPattern = pen->dashPattern();
- QVarLengthArray<qreal> pattern(penPattern.size());
-
- int patternLength = 0;
- for (int i = 0; i < penPattern.size(); ++i)
- patternLength += qMax<qreal>(1.0, (penPattern.at(i)));
-
- // pattern must be reversed if coordinates are out of order
- int reverseLength = -1;
- if (dy == 0 && x1 > x2)
- reverseLength = x1 - x2;
- else if (dx == 0 && y1 > y2)
- reverseLength = y1 - y2;
- else if (qAbs(dx) >= qAbs(dy) && x2 < x1) // x major axis
- reverseLength = qAbs(dx);
- else if (qAbs(dy) >= qAbs(dx) && y2 < y1) // y major axis
- reverseLength = qAbs(dy);
-
- const bool reversed = (reverseLength > -1);
- if (reversed) { // reverse pattern
- for (int i = 0; i < penPattern.size(); ++i)
- pattern[penPattern.size() - 1 - i] = qMax<qreal>(1.0, penPattern.at(i));
-
- *patternOffset = (patternLength - 1 - *patternOffset);
- *patternOffset += patternLength - (reverseLength % patternLength);
- *patternOffset = *patternOffset % patternLength;
- } else {
- for (int i = 0; i < penPattern.size(); ++i)
- pattern[i] = qMax<qreal>(1.0, penPattern.at(i));
- }
-
- int dashIndex = 0;
- bool inDash = !reversed;
- int currPattern = int(pattern[dashIndex]);
-
- // adjust pattern for offset
- offset_pattern(*patternOffset, &inDash, &dashIndex, &currPattern, pattern);
-
- const int NSPANS = 256;
- QT_FT_Span spans[NSPANS];
- int current = 0;
- bool ordered = true;
-
- if (dy == 0) {
- // specialcase horizontal lines
- if (y1 >= devRect.y1 && y1 < devRect.y2) {
- int start_unclipped = qMin(x1, x2);
- int start = qMax(devRect.x1, start_unclipped);
- int stop = qMax(x1, x2) + 1;
- int stop_clipped = qMin(devRect.x2, stop);
- int len = stop_clipped - start;
- if (style == LineDrawNormal && stop == stop_clipped)
- len--;
-
- // adjust pattern for starting offset
- offset_pattern(start - start_unclipped, &inDash, &dashIndex, &currPattern, pattern);
-
- if (len > 0) {
- int x = start;
- while (x < stop_clipped) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- const int dash = qMin(currPattern, stop_clipped - x);
- if (inDash) {
- spans[current].x = ushort(x);
- spans[current].len = ushort(dash);
- spans[current].y = y1;
- spans[current].coverage = 255;
- ++current;
- }
- if (dash < currPattern) {
- currPattern -= dash;
- } else {
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- inDash = !inDash;
- }
- x += dash;
- }
- }
- }
- goto flush_and_return;
- } else if (dx == 0) {
- if (x1 >= devRect.x1 && x1 < devRect.x2) {
- int start_unclipped = qMin(y1, y2);
- int start = qMax(devRect.y1, start_unclipped);
- int stop = qMax(y1, y2) + 1;
- int stop_clipped = qMin(devRect.y2, stop);
- if (style == LineDrawNormal && stop == stop_clipped)
- --stop;
- else
- stop = stop_clipped;
-
- // adjust pattern for starting offset
- offset_pattern(start - start_unclipped, &inDash, &dashIndex, &currPattern, pattern);
-
- // loop over dashes
- int y = start;
- while (y < stop) {
- const int dash = qMin(currPattern, stop - y);
- if (inDash) {
- for (int i = 0; i < dash; ++i) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].x = x1;
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].y = ushort(y + i);
- ++current;
- }
- }
- if (dash < currPattern) {
- currPattern -= dash;
- } else {
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- inDash = !inDash;
- }
- y += dash;
- }
- }
- goto flush_and_return;
- }
-
- if (qAbs(dx) >= qAbs(dy)) { /* if x is the major axis: */
-
- if (x2 < x1) { /* if coordinates are out of order */
- qt_swap_int(x1, x2);
- dx = -dx;
-
- qt_swap_int(y1, y2);
- dy = -dy;
- }
-
- if (style == LineDrawNormal)
- --x2;
-
- // In the loops below we increment before call the span function so
- // we need to stop one pixel before
- x2 = qMin(x2, devRect.x2 - 1);
-
- // completely clipped, so abort
- if (x2 <= x1)
- goto flush_and_return;
-
- int x = x1;
- int y = y1;
-
- if (x >= devRect.x1 && y >= devRect.y1 && y < devRect.y2) {
- Q_ASSERT(x < devRect.x2);
- if (inDash) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- if (--currPattern <= 0) {
- inDash = !inDash;
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- }
- }
-
- if (y2 > y1) { // 315 -> 360 and 135 -> 180 (unit circle degrees)
- y2 = qMin(y2, devRect.y2 - 1);
-
- incrE = dy * 2;
- d = incrE - dx;
- incrNE = (dy - dx) * 2;
-
- if (y > y2)
- goto flush_and_return;
-
- while (x < x2) {
- if (d > 0) {
- ++y;
- d += incrNE;
- if (y > y2)
- goto flush_and_return;
- } else {
- d += incrE;
- }
- ++x;
-
- const bool skip = x < devRect.x1 || y < devRect.y1;
- Q_ASSERT(skip || (x < devRect.x2 && y < devRect.y2));
- if (inDash && !skip) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- if (--currPattern <= 0) {
- inDash = !inDash;
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- }
- }
- } else { // 0-45 and 180->225 (unit circle degrees)
- y1 = qMin(y1, devRect.y2 - 1);
-
- incrE = dy * 2;
- d = incrE + dx;
- incrNE = (dy + dx) * 2;
-
- if (y < devRect.y1)
- goto flush_and_return;
-
- while (x < x2) {
- if (d < 0) {
- if (current > 0) {
- span_func(current, spans, data);
- current = 0;
- }
-
- --y;
- d += incrNE;
- if (y < devRect.y1)
- goto flush_and_return;
- } else {
- d += incrE;
- }
- ++x;
-
- const bool skip = x < devRect.x1 || y > y1;
- Q_ASSERT(skip || (x < devRect.x2 && y < devRect.y2));
- if (inDash && !skip) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- if (--currPattern <= 0) {
- inDash = !inDash;
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- }
- }
- }
- } else {
-
- // if y is the major axis:
-
- if (y2 < y1) { /* if coordinates are out of order */
- qt_swap_int(y1, y2);
- dy = -dy;
-
- qt_swap_int(x1, x2);
- dx = -dx;
- }
-
- if (style == LineDrawNormal)
- --y2;
-
- // In the loops below we increment before call the span function so
- // we need to stop one pixel before
- y2 = qMin(y2, devRect.y2 - 1);
-
- // completely clipped, so abort
- if (y2 <= y1)
- goto flush_and_return;
-
- x = x1;
- y = y1;
-
- if (x>=devRect.x1 && y>=devRect.y1 && x < devRect.x2) {
- Q_ASSERT(x < devRect.x2);
- if (inDash) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- if (--currPattern <= 0) {
- inDash = !inDash;
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- }
- }
-
- if (x2 > x1) { // 90 -> 135 and 270 -> 315 (unit circle degrees)
- x2 = qMin(x2, devRect.x2 - 1);
- incrE = dx * 2;
- d = incrE - dy;
- incrNE = (dx - dy) * 2;
-
- if (x > x2)
- goto flush_and_return;
-
- while (y < y2) {
- if (d > 0) {
- ++x;
- d += incrNE;
- if (x > x2)
- goto flush_and_return;
- } else {
- d += incrE;
- }
- ++y;
- const bool skip = x < devRect.x1 || y < devRect.y1;
- Q_ASSERT(skip || (x < devRect.x2 && y < devRect.y2));
- if (inDash && !skip) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- if (--currPattern <= 0) {
- inDash = !inDash;
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- }
- }
- } else { // 45 -> 90 and 225 -> 270 (unit circle degrees)
- x1 = qMin(x1, devRect.x2 - 1);
- incrE = dx * 2;
- d = incrE + dy;
- incrNE = (dx + dy) * 2;
-
- if (x < devRect.x1)
- goto flush_and_return;
-
- while (y < y2) {
- if (d < 0) {
- --x;
- d += incrNE;
- if (x < devRect.x1)
- goto flush_and_return;
- } else {
- d += incrE;
- }
- ++y;
- const bool skip = y < devRect.y1 || x > x1;
- Q_ASSERT(skip || (x >= devRect.x1 && x < devRect.x2 && y < devRect.y2));
- if (inDash && !skip) {
- if (current == NSPANS) {
- span_func(NSPANS, spans, data);
- current = 0;
- }
- spans[current].len = 1;
- spans[current].coverage = 255;
- spans[current].x = x;
- spans[current].y = y;
- ++current;
- }
- if (--currPattern <= 0) {
- inDash = !inDash;
- dashIndex = (dashIndex + 1) % pattern.size();
- currPattern = int(pattern[dashIndex]);
- }
- }
- }
- }
-flush_and_return:
- if (current > 0)
- span_func(current, ordered ? spans : spans + (NSPANS - current), data);
-
- // adjust offset
- if (reversed) {
- *patternOffset = (patternLength - 1 - *patternOffset);
- } else {
- *patternOffset = 0;
- for (int i = 0; i <= dashIndex; ++i)
- *patternOffset += int(pattern[i]);
- *patternOffset += patternLength - currPattern - 1;
- *patternOffset = (*patternOffset % patternLength);
- }
-}
-
/*!
\internal
\a x and \a y is relative to the midpoint of \a rect.
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 8859df0eed..8774fda4e3 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -196,9 +196,6 @@ public:
void stroke(const QVectorPath &path, const QPen &pen);
void fill(const QVectorPath &path, const QBrush &brush);
- void strokePolygonCosmetic(const QPoint *pts, int pointCount, PolygonDrawMode mode);
- void strokePolygonCosmetic(const QPointF *pt, int pointCount, PolygonDrawMode mode);
-
void clip(const QVectorPath &path, Qt::ClipOperation op);
void clip(const QRect &rect, Qt::ClipOperation op);
void clip(const QRegion &region, Qt::ClipOperation op);
@@ -249,6 +246,8 @@ public:
virtual void drawBufferSpan(const uint *buffer, int bufsize,
int x, int y, int length, uint const_alpha);
#endif
+ bool supportsTransformations(const QFontEngine *fontEngine) const;
+ bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
protected:
QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *);
@@ -328,7 +327,6 @@ public:
bool isUnclipped_normalized(const QRect &rect) const;
bool isUnclipped(const QRect &rect, int penWidth) const;
bool isUnclipped(const QRectF &rect, int penWidth) const;
- ProcessSpans getPenFunc(const QRect &rect, const QSpanData *data) const;
ProcessSpans getPenFunc(const QRectF &rect, const QSpanData *data) const;
ProcessSpans getBrushFunc(const QRect &rect, const QSpanData *data) const;
ProcessSpans getBrushFunc(const QRectF &rect, const QSpanData *data) const;
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 30cf2061de..8510416fcb 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -44,6 +44,8 @@
#include "qstroker_p.h"
#include "qbezier_p.h"
#include <private/qpainterpath_p.h>
+#include <private/qfontengine_p.h>
+#include <private/qstatictext_p.h>
#include <qvarlengtharray.h>
#include <qdebug.h>
@@ -831,7 +833,7 @@ void QPaintEngineEx::drawEllipse(const QRectF &r)
int point_count = 0;
x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count);
- QVectorPath vp((qreal *) pts, point_count, qpaintengineex_ellipse_types, QVectorPath::EllipseHint);
+ QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint);
draw(vp);
}
@@ -1057,5 +1059,48 @@ Q_GUI_EXPORT QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path)
return p;
}
+void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem)
+{
+ QPainterPath path;
+#ifndef Q_WS_MAC
+ path.setFillRule(Qt::WindingFill);
+#endif
+
+ if (staticTextItem->numGlyphs == 0)
+ return;
+
+ QFontEngine *fontEngine = staticTextItem->fontEngine();
+ fontEngine->addGlyphsToPath(staticTextItem->glyphs, staticTextItem->glyphPositions,
+ staticTextItem->numGlyphs, &path, 0);
+ if (!path.isEmpty()) {
+ QPainterState *s = state();
+ QPainter::RenderHints oldHints = s->renderHints;
+ bool changedHints = false;
+ if (bool(oldHints & QPainter::TextAntialiasing)
+ && !bool(fontEngine->fontDef.styleStrategy & QFont::NoAntialias)
+ && !bool(oldHints & QPainter::Antialiasing)) {
+ s->renderHints |= QPainter::Antialiasing;
+ renderHintsChanged();
+ changedHints = true;
+ }
+
+ fill(qtVectorPathForPath(path), staticTextItem->color);
+
+ if (changedHints) {
+ s->renderHints = oldHints;
+ renderHintsChanged();
+ }
+ }
+}
+
+bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &m) const
+{
+ Q_UNUSED(pixelSize);
+
+ if (!m.isAffine())
+ return true;
+
+ return false;
+}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 9730033c49..c6056855f0 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -202,7 +202,7 @@ public:
virtual void updateState(const QPaintEngineState &state);
- virtual void drawStaticTextItem(QStaticTextItem *) = 0;
+ virtual void drawStaticTextItem(QStaticTextItem *);
virtual void setState(QPainterState *s);
inline QPainterState *state() { return static_cast<QPainterState *>(QPaintEngine::state); }
@@ -227,6 +227,7 @@ public:
IsEmulationEngine = 0x02 // If set, this object is a QEmulationEngine.
};
virtual uint flags() const {return 0;}
+ virtual bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
protected:
QPaintEngineEx(QPaintEngineExPrivate &data);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 17b74517b5..5a566d1b76 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -152,14 +152,6 @@ static inline uint line_emulation(uint emulation)
| QPaintEngine_OpaqueBackground);
}
-static bool qt_paintengine_supports_transformations(QPaintEngine::Type type)
-{
- return type == QPaintEngine::OpenGL2
- || type == QPaintEngine::OpenVG
- || type == QPaintEngine::OpenGL
- || type == QPaintEngine::CoreGraphics;
-}
-
#ifndef QT_NO_DEBUG
static bool qt_painter_thread_test(int devType, const char *what, bool extraCondition = false)
{
@@ -2868,6 +2860,9 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op)
return;
}
+ if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip)
+ op = Qt::ReplaceClip;
+
d->state->clipRegion = rect;
d->state->clipOperation = op;
if (op == Qt::NoClip || op == Qt::ReplaceClip)
@@ -2923,6 +2918,9 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op)
return;
}
+ if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip)
+ op = Qt::ReplaceClip;
+
d->state->clipRegion = r;
d->state->clipOperation = op;
if (op == Qt::NoClip || op == Qt::ReplaceClip)
@@ -3328,6 +3326,9 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op)
return;
}
+ if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip)
+ op = Qt::ReplaceClip;
+
d->state->clipPath = path;
d->state->clipOperation = op;
if (op == Qt::NoClip || op == Qt::ReplaceClip)
@@ -5809,35 +5810,37 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
if (!font.isValid())
return;
- QVector<quint32> glyphIndexes = glyphRun.glyphIndexes();
- QVector<QPointF> glyphPositions = glyphRun.positions();
+ QGlyphRunPrivate *glyphRun_d = QGlyphRunPrivate::get(glyphRun);
- int count = qMin(glyphIndexes.size(), glyphPositions.size());
- QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count);
+ const quint32 *glyphIndexes = glyphRun_d->glyphIndexData;
+ const QPointF *glyphPositions = glyphRun_d->glyphPositionData;
- bool paintEngineSupportsTransformations =
- d->extended != 0
- ? qt_paintengine_supports_transformations(d->extended->type())
- : qt_paintengine_supports_transformations(d->engine->type());
+ int count = qMin(glyphRun_d->glyphIndexDataSize, glyphRun_d->glyphPositionDataSize);
+ QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count);
- // If the matrix is not affine, the paint engine will fall back to
- // drawing the glyphs as paths, which in turn means we should not
- // preprocess the glyph positions
- if (!d->state->matrix.isAffine())
- paintEngineSupportsTransformations = true;
+ QRawFontPrivate *fontD = QRawFontPrivate::get(font);
+ bool supportsTransformations;
+ if (d->extended != 0) {
+ supportsTransformations = d->extended->supportsTransformations(fontD->fontEngine->fontDef.pixelSize,
+ d->state->matrix);
+ } else {
+ supportsTransformations = d->engine->type() == QPaintEngine::CoreGraphics
+ || d->state->matrix.isAffine();
+ }
for (int i=0; i<count; ++i) {
- QPointF processedPosition = position + glyphPositions.at(i);
- if (!paintEngineSupportsTransformations)
+ QPointF processedPosition = position + glyphPositions[i];
+ if (!supportsTransformations)
processedPosition = d->state->transform().map(processedPosition);
fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition);
}
- d->drawGlyphs(glyphIndexes.data(), fixedPointPositions.data(), count, font, glyphRun.overline(),
+ d->drawGlyphs(glyphIndexes, fixedPointPositions.data(), count, font, glyphRun.overline(),
glyphRun.underline(), glyphRun.strikeOut());
}
-void QPainterPrivate::drawGlyphs(quint32 *glyphArray, QFixedPoint *positions, int glyphCount,
+void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positions,
+ int glyphCount,
const QRawFont &font, bool overline, bool underline,
bool strikeOut)
{
@@ -6004,11 +6007,12 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
return;
}
- bool paintEngineSupportsTransformations = qt_paintengine_supports_transformations(d->extended->type());
- if (paintEngineSupportsTransformations && !staticText_d->untransformedCoordinates) {
+ bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.pixelSize(),
+ d->state->matrix);
+ if (supportsTransformations && !staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = true;
staticText_d->needsRelayout = true;
- } else if (!paintEngineSupportsTransformations && staticText_d->untransformedCoordinates) {
+ } else if (!supportsTransformations && staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = false;
staticText_d->needsRelayout = true;
}
@@ -6468,8 +6472,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
const qreal underlineOffset = fe->underlinePosition().toReal();
// deliberately ceil the offset to avoid the underline coming too close to
// the text above it.
- const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
- const qreal underlinePos = pos.y() + qCeil(underlineOffset) - aliasedCoordinateDelta;
+ const qreal underlinePos = pos.y() + qCeil(underlineOffset);
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
underlineStyle = QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle));
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 35cdf86ee0..79d4b4bbe0 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -232,7 +232,7 @@ public:
void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation);
#if !defined(QT_NO_RAWFONT)
- void drawGlyphs(quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount,
+ void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount,
const QRawFont &font, bool overline = false, bool underline = false,
bool strikeOut = false);
#endif
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 6c5edbc44d..1d3f581b88 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -62,8 +62,8 @@ typedef int Q16Dot16;
#define SPAN_BUFFER_SIZE 256
-#define COORD_ROUNDING 0 // 0: round up, 1: round down
-#define COORD_OFFSET 0 // 26.6, 32 is half a pixel
+#define COORD_ROUNDING 1 // 0: round up, 1: round down
+#define COORD_OFFSET 32 // 26.6, 32 is half a pixel
static inline QT_FT_Vector PointToVector(const QPointF &p)
{
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 53fefa4fae..fdba9c99ea 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -296,14 +296,10 @@ void QTextureGlyphCache::fillInPendingGlyphs()
QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const
{
#if defined(Q_WS_X11)
- if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) {
+ if (m_type != Raster_RGBMask && m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) {
QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None;
QImage::Format imageFormat = QImage::Format_Invalid;
switch (m_type) {
- case Raster_RGBMask:
- format = QFontEngineFT::Format_A32;
- imageFormat = QImage::Format_RGB32;
- break;
case Raster_A8:
format = QFontEngineFT::Format_A8;
imageFormat = QImage::Format_Indexed8;
@@ -312,6 +308,10 @@ QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition
format = QFontEngineFT::Format_Mono;
imageFormat = QImage::Format_Mono;
break;
+ case Raster_RGBMask:
+ // impossible condition (see the if-clause above)
+ // this option is here only to silence a compiler warning
+ break;
};
QFontEngineFT *ft = static_cast<QFontEngineFT*> (m_current_fontengine);
@@ -367,7 +367,9 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
-#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11)
+#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA))
+ return 1;
+#elif defined(Q_WS_X11)
return 0;
#else
return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
@@ -386,7 +388,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
}
#endif
- if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
+ if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()),
qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(),
m_image.format());
diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
index aecbf2b177..1eb5e612f5 100644
--- a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
+++ b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp
@@ -171,10 +171,8 @@ void QUnifiedToolbarSurface::flush(QWidget *widget)
if (!d->image)
return;
- if (widget->d_func()->flushRequested) {
- // We call display: directly to avoid flickering in the toolbar.
- qt_mac_display(widget);
- }
+ if (widget->d_func()->flushRequested)
+ qt_mac_setNeedsDisplay(widget);
}
void QUnifiedToolbarSurface::prepareBuffer(QImage::Format format, QWidget *widget)
diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp
index c52f864b25..7e8cf9bbb1 100644
--- a/src/gui/painting/qwindowsurface_qws.cpp
+++ b/src/gui/painting/qwindowsurface_qws.cpp
@@ -806,6 +806,10 @@ QWSMemorySurface::QWSMemorySurface(QWidget *w)
QWSMemorySurface::~QWSMemorySurface()
{
+#ifndef QT_NO_QWS_MULTIPROCESS
+ if (memlock != QWSDisplay::Data::getClientLock())
+ delete memlock;
+#endif
}
@@ -852,9 +856,9 @@ void QWSMemorySurface::setLock(int lockId)
{
if (memlock && memlock->id() == lockId)
return;
- delete memlock;
+ if (memlock != QWSDisplay::Data::getClientLock())
+ delete memlock;
memlock = (lockId == -1 ? 0 : new QWSLock(lockId));
- return;
}
#endif // QT_NO_QWS_MULTIPROCESS
@@ -946,37 +950,39 @@ void QWSLocalMemSurface::setGeometry(const QRect &rect)
}
uchar *deleteLater = 0;
- // In case of a Hide event we need to delete the memory after sending the
- // event to the server in order to let the server animate the event.
- if (size.isEmpty()) {
- deleteLater = mem;
- mem = 0;
- }
if (img.size() != size) {
- delete[] mem;
if (size.isEmpty()) {
+ if (memsize) {
+ // In case of a Hide event we need to delete the memory after sending the
+ // event to the server in order to let the server animate the event.
+ deleteLater = mem;
+ memsize = 0;
+ }
mem = 0;
img = QImage();
} else {
const QImage::Format format = preferredImageFormat(win);
const int bpl = nextMulOf4(bytesPerPixel(format) * size.width());
- const int memsize = bpl * size.height();
- mem = new uchar[memsize];
+ const int imagesize = bpl * size.height();
+ if (memsize < imagesize) {
+ delete[] mem;
+ memsize = imagesize;
+ mem = new uchar[memsize];
+ }
img = QImage(mem, size.width(), size.height(), bpl, format);
setImageMetrics(img, win);
}
}
QWSWindowSurface::setGeometry(rect);
+
delete[] deleteLater;
}
QByteArray QWSLocalMemSurface::permanentState() const
{
- QByteArray array;
- array.resize(sizeof(uchar*) + 3 * sizeof(int) +
- sizeof(SurfaceFlags));
+ QByteArray array(sizeof(uchar*) + 3 * sizeof(int) + sizeof(SurfaceFlags), Qt::Uninitialized);
char *ptr = array.data();
@@ -997,6 +1003,11 @@ QByteArray QWSLocalMemSurface::permanentState() const
void QWSLocalMemSurface::setPermanentState(const QByteArray &data)
{
+ if (memsize) {
+ delete[] mem;
+ memsize = 0;
+ }
+
int width;
int height;
QImage::Format format;
@@ -1023,6 +1034,10 @@ void QWSLocalMemSurface::setPermanentState(const QByteArray &data)
void QWSLocalMemSurface::releaseSurface()
{
+ if (memsize) {
+ delete[] mem;
+ memsize = 0;
+ }
mem = 0;
img = QImage();
}
@@ -1064,17 +1079,15 @@ bool QWSSharedMemSurface::setMemory(int memId)
void QWSSharedMemSurface::setDirectRegion(const QRegion &r, int id)
{
QWSMemorySurface::setDirectRegion(r, id);
- if(mem.address())
+ if (mem.address())
*(uint *)mem.address() = id;
}
const QRegion QWSSharedMemSurface::directRegion() const
{
- QWSSharedMemory *cmem = const_cast<QWSSharedMemory *>(&mem);
- if (cmem->address() && ((int*)cmem->address())[0] == directRegionId())
+ if (mem.address() && *(uint *)mem.address() == uint(directRegionId())
return QWSMemorySurface::directRegion();
- else
- return QRegion();
+ return QRegion();
}
#endif
@@ -1117,8 +1130,6 @@ void QWSSharedMemSurface::setGeometry(const QRect &rect)
mem.detach();
img = QImage();
} else {
- mem.detach();
-
QWidget *win = window();
const QImage::Format format = preferredImageFormat(win);
const int bpl = nextMulOf4(bytesPerPixel(format) * size.width());
@@ -1127,9 +1138,12 @@ void QWSSharedMemSurface::setGeometry(const QRect &rect)
#else
const int imagesize = bpl * size.height();
#endif
- if (!mem.create(imagesize)) {
- perror("QWSSharedMemSurface::setGeometry allocating shared memory");
- qFatal("Error creating shared memory of size %d", imagesize);
+ if (mem.size() < imagesize) {
+ mem.detach();
+ if (!mem.create(imagesize)) {
+ perror("QWSSharedMemSurface::setGeometry allocating shared memory");
+ qFatal("Error creating shared memory of size %d", imagesize);
+ }
}
#ifdef QT_QWS_CLIENTBLIT
*((uint *)mem.address()) = 0;
@@ -1147,8 +1161,7 @@ void QWSSharedMemSurface::setGeometry(const QRect &rect)
QByteArray QWSSharedMemSurface::permanentState() const
{
- QByteArray array;
- array.resize(6 * sizeof(int));
+ QByteArray array(6 * sizeof(int), Qt::Uninitialized);
int *ptr = reinterpret_cast<int*>(array.data());
@@ -1222,8 +1235,8 @@ bool QWSOnScreenSurface::isValid() const
QByteArray QWSOnScreenSurface::permanentState() const
{
- QByteArray array;
- array.resize(sizeof(int));
+ QByteArray array(sizeof(int), Qt::Uninitialized);
+
int *ptr = reinterpret_cast<int*>(array.data());
ptr[0] = QApplication::desktop()->screenNumber(window());
return array;
@@ -1263,8 +1276,7 @@ QWSYellowSurface::~QWSYellowSurface()
QByteArray QWSYellowSurface::permanentState() const
{
- QByteArray array;
- array.resize(2 * sizeof(int));
+ QByteArray array(2 * sizeof(int), Qt::Uninitialized);
int *ptr = reinterpret_cast<int*>(array.data());
ptr[0] = surfaceSize.width();
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 634cf00536..219b963d3f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -91,11 +91,8 @@ static const qreal goldenRatio = 1.618;
const layoutHeader QS60StylePrivate::m_layoutHeaders[] = {
// *** generated layout data ***
-{240,320,1,19,"QVGA Landscape"},
-{320,240,1,19,"QVGA Portrait"},
{360,640,1,19,"NHD Landscape"},
{640,360,1,19,"NHD Portrait"},
-{352,800,1,12,"E90 Landscape"},
{480,640,1,19,"VGA Landscape"}
// *** End of generated data ***
};
@@ -104,11 +101,8 @@ const int QS60StylePrivate::m_numberOfLayouts =
const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** generated pixel metrics ***
-{5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106},
-{5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106},
{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
-{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106},
{9,0,-909,0,0,2,0,5,-1,34,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,19,19,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184}
// *** End of generated data ***
};
@@ -532,29 +526,14 @@ void QS60StylePrivate::setCurrentLayout(int index)
void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart,
QPainter *painter, const QRect &rect, SkinElementFlags flags)
{
- static const bool doCache =
-#if defined(Q_WS_S60)
- // Freezes on 3.1. Anyways, caching is only really needed on touch UI
- !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
-#else
- true;
-#endif
-
- const QPixmap skinPartPixMap((doCache ? cachedPart : part)(skinPart, rect.size(), painter, flags));
+ const QPixmap skinPartPixMap((cachedPart)(skinPart, rect.size(), painter, flags));
if (!skinPartPixMap.isNull())
painter->drawPixmap(rect.topLeft(), skinPartPixMap);
}
void QS60StylePrivate::drawFrame(SkinFrameElements frameElement, QPainter *painter, const QRect &rect, SkinElementFlags flags)
{
- static const bool doCache =
-#if defined(Q_WS_S60)
- // Freezes on 3.1. Anyways, caching is only really needed on touch UI
- !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
-#else
- true;
-#endif
- const QPixmap frameElementPixMap((doCache ? cachedFrame : frame)(frameElement, rect.size(), flags));
+ const QPixmap frameElementPixMap((cachedFrame)(frameElement, rect.size(), flags));
if (!frameElementPixMap.isNull())
painter->drawPixmap(rect.topLeft(), frameElementPixMap);
}
@@ -1040,23 +1019,10 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
drawPrimitive(PE_FrameFocusRect, optionSlider, painter, widget);*/
//Groove graphics
- if (QS60StylePrivate::hasSliderGrooveGraphic()) {
- const QS60StylePrivate::SkinElements grooveElement = horizontal ?
- QS60StylePrivate::SE_SliderGrooveHorizontal :
- QS60StylePrivate::SE_SliderGrooveVertical;
- QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags);
- } else {
- const QPoint sliderGrooveCenter = sliderGroove.center();
- const bool horizontal = optionSlider->orientation == Qt::Horizontal;
- painter->save();
- if (widget)
- painter->setPen(widget->palette().windowText().color());
- if (horizontal)
- painter->drawLine(0, sliderGrooveCenter.y(), sliderGroove.right(), sliderGrooveCenter.y());
- else
- painter->drawLine(sliderGrooveCenter.x(), 0, sliderGrooveCenter.x(), sliderGroove.bottom());
- painter->restore();
- }
+ const QS60StylePrivate::SkinElements grooveElement = horizontal ?
+ QS60StylePrivate::SE_SliderGrooveHorizontal :
+ QS60StylePrivate::SE_SliderGrooveVertical;
+ QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags);
//Handle graphics
const QRect sliderHandle = subControlRect(control, optionSlider, SC_SliderHandle, widget);
@@ -1155,11 +1121,10 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
case Qt::UpArrow:
pe = PE_IndicatorArrowUp;
break;
- case Qt::DownArrow:
+ default:
pe = PE_IndicatorArrowDown;
break;
- default:
- break; }
+ }
toolButton.rect = button;
drawPrimitive(pe, &toolButton, painter, widget);
}
@@ -1333,8 +1298,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
const bool isDisabled = !(option->state & State_Enabled);
const bool isFlat = button->features & QStyleOptionButton::Flat;
- QS60StyleEnums::SkinParts skinPart;
- QS60StylePrivate::SkinElements skinElement;
+ QS60StyleEnums::SkinParts skinPart = QS60StyleEnums::SP_QsnFrButtonCenterInactive;
+ QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_ButtonInactive;
if (!isDisabled) {
const bool isPressed = (option->state & State_Sunken) ||
(option->state & State_On);
@@ -1345,11 +1310,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
skinElement =
isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
}
- } else {
- if (isFlat)
- skinPart =QS60StyleEnums::SP_QsnFrButtonCenterInactive;
- else
- skinElement = QS60StylePrivate::SE_ButtonInactive;
}
if (isFlat)
QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
@@ -1485,26 +1445,14 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
checkMarkOption.rect = selectionRect;
// Draw selection mark.
if (isSelected && selectItems) {
- proxy()->drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
// @todo: this should happen in the rect retrievel i.e. subElementRect()
if (textRect.right() > selectionRect.left())
textRect.setRight(selectionRect.left());
} else if (voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) {
checkMarkOption.state = checkMarkOption.state & ~State_HasFocus;
- switch (vopt->checkState) {
- case Qt::Unchecked:
- checkMarkOption.state |= State_Off;
- break;
- case Qt::PartiallyChecked:
- checkMarkOption.state |= State_NoChange;
- break;
- case Qt::Checked:
- checkMarkOption.state |= State_On;
- break;
- }
- drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
}
+ proxy()->drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
}
// draw the text
@@ -1837,7 +1785,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
//draw icon and/or checkState
- QPixmap pix = menuItem->icon.pixmap(pixelMetric(PM_SmallIconSize),
+ QPixmap pix = menuItem->icon.pixmap(iconRect.width(),
enabled ? QIcon::Normal : QIcon::Disabled);
const bool itemWithIcon = !pix.isNull();
if (itemWithIcon) {
@@ -1985,36 +1933,31 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (!tbWidget || (widget && qobject_cast<QToolBar *>(widget->parentWidget())))
break;
- // Normally in S60 5.0+ there is no background for toolbar, but in some cases with versatile QToolBar,
+ // Normally in S60 there is no background for toolbar, but in some cases with versatile QToolBar,
// it looks a bit strange. So, lets fillRect with Button.
- if (!QS60StylePrivate::isToolBarBackground()) {
- QList<QAction *> actions = tbWidget->actions();
- bool justToolButtonsInToolBar = true;
- for (int i = 0; i < actions.size(); ++i) {
- QWidget *childWidget = tbWidget->widgetForAction(actions.at(i));
- const QToolButton *button = qobject_cast<const QToolButton *>(childWidget);
- if (!button){
- justToolButtonsInToolBar = false;
- }
- }
-
- // Draw frame background
- // for vertical toolbars with text only and
- // for toolbars with extension buttons and
- // for toolbars with widgets in them.
- if (!justToolButtonsInToolBar ||
- (tbWidget &&
- (tbWidget->orientation() == Qt::Vertical) &&
- (tbWidget->toolButtonStyle() == Qt::ToolButtonTextOnly))) {
- painter->save();
- if (widget)
- painter->setBrush(widget->palette().button());
- painter->setOpacity(0.3);
- painter->fillRect(toolBar->rect, painter->brush());
- painter->restore();
- }
- } else {
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBar, painter, toolBar->rect, flags);
+ QList<QAction *> actions = tbWidget->actions();
+ bool justToolButtonsInToolBar = true;
+ for (int i = 0; i < actions.size(); ++i) {
+ QWidget *childWidget = tbWidget->widgetForAction(actions.at(i));
+ const QToolButton *button = qobject_cast<const QToolButton *>(childWidget);
+ if (!button)
+ justToolButtonsInToolBar = false;
+ }
+
+ // Draw frame background
+ // for vertical toolbars with text only and
+ // for toolbars with extension buttons and
+ // for toolbars with widgets in them.
+ if (!justToolButtonsInToolBar
+ || (tbWidget
+ && tbWidget->orientation() == Qt::Vertical
+ && tbWidget->toolButtonStyle() == Qt::ToolButtonTextOnly)) {
+ painter->save();
+ if (widget)
+ painter->setBrush(widget->palette().button());
+ painter->setOpacity(0.3);
+ painter->fillRect(toolBar->rect, painter->brush());
+ painter->restore();
}
}
break;
@@ -2159,12 +2102,28 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#ifndef QT_NO_ITEMVIEWS
if (const QAbstractItemView *itemView = (qobject_cast<const QAbstractItemView *>(widget))) {
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
+ QStyleOptionViewItemV4 voptAdj = *vopt;
const bool checkBoxVisible = vopt->features & QStyleOptionViewItemV2::HasCheckIndicator;
const bool singleSelection = itemView->selectionMode() ==
QAbstractItemView::SingleSelection || itemView->selectionMode() == QAbstractItemView::NoSelection;
// draw either checkbox at the beginning
if (checkBoxVisible && singleSelection) {
- drawPrimitive(PE_IndicatorCheckBox, option, painter, widget);
+ if (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) {
+ switch (vopt->checkState) {
+ case Qt::Unchecked:
+ voptAdj.state |= State_Off;
+ break;
+ case Qt::PartiallyChecked:
+ voptAdj.state |= State_NoChange;
+ break;
+ case Qt::Checked:
+ voptAdj.state |= State_On;
+ break;
+ default:
+ break;
+ }
+ }
+ drawPrimitive(PE_IndicatorCheckBox, &voptAdj, painter, widget);
// ... or normal "tick" selection at the end.
} else if (option->state & State_Selected) {
QRect tickRect = option->rect;
@@ -2226,21 +2185,16 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
break;
#ifndef QT_NO_TOOLBUTTON
case PE_IndicatorArrowDown:
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafScrollArrowDown, painter, option->rect, flags);
+ break;
case PE_IndicatorArrowLeft:
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafScrollArrowLeft, painter, option->rect, flags);
+ break;
case PE_IndicatorArrowRight:
- case PE_IndicatorArrowUp: {
- QS60StyleEnums::SkinParts skinPart;
- if (element==PE_IndicatorArrowDown)
- skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
- else if (element==PE_IndicatorArrowLeft)
- skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowLeft;
- else if (element==PE_IndicatorArrowRight)
- skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowRight;
- else if (element==PE_IndicatorArrowUp)
- skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowUp;
-
- QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
- }
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafScrollArrowRight, painter, option->rect, flags);
+ break;
+ case PE_IndicatorArrowUp:
+ QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafScrollArrowUp, painter, option->rect, flags);
break;
#endif //QT_NO_TOOLBUTTON
#ifndef QT_NO_SPINBOX
@@ -2427,52 +2381,46 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_IndicatorBranch:
#if defined(Q_WS_S60)
- // 3.1 AVKON UI does not have tree view component, use common style for drawing there
- if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) {
-#else
- if (true) {
-#endif
- QCommonStyle::drawPrimitive(element, option, painter, widget);
- } else {
- if (const QStyleOptionViewItemV2 *vopt = qstyleoption_cast<const QStyleOptionViewItemV2 *>(option)) {
- const bool rightLine = option->state & State_Item;
- const bool downLine = option->state & State_Sibling;
- const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling);
- QS60StylePrivate::SkinElementFlags adjustedFlags = flags;
-
- QS60StyleEnums::SkinParts skinPart;
- bool drawSkinPart = false;
- if (rightLine && downLine && upLine) {
- skinPart = QS60StyleEnums::SP_QgnIndiHlLineBranch;
- drawSkinPart = true;
- } else if (rightLine && upLine) {
- skinPart = QS60StyleEnums::SP_QgnIndiHlLineEnd;
- drawSkinPart = true;
- } else if (upLine && downLine) {
- skinPart = QS60StyleEnums::SP_QgnIndiHlLineStraight;
- drawSkinPart = true;
- }
+ if (const QStyleOptionViewItemV2 *vopt = qstyleoption_cast<const QStyleOptionViewItemV2 *>(option)) {
+ const bool rightLine = option->state & State_Item;
+ const bool downLine = option->state & State_Sibling;
+ const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling);
+ QS60StylePrivate::SkinElementFlags adjustedFlags = flags;
- if (option->direction == Qt::RightToLeft)
- adjustedFlags |= QS60StylePrivate::SF_Mirrored_X_Axis;
-
- if (drawSkinPart)
- QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, adjustedFlags);
-
- if (option->state & State_Children) {
- QS60StyleEnums::SkinParts skinPart =
- (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
- const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, vopt, widget);
- const int minDimension = qMin(option->rect.width(), option->rect.height());
- const int magicTweak = (option->direction == Qt::RightToLeft) ? -3 : 3; //@todo: magic
- //The branch indicator icon in S60 is supposed to be superimposed on top of branch lines.
- QRect iconRect(QPoint(option->rect.left() + magicTweak, selectionRect.top() + 1), QSize(minDimension, minDimension));
- if (!QS60StylePrivate::isTouchSupported())
- iconRect.translate(0, -4); //@todo: magic
- QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, adjustedFlags);
- }
+ QS60StyleEnums::SkinParts skinPart;
+ bool drawSkinPart = false;
+ if (rightLine && downLine && upLine) {
+ skinPart = QS60StyleEnums::SP_QgnIndiHlLineBranch;
+ drawSkinPart = true;
+ } else if (rightLine && upLine) {
+ skinPart = QS60StyleEnums::SP_QgnIndiHlLineEnd;
+ drawSkinPart = true;
+ } else if (upLine && downLine) {
+ skinPart = QS60StyleEnums::SP_QgnIndiHlLineStraight;
+ drawSkinPart = true;
+ }
+
+ if (option->direction == Qt::RightToLeft)
+ adjustedFlags |= QS60StylePrivate::SF_Mirrored_X_Axis;
+
+ if (drawSkinPart)
+ QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, adjustedFlags);
+
+ if (option->state & State_Children) {
+ QS60StyleEnums::SkinParts skinPart =
+ (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
+ const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, vopt, widget);
+ const int minDimension = qMin(option->rect.width(), option->rect.height());
+ const int magicTweak = (option->direction == Qt::RightToLeft) ? -3 : 3;
+ //The branch indicator icon in S60 is supposed to be superimposed on top of branch lines.
+ QRect iconRect(QPoint(option->rect.left() + magicTweak, selectionRect.top() + 1), QSize(minDimension, minDimension));
+ iconRect.translate(0, -4);
+ QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, adjustedFlags);
}
}
+#else
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+#endif
break;
case PE_PanelItemViewRow: // ### Qt 5: remove
#ifndef QT_NO_ITEMVIEWS
@@ -2494,10 +2442,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelScrollAreaCorner:
break;
case PE_IndicatorItemViewItemDrop:
- if (QS60StylePrivate::isTouchSupported())
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags);
- else
- commonStyleDraws = true;
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags);
break;
// todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases
case PE_FrameLineEdit:
@@ -2673,13 +2618,11 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
}
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
- if (QS60StylePrivate::isTouchSupported()) {
- //Make itemview easier to use in touch devices
- sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
- //QCommonStyle does not adjust height with horizontal margin, it only adjusts width
- if (ct == CT_MenuItem)
- sz.setHeight(sz.height() - 8); //QCommonstyle adds 8 to height that this style handles through PM values
- }
+ //Make itemview easier to use in touch devices
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
+ //QCommonStyle does not adjust height with horizontal margin, it only adjusts width
+ if (ct == CT_MenuItem)
+ sz.setHeight(sz.height() - 8); //QCommonstyle adds 8 to height that this style handles through PM values
break;
#ifndef QT_NO_COMBOBOX
case CT_ComboBox: {
@@ -3313,8 +3256,7 @@ void QS60Style::polish(QApplication *application)
QCommonStyle::polish(qApp);
d->m_originalPalette = application->palette();
d->setThemePalette(application);
- if (QS60StylePrivate::isTouchSupported())
- qApp->installEventFilter(this);
+ qApp->installEventFilter(this);
}
/*!
@@ -3329,8 +3271,7 @@ void QS60Style::unpolish(QApplication *application)
const QPalette newPalette = QApplication::style()->standardPalette();
QApplication::setPalette(newPalette);
QApplicationPrivate::setSystemPalette(d->m_originalPalette);
- if (QS60StylePrivate::isTouchSupported())
- qApp->removeEventFilter(this);
+ qApp->removeEventFilter(this);
}
/*!
@@ -3341,11 +3282,10 @@ bool QS60Style::event(QEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
Q_D(QS60Style);
const QEvent::Type eventType = e->type();
- if ((eventType == QEvent::FocusIn ||
- eventType == QEvent::FocusOut ||
- eventType == QEvent::EnterEditFocus ||
- eventType == QEvent::LeaveEditFocus) &&
- QS60StylePrivate::isTouchSupported())
+ if (eventType == QEvent::FocusIn
+ || eventType == QEvent::FocusOut
+ || eventType == QEvent::EnterEditFocus
+ || eventType == QEvent::LeaveEditFocus)
return false;
#endif
diff --git a/src/gui/styles/qs60style_feedbackinterface_p.h b/src/gui/styles/qs60style_feedbackinterface_p.h
new file mode 100644
index 0000000000..81fcdc357c
--- /dev/null
+++ b/src/gui/styles/qs60style_feedbackinterface_p.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 <QObject>
+
+class TactileFeedbackInterface : public QObject
+{
+ public:
+ virtual void touchFeedback(QEvent *event, const QWidget *widget) = 0;
+};
+
+Q_DECLARE_INTERFACE(TactileFeedbackInterface, "com.trolltech.Qt.TactileFeedbackInterface/1.0")
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index ee981c036b..1cf069bd52 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -516,9 +516,6 @@ public:
void setBackgroundTexture(QApplication *application) const;
static void deleteBackground();
- static bool isTouchSupported();
- static bool isToolBarBackground();
- static bool hasSliderGrooveGraphic();
static bool isSingleClickUi();
static bool isWidgetPressed(const QWidget *widget);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index f272ff4a90..58d70a4897 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -579,7 +579,6 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsLX(
const TAknsItemID skinId = m_partMap[stylepartIndex].skinID;
TInt fallbackGraphicID = -1;
- HBufC* iconFile = HBufC::NewLC( KMaxFileName );
fallbackInfo(stylepart, fallbackGraphicID);
TAknsItemID colorGroup = KAknsIIDQsnIconColors;
@@ -613,7 +612,7 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsLX(
defaultColor);
QPixmap result = fromFbsBitmap(icon, iconMask, flags, targetSize);
- CleanupStack::PopAndDestroy(3); //icon, iconMask, iconFile
+ CleanupStack::PopAndDestroy(2); //icon, iconMask
return result;
}
@@ -693,21 +692,6 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask
return pixmap;
}
-bool QS60StylePrivate::isTouchSupported()
-{
- return bool(AknLayoutUtils::PenEnabled());
-}
-
-bool QS60StylePrivate::isToolBarBackground()
-{
- return (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2);
-}
-
-bool QS60StylePrivate::hasSliderGrooveGraphic()
-{
- return QSysInfo::s60Version() != QSysInfo::SV_S60_3_1;
-}
-
bool QS60StylePrivate::isSingleClickUi()
{
return (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0);
@@ -1068,20 +1052,8 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
switch(frameElement) {
case QS60StylePrivate::SF_ToolTip:
- if (QSysInfo::s60Version() != QSysInfo::SV_S60_3_1) {
- centerId.Set(EAknsMajorGeneric, 0x19c2);
- frameId.Set(EAknsMajorSkin, 0x5300);
- } else {
- centerId.Set(KAknsIIDQsnFrPopupCenter);
- frameId.iMinor = centerId.iMinor - 9;
- }
- break;
- case QS60StylePrivate::SF_ToolBar:
- if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 ||
- QSysInfo::s60Version() == QSysInfo::SV_S60_3_2) {
- centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
- frameId.Set(KAknsIIDQsnFrPopupSub);
- }
+ centerId.Set(EAknsMajorGeneric, 0x19c2);
+ frameId.Set(EAknsMajorSkin, 0x5300);
break;
case QS60StylePrivate::SF_PopupBackground:
centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
@@ -1223,10 +1195,7 @@ void QS60StylePrivate::setActiveLayout()
//not found, lets try with either of dimensions
if (activeLayoutIndex==-1){
- const QSysInfo::S60Version currentRelease = QSysInfo::s60Version();
const bool landscape = screenHeight < screenWidth;
-
- activeLayoutIndex = (currentRelease == QSysInfo::SV_S60_3_1 || currentRelease == QSysInfo::SV_S60_3_2) ? 0 : 2;
activeLayoutIndex += (!landscape) ? 1 : 0;
}
@@ -1282,9 +1251,7 @@ bool QS60StyleModeSpecifics::disabledPartGraphic(QS60StyleEnums::SkinParts &part
case QS60StyleEnums::SP_QsnFrButtonSideLInactive:
case QS60StyleEnums::SP_QsnFrButtonSideRInactive:
case QS60StyleEnums::SP_QsnFrButtonCenterInactive:
- if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 ||
- QSysInfo::s60Version()==QSysInfo::SV_S60_3_2))
- disabledGraphic = true;
+ disabledGraphic = true;
break;
default:
break;
@@ -1300,9 +1267,7 @@ bool QS60StyleModeSpecifics::disabledFrameGraphic(QS60StylePrivate::SkinFrameEle
switch(frame){
// inactive button graphics are available from 5.0 onwards
case QS60StylePrivate::SF_ButtonInactive:
- if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 ||
- QSysInfo::s60Version()==QSysInfo::SV_S60_3_2))
- disabledGraphic = true;
+ disabledGraphic = true;
break;
default:
break;
@@ -1313,9 +1278,6 @@ bool QS60StyleModeSpecifics::disabledFrameGraphic(QS60StylePrivate::SkinFrameEle
QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part,
const QSize &size, QS60StylePrivate::SkinElementFlags flags)
{
- if (!QS60StylePrivate::isTouchSupported())
- return QPixmap();
-
QS60StyleEnums::SkinParts updatedPart = part;
switch(part){
// AVKON UI has a abnormal handling for scrollbar graphics. It is possible that the root
@@ -1541,7 +1503,7 @@ QVariant QS60StyleModeSpecifics::themeDefinition(
//Animation definitions
case QS60StyleEnums::TD_AnimationData:
{
- CAknsBmpAnimItemData *animationData;
+ CAknsBmpAnimItemData *animationData = 0;
TAknsItemID animationSkinId = partSpecificThemeId(part);
QList<QVariant> list;
@@ -1557,9 +1519,6 @@ QVariant QS60StyleModeSpecifics::themeDefinition(
QS60StyleEnums::AnimationMode playMode;
switch(animationData->PlayMode()) {
- case CBitmapAnimClientData::EPlay:
- playMode = QS60StyleEnums::AM_PlayOnce;
- break;
case CBitmapAnimClientData::ECycle:
playMode = QS60StyleEnums::AM_Looping;
break;
@@ -1567,6 +1526,7 @@ QVariant QS60StyleModeSpecifics::themeDefinition(
playMode = QS60StyleEnums::AM_Bounce;
break;
default:
+ playMode = QS60StyleEnums::AM_PlayOnce;
break;
}
list.append(QVariant((int)playMode));
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index ca02cdf5e1..d0789a8af5 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -318,25 +318,6 @@ QPixmap QS60StylePrivate::backgroundTexture(bool /*skipCreation*/)
return *m_background;
}
-bool QS60StylePrivate::isTouchSupported()
-{
-#ifdef QT_KEYPAD_NAVIGATION
- return !QApplication::keypadNavigationEnabled();
-#else
- return true;
-#endif
-}
-
-bool QS60StylePrivate::isToolBarBackground()
-{
- return true;
-}
-
-bool QS60StylePrivate::hasSliderGrooveGraphic()
-{
- return false;
-}
-
bool QS60StylePrivate::isSingleClickUi()
{
return false;
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 90dd0293fc..d4c81b90db 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -348,6 +348,9 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other)
if (! (mask & QFont::FamilyResolved))
request.family = other->request.family;
+ if (! (mask & QFont::StyleNameResolved))
+ request.styleName = other->request.styleName;
+
if (! (mask & QFont::SizeResolved)) {
request.pointSize = other->request.pointSize;
request.pixelSize = other->request.pixelSize;
@@ -897,6 +900,38 @@ void QFont::setFamily(const QString &family)
}
/*!
+ \since 4.8
+
+ Returns the requested font style name, it will be used to match the
+ font with irregular styles (that can't be normalized in other style
+ properties). It depends on system font support, thus only works for
+ Mac OS X and X11 so far. On Windows irregular styles will be added
+ as separate font families so there is no need for this.
+
+ \sa setFamily() setStyle()
+*/
+QString QFont::styleName() const
+{
+ return d->request.styleName;
+}
+
+/*!
+ \since 4.8
+
+ Sets the style name of the font. When set, other style properties
+ like \a style() and \a weight() will be ignored for font matching.
+
+ \sa styleName()
+*/
+void QFont::setStyleName(const QString &styleName)
+{
+ detach();
+
+ d->request.styleName = styleName;
+ resolve_mask |= QFont::StyleNameResolved;
+}
+
+/*!
Returns the point size of the font. Returns -1 if the font size
was specified in pixels.
@@ -2509,6 +2544,21 @@ QString QFontInfo::family() const
}
/*!
+ \since 4.8
+
+ Returns the style name of the matched window system font on
+ system that supports it.
+
+ \sa QFont::styleName()
+*/
+QString QFontInfo::styleName() const
+{
+ QFontEngine *engine = d->engineForScript(QUnicodeTables::Common);
+ Q_ASSERT(engine != 0);
+ return engine->fontDef.styleName;
+}
+
+/*!
Returns the point size of the matched window system font.
\sa pointSizeF() QFont::pointSize()
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 7636ecf910..14f290ceb3 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -156,7 +156,8 @@ public:
LetterSpacingResolved = 0x2000,
WordSpacingResolved = 0x4000,
HintingPreferenceResolved = 0x8000,
- AllPropertiesResolved = 0xffff
+ StyleNameResolved = 0x10000,
+ AllPropertiesResolved = 0x1ffff
};
QFont();
@@ -168,6 +169,9 @@ public:
QString family() const;
void setFamily(const QString &);
+ QString styleName() const;
+ void setStyleName(const QString &);
+
int pointSize() const;
void setPointSize(int);
qreal pointSizeF() const;
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index d36518ee4b..8eeae6ffc1 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -80,6 +80,7 @@ struct QFontDef
}
QString family;
+ QString styleName;
#ifdef Q_WS_X11
QString addStyle;
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 7a8a9122f2..98186dfd9b 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -879,10 +879,10 @@ QStringList QFontDatabasePrivate::addTTFile(const QByteArray &file, const QByteA
TT_OS2 *os2 = (TT_OS2 *)FT_Get_Sfnt_Table(face, ft_sfnt_os2);
if (os2) {
quint32 unicodeRange[4] = {
- os2->ulUnicodeRange1, os2->ulUnicodeRange2, os2->ulUnicodeRange3, os2->ulUnicodeRange4
+ static_cast<quint32>(os2->ulUnicodeRange1), static_cast<quint32>(os2->ulUnicodeRange2), static_cast<quint32>(os2->ulUnicodeRange3), static_cast<quint32>(os2->ulUnicodeRange4)
};
quint32 codePageRange[2] = {
- os2->ulCodePageRange1, os2->ulCodePageRange2
+ static_cast<quint32>(os2->ulCodePageRange1), static_cast<quint32>(os2->ulCodePageRange2)
};
writingSystems = qt_determine_writing_systems_from_truetype_bits(unicodeRange, codePageRange);
diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp
index 6fdaf06c8b..724dbf6c4a 100644
--- a/src/gui/text/qfontdatabase_mac.cpp
+++ b/src/gui/text/qfontdatabase_mac.cpp
@@ -249,6 +249,63 @@ static inline float weightToFloat(unsigned int weight)
return (weight - 50) / 100.0;
}
+static QFontEngine *loadFromDatabase(const QFontDef &req, const QFontPrivate *d)
+{
+#if defined(QT_MAC_USE_COCOA)
+ QCFString fontName = NULL;
+#else
+ ATSFontFamilyRef familyRef = 0;
+ ATSFontRef fontRef = 0;
+#endif
+
+ QStringList family_list = familyList(req);
+
+ const char *stylehint = styleHint(req);
+ if (stylehint)
+ family_list << QLatin1String(stylehint);
+
+ // add QFont::defaultFamily() to the list, for compatibility with previous versions
+ family_list << QApplication::font().defaultFamily();
+
+ QMutexLocker locker(fontDatabaseMutex());
+ QFontDatabasePrivate *db = privateDb();
+ if (!db->count)
+ initializeDb();
+ for (int i = 0; i < family_list.size(); ++i) {
+ for (int k = 0; k < db->count; ++k) {
+ if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) {
+ QByteArray family_name = db->families[k]->name.toUtf8();
+#if defined(QT_MAC_USE_COCOA)
+ QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL);
+ if (ctFont) {
+ fontName = CTFontCopyFullName(ctFont);
+ goto found;
+ }
+#else
+ familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault);
+ if (familyRef) {
+ fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault);
+ goto found;
+ }
+#endif
+ }
+ }
+ }
+found:
+#ifdef QT_MAC_USE_COCOA
+ if (fontName)
+ return new QCoreTextFontEngineMulti(fontName, req, d->kerning);
+#else
+ if (familyRef) {
+ QCFString actualName;
+ if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr)
+ req.family = actualName;
+ return new QFontEngineMacMulti(familyRef, req, fontDef, d->kerning);
+ }
+#endif
+ return NULL;
+}
+
void QFontDatabase::load(const QFontPrivate *d, int script)
{
// sanity checks
@@ -289,69 +346,38 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
return; // the font info and fontdef should already be filled
}
- //find the font
- QStringList family_list = familyList(req);
-
- const char *stylehint = styleHint(req);
- if (stylehint)
- family_list << QLatin1String(stylehint);
-
- // add QFont::defaultFamily() to the list, for compatibility with
- // previous versions
- family_list << QApplication::font().defaultFamily();
-
+ QFontEngine *engine = NULL;
#if defined(QT_MAC_USE_COCOA)
- QCFString fontName = NULL, familyName = NULL;
-#else
- ATSFontFamilyRef familyRef = 0;
- ATSFontRef fontRef = 0;
-#endif
-
- QMutexLocker locker(fontDatabaseMutex());
- QFontDatabasePrivate *db = privateDb();
- if (!db->count)
- initializeDb();
- for(int i = 0; i < family_list.size(); ++i) {
- for (int k = 0; k < db->count; ++k) {
- if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) {
- QByteArray family_name = db->families[k]->name.toUtf8();
-#if defined(QT_MAC_USE_COCOA)
- QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL);
- if (ctFont) {
- fontName = CTFontCopyFullName(ctFont);
- familyName = CTFontCopyFamilyName(ctFont);
- goto FamilyFound;
- }
-#else
- familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault);
- if (familyRef) {
- fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault);
- goto FamilyFound;
- }
-#endif
+ // Shortcut to get the font directly without going through the font database
+ if (!req.family.isEmpty() && !req.styleName.isEmpty()) {
+ QCFString expectedFamily = QCFString(req.family);
+ QCFString expectedStyle = QCFString(req.styleName);
+
+ QCFType<CFMutableDictionaryRef> attributes = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, expectedFamily);
+ CFDictionaryAddValue(attributes, kCTFontStyleNameAttribute, expectedStyle);
+
+ QCFType<CTFontDescriptorRef> descriptor = CTFontDescriptorCreateWithAttributes(attributes);
+ CGAffineTransform transform = qt_transform_from_fontdef(req);
+ QCFType<CTFontRef> ctFont = CTFontCreateWithFontDescriptor(descriptor, req.pixelSize, &transform);
+ if (ctFont) {
+ QCFString familyName = CTFontCopyFamilyName(ctFont);
+ // Only accept the font if the family name is exactly the same as we specified
+ if (CFEqual(expectedFamily, familyName)) {
+ engine = new QCoreTextFontEngineMulti(ctFont, req, d->kerning);
}
}
}
-FamilyFound:
- //fill in the engine's font definition
- QFontDef fontDef = d->request; //copy..
- if(fontDef.pointSize < 0)
- fontDef.pointSize = qt_mac_pointsize(fontDef, d->dpi);
- else
- fontDef.pixelSize = qt_mac_pixelsize(fontDef, d->dpi);
-
-#ifdef QT_MAC_USE_COCOA
- fontDef.family = familyName;
- QFontEngine *engine = new QCoreTextFontEngineMulti(fontName, fontDef, d->kerning);
-#else
- QCFString actualName;
- if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr)
- fontDef.family = actualName;
- QFontEngine *engine = new QFontEngineMacMulti(familyRef, fontRef, fontDef, d->kerning);
#endif
- d->engineData->engine = engine;
- engine->ref.ref(); //a ref for the engineData->engine
- QFontCache::instance()->insertEngine(key, engine);
+ if (!engine)
+ engine = loadFromDatabase(req, d);
+
+ if (engine) {
+ d->engineData->engine = engine;
+ engine->ref.ref();
+ QFontCache::instance()->insertEngine(key, engine);
+ }
}
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index c5a04f1700..c83e9297d9 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -759,9 +759,6 @@ bool QFontDatabase::supportsThreadedFontRendering()
return true;
}
-/*!
- \internal
-*/
QFontEngine *
QFontDatabase::findFont(int script, const QFontPrivate *fp,
const QFontDef &request)
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 8a13d91fbb..754334c0c4 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -1452,6 +1452,35 @@ static const char *styleHint(const QFontDef &request)
void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontDef &request)
{
+ double size_value = qMax(qreal(1.), request.pixelSize);
+ FcPatternDel(pattern, FC_PIXEL_SIZE);
+ FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value);
+
+ if (X11->display && QX11Info::appDepth(screen) <= 8) {
+ FcPatternDel(pattern, FC_ANTIALIAS);
+ // can't do antialiasing on 8bpp
+ FcPatternAddBool(pattern, FC_ANTIALIAS, false);
+ } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) {
+ FcPatternDel(pattern, FC_ANTIALIAS);
+ FcPatternAddBool(pattern, FC_ANTIALIAS,
+ !(request.styleStrategy & QFont::NoAntialias));
+ }
+
+ if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') {
+ Q_ASSERT(script < QUnicodeTables::ScriptCount);
+ FcLangSet *ls = FcLangSetCreate();
+ FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]);
+ FcPatternDel(pattern, FC_LANG);
+ FcPatternAddLangSet(pattern, FC_LANG, ls);
+ FcLangSetDestroy(ls);
+ }
+
+ if (!request.styleName.isEmpty()) {
+ QByteArray cs = request.styleName.toUtf8();
+ FcPatternAddString(pattern, FC_STYLE, (const FcChar8 *) cs.constData());
+ return;
+ }
+
int weight_value = FC_WEIGHT_BLACK;
if (request.weight == 0)
weight_value = FC_WEIGHT_MEDIUM;
@@ -1474,34 +1503,11 @@ void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontD
FcPatternDel(pattern, FC_SLANT);
FcPatternAddInteger(pattern, FC_SLANT, slant_value);
- double size_value = qMax(qreal(1.), request.pixelSize);
- FcPatternDel(pattern, FC_PIXEL_SIZE);
- FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value);
-
int stretch = request.stretch;
if (!stretch)
stretch = 100;
FcPatternDel(pattern, FC_WIDTH);
FcPatternAddInteger(pattern, FC_WIDTH, stretch);
-
- if (X11->display && QX11Info::appDepth(screen) <= 8) {
- FcPatternDel(pattern, FC_ANTIALIAS);
- // can't do antialiasing on 8bpp
- FcPatternAddBool(pattern, FC_ANTIALIAS, false);
- } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) {
- FcPatternDel(pattern, FC_ANTIALIAS);
- FcPatternAddBool(pattern, FC_ANTIALIAS,
- !(request.styleStrategy & QFont::NoAntialias));
- }
-
- if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') {
- Q_ASSERT(script < QUnicodeTables::ScriptCount);
- FcLangSet *ls = FcLangSetCreate();
- FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]);
- FcPatternDel(pattern, FC_LANG);
- FcPatternAddLangSet(pattern, FC_LANG, ls);
- FcLangSetDestroy(ls);
- }
}
static bool preferScalable(const QFontDef &request)
@@ -1996,6 +2002,11 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
QFontCache::instance()->insertEngine(key, fe);
}
+// Needed for fontconfig version < 2.2.97
+#ifndef FC_FAMILYLANG
+#define FC_FAMILYLANG "familylang"
+#endif
+
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
{
#if defined(QT_NO_FONTCONFIG)
@@ -2044,7 +2055,8 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
return;
FcPatternDel(pattern, FC_FILE);
- FcPatternAddString(pattern, FC_FILE, (const FcChar8 *)fnt->fileName.toUtf8().constData());
+ QByteArray cs = fnt->fileName.toUtf8();
+ FcPatternAddString(pattern, FC_FILE, (const FcChar8 *) cs.constData());
FcChar8 *fam = 0, *familylang = 0;
int i, n = 0;
@@ -2130,7 +2142,8 @@ QString QFontDatabase::resolveFontFamilyAlias(const QString &family)
if (!pattern)
return family;
- FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) family.toUtf8().data());
+ QByteArray cs = family.toUtf8();
+ FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData());
FcConfigSubstitute(0, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
index 24bd750e80..64b8682024 100644
--- a/src/gui/text/qfontengine_coretext.mm
+++ b/src/gui/text/qfontengine_coretext.mm
@@ -100,7 +100,12 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const QCFString &name, const
QCFType<CTFontDescriptorRef> descriptor = CTFontDescriptorCreateWithNameAndSize(name, fontDef.pixelSize);
QCFType<CTFontRef> baseFont = CTFontCreateWithFontDescriptor(descriptor, fontDef.pixelSize, &transform);
- ctfont = CTFontCreateCopyWithSymbolicTraits(baseFont, fontDef.pixelSize, &transform, symbolicTraits, symbolicTraits);
+ ctfont = NULL;
+ // There is a side effect in Core Text: if we apply 0 as symbolic traits to a font in normal weight,
+ // we will get the light version of that font (while the way supposed to work doesn't:
+ // setting kCTFontWeightTrait to some value between -1.0 to 0.0 has no effect on font selection)
+ if (fontDef.weight != QFont::Normal || symbolicTraits)
+ ctfont = CTFontCreateCopyWithSymbolicTraits(baseFont, fontDef.pixelSize, &transform, symbolicTraits, symbolicTraits);
// CTFontCreateCopyWithSymbolicTraits returns NULL if we ask for a trait that does
// not exist for the given font. (for example italic)
@@ -111,17 +116,11 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const QCFString &name, const
init(kerning);
}
-QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning)
+QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning)
: QFontEngineMulti(0)
{
this->fontDef = fontDef;
-
- transform = CGAffineTransformIdentity;
- if (fontDef.stretch != 100) {
- transform = CGAffineTransformMakeScale(float(fontDef.stretch) / float(100), 1);
- }
-
- ctfont = CTFontCreateWithGraphicsFont(cgFontRef, fontDef.pixelSize, &transform, NULL);
+ ctfont = (CTFontRef) CFRetain(ctFontRef);
init(kerning);
}
@@ -144,6 +143,9 @@ void QCoreTextFontEngineMulti::init(bool kerning)
}
QCoreTextFontEngine *fe = new QCoreTextFontEngine(ctfont, fontDef);
+ fontDef.family = fe->fontDef.family;
+ fontDef.styleName = fe->fontDef.styleName;
+ transform = fe->transform;
fe->ref.ref();
engines.append(fe);
}
@@ -400,7 +402,7 @@ void QCoreTextFontEngineMulti::loadEngine(int)
extern int qt_antialiasing_threshold; // from qapplication.cpp
-static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef)
+CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef)
{
CGAffineTransform transform = CGAffineTransformIdentity;
if (fontDef.stretch != 100)
@@ -411,7 +413,7 @@ static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef)
QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def)
{
fontDef = def;
- transform = transformFromFontDef(fontDef);
+ transform = qt_transform_from_fontdef(fontDef);
ctfont = font;
CFRetain(ctfont);
cgFont = CTFontCopyGraphicsFont(font, NULL);
@@ -421,7 +423,7 @@ QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def)
QCoreTextFontEngine::QCoreTextFontEngine(CGFontRef font, const QFontDef &def)
{
fontDef = def;
- transform = transformFromFontDef(fontDef);
+ transform = qt_transform_from_fontdef(fontDef);
cgFont = font;
// Keep reference count balanced
CFRetain(cgFont);
@@ -459,6 +461,9 @@ void QCoreTextFontEngine::init()
QCFString family = CTFontCopyFamilyName(ctfont);
fontDef.family = family;
+ QCFString styleName = (CFStringRef) CTFontCopyAttribute(ctfont, kCTFontStyleNameAttribute);
+ fontDef.styleName = styleName;
+
synthesisFlags = 0;
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ctfont);
if (traits & kCTFontItalicTrait)
@@ -725,10 +730,10 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
}
}
-QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, int /*margin*/, bool aa)
+QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, int margin, bool aa)
{
const glyph_metrics_t br = boundingBox(glyph);
- QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32);
+ QImage im(qRound(br.width) + margin * 2, qRound(br.height) + margin * 2, QImage::Format_RGB32);
im.fill(0);
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
@@ -740,9 +745,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
8, im.bytesPerLine(), colorspace,
cgflags);
CGContextSetFontSize(ctx, fontDef.pixelSize);
- CGContextSetShouldAntialias(ctx, aa ||
- (fontDef.pointSize > qt_antialiasing_threshold
- && !(fontDef.styleStrategy & QFont::NoAntialias)));
+ CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > qt_antialiasing_threshold)
+ && !(fontDef.styleStrategy & QFont::NoAntialias));
CGContextSetShouldSmoothFonts(ctx, aa);
CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx);
CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0);
@@ -760,8 +764,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetFont(ctx, cgFont);
- qreal pos_x = -br.x.toReal() + subPixelPosition.toReal();
- qreal pos_y = im.height() + br.y.toReal() - 1;
+ qreal pos_x = -br.x.toReal() + subPixelPosition.toReal() + margin;
+ qreal pos_y = im.height() + br.y.toReal() - margin;
CGContextSetTextPosition(ctx, pos_x, pos_y);
CGSize advance;
diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h
index 98d3b50c66..3ca8a0ad60 100644
--- a/src/gui/text/qfontengine_coretext_p.h
+++ b/src/gui/text/qfontengine_coretext_p.h
@@ -113,7 +113,7 @@ class QCoreTextFontEngineMulti : public QFontEngineMulti
{
public:
QCoreTextFontEngineMulti(const QCFString &name, const QFontDef &fontDef, bool kerning);
- QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning);
+ QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning);
~QCoreTextFontEngineMulti();
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
@@ -141,6 +141,8 @@ private:
friend class QFontDialogPrivate;
};
+CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef);
+
#endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
#endif // QFONTENGINE_CORETEXT_P_H
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index f514942754..9a5d9d6f2e 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -758,6 +758,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
}
#endif
+ fontDef.styleName = QString::fromUtf8(face->style_name);
+
unlockFace();
fsType = freetype->fsType();
@@ -795,7 +797,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
if (set && set->outline_drawing)
load_flags = FT_LOAD_NO_BITMAP;
- if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics))
+ if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics) || set->outline_drawing)
load_flags |= FT_LOAD_NO_HINTING;
else
load_flags |= load_target;
@@ -1751,7 +1753,6 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
} else {
glyphSet = &defaultGlyphSet;
}
- bool needsDelete = false;
Glyph * g = glyphSet->getGlyph(glyph);
if (!g || g->format != format) {
face = lockFace();
@@ -1759,7 +1760,6 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
FT_Matrix_Multiply(&glyphSet->transformationMatrix, &m);
freetype->matrix = m;
g = loadGlyph(glyphSet, glyph, subPixelPosition, format);
- needsDelete = true;
}
if (g) {
@@ -1768,8 +1768,6 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
overall.width = g->width;
overall.height = g->height;
overall.xoff = g->advance;
- if (needsDelete)
- delete g;
} else {
int left = FLOOR(face->glyph->metrics.horiBearingX);
int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width);
diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp
index 099704894c..e3bfa5df46 100644
--- a/src/gui/text/qfontengine_x11.cpp
+++ b/src/gui/text/qfontengine_x11.cpp
@@ -1205,7 +1205,9 @@ QFontEngine *QFontEngineX11FT::cloneWithSize(qreal pixelSize) const
delete fe;
return 0;
} else {
+#ifndef QT_NO_XRENDER
fe->xglyph_format = xglyph_format;
+#endif
return fe;
}
}
diff --git a/src/gui/text/qfontinfo.h b/src/gui/text/qfontinfo.h
index 1238cba4da..37a724ec7c 100644
--- a/src/gui/text/qfontinfo.h
+++ b/src/gui/text/qfontinfo.h
@@ -61,6 +61,7 @@ public:
QFontInfo &operator=(const QFontInfo &);
QString family() const;
+ QString styleName() const;
int pixelSize() const;
int pointSize() const;
qreal pointSizeF() const;
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 195bd7891b..9e1646f046 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -1329,8 +1329,10 @@ bool QFontMetricsF::inFont(QChar ch) const
}
/*!
- Returns true if the character encoded in UCS-4/UTF-32 is a valid
- character in the font; otherwise returns false.
+ \fn bool QFontMetricsF::inFontUcs4(uint ch) const
+
+ Returns true if the character given by \a ch, encoded in UCS-4/UTF-32,
+ is a valid character in the font; otherwise returns false.
*/
bool QFontMetricsF::inFontUcs4(uint ucs4) const
{
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index 05e3b6bbda..2865d91d94 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -132,13 +132,27 @@ QGlyphRun &QGlyphRun::operator=(const QGlyphRun &other)
*/
bool QGlyphRun::operator==(const QGlyphRun &other) const
{
- return ((d == other.d)
- || (d->glyphIndexes == other.d->glyphIndexes
- && d->glyphPositions == other.d->glyphPositions
- && d->overline == other.d->overline
- && d->underline == other.d->underline
- && d->strikeOut == other.d->strikeOut
- && d->rawFont == other.d->rawFont));
+ if (d == other.d)
+ return true;
+
+ if ((d->glyphIndexDataSize != other.d->glyphIndexDataSize)
+ || (d->glyphPositionDataSize != other.d->glyphPositionDataSize)) {
+ return false;
+ }
+
+ for (int i=0; i<qMax(d->glyphIndexDataSize, d->glyphPositionDataSize); ++i) {
+ if (i < d->glyphIndexDataSize && d->glyphIndexData[i] != other.d->glyphIndexData[i])
+ return false;
+
+ if (i < d->glyphPositionDataSize && d->glyphPositionData[i] != other.d->glyphPositionData[i])
+ return false;
+ }
+
+
+ return (d->overline == other.d->overline
+ && d->underline == other.d->underline
+ && d->strikeOut == other.d->strikeOut
+ && d->rawFont == other.d->rawFont);
}
/*!
@@ -151,36 +165,6 @@ bool QGlyphRun::operator!=(const QGlyphRun &other) const
}
/*!
- \internal
-
- Adds together the lists of glyph indexes and positions in \a other and this QGlyphRun
- object and returns the result. The font in the returned QGlyphRun will be the same as in
- this QGlyphRun object.
-*/
-QGlyphRun QGlyphRun::operator+(const QGlyphRun &other) const
-{
- QGlyphRun ret(*this);
- ret += other;
- return ret;
-}
-
-/*!
- \internal
-
- Appends the glyph indexes and positions in \a other to this QGlyphRun object and returns
- a reference to the current object.
-*/
-QGlyphRun &QGlyphRun::operator+=(const QGlyphRun &other)
-{
- detach();
-
- d->glyphIndexes += other.d->glyphIndexes;
- d->glyphPositions += other.d->glyphPositions;
-
- return *this;
-}
-
-/*!
Returns the font selected for this QGlyphRun object.
\sa setRawFont()
@@ -208,7 +192,13 @@ void QGlyphRun::setRawFont(const QRawFont &rawFont)
*/
QVector<quint32> QGlyphRun::glyphIndexes() const
{
- return d->glyphIndexes;
+ if (d->glyphIndexes.constData() == d->glyphIndexData) {
+ return d->glyphIndexes;
+ } else {
+ QVector<quint32> indexes(d->glyphIndexDataSize);
+ qMemCopy(indexes.data(), d->glyphIndexData, d->glyphIndexDataSize * sizeof(quint32));
+ return indexes;
+ }
}
/*!
@@ -218,7 +208,9 @@ QVector<quint32> QGlyphRun::glyphIndexes() const
void QGlyphRun::setGlyphIndexes(const QVector<quint32> &glyphIndexes)
{
detach();
- d->glyphIndexes = glyphIndexes;
+ d->glyphIndexes = glyphIndexes; // Keep a reference to the QVector to avoid copying
+ d->glyphIndexData = glyphIndexes.constData();
+ d->glyphIndexDataSize = glyphIndexes.size();
}
/*!
@@ -226,7 +218,14 @@ void QGlyphRun::setGlyphIndexes(const QVector<quint32> &glyphIndexes)
*/
QVector<QPointF> QGlyphRun::positions() const
{
- return d->glyphPositions;
+ if (d->glyphPositions.constData() == d->glyphPositionData) {
+ return d->glyphPositions;
+ } else {
+ QVector<QPointF> glyphPositions(d->glyphPositionDataSize);
+ qMemCopy(glyphPositions.data(), d->glyphPositionData,
+ d->glyphPositionDataSize * sizeof(QPointF));
+ return glyphPositions;
+ }
}
/*!
@@ -236,7 +235,9 @@ QVector<QPointF> QGlyphRun::positions() const
void QGlyphRun::setPositions(const QVector<QPointF> &positions)
{
detach();
- d->glyphPositions = positions;
+ d->glyphPositions = positions; // Keep a reference to the vector to avoid copying
+ d->glyphPositionData = positions.constData();
+ d->glyphPositionDataSize = positions.size();
}
/*!
@@ -245,12 +246,33 @@ void QGlyphRun::setPositions(const QVector<QPointF> &positions)
void QGlyphRun::clear()
{
detach();
- d->glyphPositions = QVector<QPointF>();
- d->glyphIndexes = QVector<quint32>();
d->rawFont = QRawFont();
d->strikeOut = false;
d->overline = false;
d->underline = false;
+
+ setPositions(QVector<QPointF>());
+ setGlyphIndexes(QVector<quint32>());
+}
+
+/*!
+ Sets the glyph indexes and positions of this QGlyphRun to use the first \a size
+ elements in the arrays \a glyphIndexArray and \a glyphPositionArray. The data is
+ \e not copied. The caller must guarantee that the arrays are not deleted as long
+ as this QGlyphRun and any copies of it exists.
+
+ \sa setGlyphIndexes(), setPositions()
+*/
+void QGlyphRun::setRawData(const quint32 *glyphIndexArray, const QPointF *glyphPositionArray,
+ int size)
+{
+ detach();
+ d->glyphIndexes.clear();
+ d->glyphPositions.clear();
+
+ d->glyphIndexData = glyphIndexArray;
+ d->glyphPositionData = glyphPositionArray;
+ d->glyphIndexDataSize = d->glyphPositionDataSize = size;
}
/*!
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index e43f1ef57a..cf407a82d3 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -66,6 +66,10 @@ public:
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
+ void setRawData(const quint32 *glyphIndexArray,
+ const QPointF *glyphPositionArray,
+ int size);
+
QVector<quint32> glyphIndexes() const;
void setGlyphIndexes(const QVector<quint32> &glyphIndexes);
diff --git a/src/gui/text/qglyphrun_p.h b/src/gui/text/qglyphrun_p.h
index 533679d96a..a7745e68ce 100644
--- a/src/gui/text/qglyphrun_p.h
+++ b/src/gui/text/qglyphrun_p.h
@@ -71,6 +71,10 @@ public:
: overline(false)
, underline(false)
, strikeOut(false)
+ , glyphIndexData(glyphIndexes.constData())
+ , glyphIndexDataSize(0)
+ , glyphPositionData(glyphPositions.constData())
+ , glyphPositionDataSize(0)
{
}
@@ -82,6 +86,10 @@ public:
, overline(other.overline)
, underline(other.underline)
, strikeOut(other.strikeOut)
+ , glyphIndexData(other.glyphIndexData)
+ , glyphIndexDataSize(other.glyphIndexDataSize)
+ , glyphPositionData(other.glyphPositionData)
+ , glyphPositionDataSize(other.glyphPositionDataSize)
{
}
@@ -92,6 +100,17 @@ public:
uint overline : 1;
uint underline : 1;
uint strikeOut : 1;
+
+ const quint32 *glyphIndexData;
+ int glyphIndexDataSize;
+
+ const QPointF *glyphPositionData;
+ int glyphPositionDataSize;
+
+ static QGlyphRunPrivate *get(const QGlyphRun &glyphRun)
+ {
+ return glyphRun.d.data();
+ }
};
QT_END_NAMESPACE
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index 6071c55ce2..7e829dbd3f 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -51,6 +51,13 @@ extern void qt_registerFont(const QString &familyname, const QString &foundrynam
QFont::Style style, int stretch, bool antialiased,bool scalable, int pixelSize,
const QSupportedWritingSystems &writingSystems, void *hanlde);
+/*!
+ \fn void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *)
+
+ Registers the pre-rendered QPF2 font contained in the given \a dataArray.
+
+ \sa registerFont()
+*/
void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *handle)
{
if (dataArray.size() == 0)
@@ -88,6 +95,32 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *
}
}
+/*!
+ \fn void QPlatformFontDatabase::registerFont(const QString &familyName,
+ const QString &foundryName, QFont::Weight weight, QFont::Style style,
+ QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize,
+ const QSupportedWritingSystems &writingSystems, void *usrPtr)
+
+ Registers a font with the given set of attributes describing the font's
+ foundry, family name, style and stretch information, pixel size, and
+ supported writing systems. Additional information about whether the font
+ can be scaled and antialiased can also be provided.
+
+ The foundry name and font family are described by \a foundryName and
+ \a familyName. The font weight (light, normal, bold, etc.), style (normal,
+ oblique, italic) and stretch information (condensed, expanded, unstretched,
+ etc.) are specified by \a weight, \a style and \a stretch.
+
+ Some fonts can be antialiased and scaled; \a scalable and \a antialiased
+ can be set to true for fonts with these attributes. The intended pixel
+ size of non-scalable fonts is specified by \a pixelSize; this value will be
+ ignored for scalable fonts.
+
+ The writing systems supported by the font are specified by the
+ \a writingSystems argument.
+
+ \sa registerQPF2Font()
+*/
void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight,
QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize,
const QSupportedWritingSystems &writingSystems, void *usrPtr)
@@ -206,7 +239,8 @@ void QPlatformFontDatabase::populateFontDatabase()
}
/*!
-
+ Returns the font engine that can be used to render the font described by
+ the font definition, \a fontDef, in the specified \a script.
*/
QFontEngine *QPlatformFontDatabase::fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle)
{
@@ -229,7 +263,8 @@ QFontEngine *QPlatformFontDatabase::fontEngine(const QByteArray &fontData, qreal
}
/*!
-
+ Returns a list of alternative fonts for the specified \a family and
+ \a style and \a script using the \a styleHint given.
*/
QStringList QPlatformFontDatabase::fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const
{
@@ -241,8 +276,13 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString family, cons
}
/*!
- Adds an application font. Returns a list of family names, or an empty list if the font could
- not be added
+ Adds an application font described by the font contained supplied \a fontData
+ or using the font contained in the file referenced by \a fileName. Returns
+ a list of family names, or an empty list if the font could not be added.
+
+ \note The default implementation of this function does not add an application
+ font. Subclasses should reimplement this function to perform the necessary
+ loading and registration of fonts.
*/
QStringList QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)
{
@@ -280,21 +320,23 @@ QString QPlatformFontDatabase::fontDir() const
/*!
\class QPlatformFontDatabase
- \brief The QPlatformFontDatabase makes it possible to customize how fonts are picked up, and
- and how they are rendered
+ \brief The QPlatformFontDatabase class makes it possible to customize how fonts
+ are discovered and how they are rendered
\ingroup painting
QPlatformFontDatabase is the superclass which is intended to let platform implementations use
native font handling.
- Qt has its internal fontdatabase which it uses to pick up available fonts. To be able
- to populate this database subclass this class, and reimplement populateFontDatabase().
+ Qt has its internal font database which it uses to discover available fonts on the
+ user's system. To be able to populate this database subclass this class, and
+ reimplement populateFontDatabase().
- Use the function registerFont to populate the internal fontdatabase.
+ Use the function registerFont() to populate the internal font database.
- Sometimes a specified font does not have the required glyphs, then the fallbackForFamily
- function is called.
+ Sometimes a specified font does not have the required glyphs; in such a case, the
+ fallbackForFamily() function is called automatically to find alternative font
+ families that can supply alternatives to the missing glyphs.
\sa QSupportedWritingSystems
*/
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 843deb0739..ec5cc18ef9 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -87,16 +87,16 @@ QT_BEGIN_NAMESPACE
QRawFont can be constructed in a number of ways:
\list
- \o \l It can be constructed by calling QTextLayout::glyphRuns() or QTextFragment::glyphRuns().
- The returned QGlyphRun objects will contain QRawFont objects which represent the actual
- fonts used to render each portion of the text.
- \o \l It can be constructed by passing a QFont object to QRawFont::fromFont(). The function
- will return a QRawFont object representing the font that will be selected as response to
- the QFont query and the selected writing system.
- \o \l It can be constructed by passing a file name or QByteArray directly to the QRawFont
- constructor, or by calling loadFromFile() or loadFromData(). In this case, the
- font will not be registered in QFontDatabase, and it will not be available as part of
- regular font selection.
+ \o It can be constructed by calling QTextLayout::glyphs() or QTextFragment::glyphs(). The
+ returned QGlyphs objects will contain QRawFont objects which represent the actual fonts
+ used to render each portion of the text.
+ \o It can be constructed by passing a QFont object to QRawFont::fromFont(). The function
+ will return a QRawFont object representing the font that will be selected as response to
+ the QFont query and the selected writing system.
+ \o It can be constructed by passing a file name or QByteArray directly to the QRawFont
+ constructor, or by calling loadFromFile() or loadFromData(). In this case, the
+ font will not be registered in QFontDatabase, and it will not be available as part of
+ regular font selection.
\endlist
QRawFont is considered local to the thread in which it is constructed (either using a
@@ -132,8 +132,9 @@ QRawFont::QRawFont()
}
/*!
- Constructs a QRawFont representing the font contained in the file referenced by \a fileName,
- with \a pixelSize size in pixels, and the selected \a hintingPreference.
+ Constructs a QRawFont representing the font contained in the file referenced
+ by \a fileName for the size (in pixels) given by \a pixelSize, and using the
+ hinting preference specified by \a hintingPreference.
\note The referenced file must contain a TrueType or OpenType font.
*/
@@ -146,7 +147,9 @@ QRawFont::QRawFont(const QString &fileName,
}
/*!
- Constructs a QRawFont representing the font contained in \a fontData.
+ Constructs a QRawFont representing the font contained in the supplied
+ \a fontData for the size (in pixels) given by \a pixelSize, and using the
+ hinting preference specified by \a hintingPreference.
\note The data must contain a TrueType or OpenType font.
*/
@@ -192,7 +195,9 @@ bool QRawFont::isValid() const
}
/*!
- Replaces the current QRawFont with the contents of the file references by \a fileName.
+ Replaces the current QRawFont with the contents of the file referenced
+ by \a fileName for the size (in pixels) given by \a pixelSize, and using the
+ hinting preference specified by \a hintingPreference.
The file must reference a TrueType or OpenType font.
@@ -208,7 +213,9 @@ void QRawFont::loadFromFile(const QString &fileName,
}
/*!
- Replaces the current QRawFont with the contents of \a fontData.
+ Replaces the current QRawFont with the font contained in the supplied
+ \a fontData for the size (in pixels) given by \a pixelSize, and using the
+ hinting preference specified by \a hintingPreference.
The \a fontData must contain a TrueType or OpenType font.
@@ -226,8 +233,9 @@ void QRawFont::loadFromData(const QByteArray &fontData,
}
/*!
- This function returns a rasterized image of the glyph at a given \a glyphIndex in the underlying
- font, if the QRawFont is valid, otherwise it will return an invalid QImage.
+ This function returns a rasterized image of the glyph at the given
+ \a glyphIndex in the underlying font, using the \a transform specified.
+ If the QRawFont is not valid, this function will return an invalid QImage.
If \a antialiasingType is set to QRawFont::SubPixelAntialiasing, then the resulting image will be
in QImage::Format_RGB32 and the RGB values of each pixel will represent the subpixel opacities of
@@ -396,6 +404,19 @@ QString QRawFont::familyName() const
}
/*!
+ Returns the style name of this QRawFont.
+
+ \sa QFont::styleName()
+*/
+QString QRawFont::styleName() const
+{
+ if (!isValid())
+ return QString();
+
+ return d->fontEngine->fontDef.styleName;
+}
+
+/*!
Returns the style of this QRawFont.
\sa QFont::style()
@@ -422,11 +443,15 @@ int QRawFont::weight() const
}
/*!
- Converts a string of unicode points to glyph indexes using the CMAP table in the
- underlying font. Note that in cases where there are other tables in the font that affect the
- shaping of the text, the returned glyph indexes will not correctly represent the rendering
- of the text. To get the correctly shaped text, you can use QTextLayout to lay out and shape the
- text, and then call QTextLayout::glyphRuns() to get the set of glyph index list and QRawFont pairs.
+ Converts the string of unicode points given by \a text to glyph indexes
+ using the CMAP table in the underlying font, and returns a vector containing
+ the result.
+
+ Note that, in cases where there are other tables in the font that affect the
+ shaping of the text, the returned glyph indexes will not correctly represent
+ the rendering of the text. To get the correctly shaped text, you can use
+ QTextLayout to lay out and shape the text, then call QTextLayout::glyphs()
+ to get the set of glyph index list and QRawFont pairs.
\sa advancesForGlyphIndexes(), glyphIndexesForChars(), QGlyphRun, QTextLayout::glyphRuns(), QTextFragment::glyphRuns()
*/
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index da56d3d667..99e083775a 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -84,6 +84,7 @@ public:
bool operator==(const QRawFont &other) const;
QString familyName() const;
+ QString styleName() const;
QFont::Style style() const;
int weight() const;
diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp
index e8c10a5748..db60459176 100644
--- a/src/gui/text/qrawfont_ft.cpp
+++ b/src/gui/text/qrawfont_ft.cpp
@@ -46,7 +46,7 @@
#include "qrawfont_p.h"
#include "qfontengine_ft_p.h"
-#if defined(Q_WS_X11)
+#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG)
# include "qfontengine_x11_p.h"
#endif
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
class QFontEngineFTRawFont
-#if defined(Q_WS_X11)
+#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG)
: public QFontEngineX11FT
#else
: public QFontEngineFT
@@ -63,7 +63,7 @@ class QFontEngineFTRawFont
{
public:
QFontEngineFTRawFont(const QFontDef &fontDef)
-#if defined(Q_WS_X11)
+#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG)
: QFontEngineX11FT(fontDef)
#else
: QFontEngineFT(fontDef)
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index fe3c993022..41b6fe24cf 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -600,7 +600,7 @@ Qt::CursorMoveStyle QTextDocument::defaultCursorMoveStyle() const
/*!
\since 4.8
- Set the default cursor movement style.
+ Sets the default cursor movement style to the given \a style.
*/
void QTextDocument::setDefaultCursorMoveStyle(Qt::CursorMoveStyle style)
{
@@ -2553,7 +2553,7 @@ void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block)
const bool emptyBlock = block.begin().atEnd();
if (emptyBlock) {
- html += QLatin1String("-qt-paragraph-type:empty;");
+ html += QLatin1String("-qt-paragraph-type:empty; height:1em;");
}
emitMargins(QString::number(format.topMargin()),
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index b43c8f448b..e8e6c98eab 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -856,7 +856,7 @@ void QTextEngine::shapeLine(const QScriptLine &line)
}
}
-#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC)
+#if !defined(QT_ENABLE_HARFBUZZ_FOR_MAC) && defined(Q_WS_MAC)
static bool enableHarfBuzz()
{
static enum { Yes, No, Unknown } status = Unknown;
@@ -2825,6 +2825,75 @@ QFixed QTextEngine::offsetInLigature(const QScriptItem *si, int pos, int max, in
return 0;
}
+// Scan in logClusters[from..to-1] for glyph_pos
+int QTextEngine::getClusterLength(unsigned short *logClusters,
+ const HB_CharAttributes *attributes,
+ int from, int to, int glyph_pos, int *start)
+{
+ int clusterLength = 0;
+ for (int i = from; i < to; i++) {
+ if (logClusters[i] == glyph_pos && attributes[i].charStop) {
+ if (*start < 0)
+ *start = i;
+ clusterLength++;
+ }
+ else if (clusterLength)
+ break;
+ }
+ return clusterLength;
+}
+
+int QTextEngine::positionInLigature(const QScriptItem *si, int end,
+ QFixed x, QFixed edge, int glyph_pos,
+ bool cursorOnCharacter)
+{
+ unsigned short *logClusters = this->logClusters(si);
+ int clusterStart = -1;
+ int clusterLength = 0;
+
+ if (si->analysis.script != QUnicodeTables::Common &&
+ si->analysis.script != QUnicodeTables::Greek) {
+ if (glyph_pos == -1)
+ return si->position + end;
+ else {
+ int i;
+ for (i = 0; i < end; i++)
+ if (logClusters[i] == glyph_pos)
+ break;
+ return si->position + i;
+ }
+ }
+
+ if (glyph_pos == -1 && end > 0)
+ glyph_pos = logClusters[end - 1];
+ else {
+ if (x <= edge)
+ glyph_pos--;
+ }
+
+ const HB_CharAttributes *attrs = attributes();
+ clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart);
+
+ if (clusterLength) {
+ const QGlyphLayout &glyphs = shapedGlyphs(si);
+ QFixed glyphWidth = glyphs.effectiveAdvance(glyph_pos);
+ // the approximate width of each individual element of the ligature
+ QFixed perItemWidth = glyphWidth / clusterLength;
+ QFixed left = x > edge ? edge : edge - glyphWidth;
+ int n = ((x - left) / perItemWidth).floor().toInt();
+ QFixed dist = x - left - n * perItemWidth;
+ int closestItem = dist > (perItemWidth / 2) ? n + 1 : n;
+ if (cursorOnCharacter && closestItem > 0)
+ closestItem--;
+ int pos = si->position + clusterStart + closestItem;
+ // Jump to the next charStop
+ while (!attrs[pos].charStop && pos < end)
+ pos++;
+ return pos;
+ }
+ return si->position + end;
+}
+
int QTextEngine::previousLogicalPosition(int oldPos) const
{
const HB_CharAttributes *attrs = attributes();
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index ed24d5967b..055974a4ad 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -620,6 +620,7 @@ public:
QFixed leadingSpaceWidth(const QScriptLine &line);
QFixed offsetInLigature(const QScriptItem *si, int pos, int max, int glyph_pos);
+ int positionInLigature(const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos, bool cursorOnCharacter);
int previousLogicalPosition(int oldPos) const;
int nextLogicalPosition(int oldPos) const;
int lineNumberForTextPosition(int pos);
@@ -642,6 +643,7 @@ private:
void resolveAdditionalFormats() const;
int endOfLine(int lineNum);
int beginningOfLine(int lineNum);
+ int getClusterLength(unsigned short *logClusters, const HB_CharAttributes *attributes, int from, int to, int glyph_pos, int *start);
};
class QStackTextEngine : public QTextEngine {
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index a699568b6f..833414f79f 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -571,6 +571,8 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
\value FontStyleHint Corresponds to the QFont::StyleHint property
\value FontStyleStrategy Corresponds to the QFont::StyleStrategy property
\value FontKerning Specifies whether the font has kerning turned on.
+ \value FontHintingPreference Controls the use of hinting according to values
+ of the QFont::HintingPreference enum.
\omitvalue FirstFontProperty
\omitvalue LastFontProperty
@@ -588,8 +590,13 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
List properties
- \value ListStyle
- \value ListIndent
+ \value ListStyle Specifies the style used for the items in a list,
+ described by values of the QTextListFormat::Style enum.
+ \value ListIndent Specifies the amount of indentation used for a list.
+ \value ListNumberPrefix Defines the text which is prepended to item numbers in
+ numeric lists.
+ \value ListNumberSuffix Defines the text which is appended to item numbers in
+ numeric lists.
Table and frame properties
@@ -1263,16 +1270,18 @@ bool QTextFormat::operator==(const QTextFormat &rhs) const
\value AlignNormal Adjacent characters are positioned in the standard
way for text in the writing system in use.
- \value AlignSuperScript Characters are placed above the baseline for
+ \value AlignSuperScript Characters are placed above the base line for
normal text.
- \value AlignSubScript Characters are placed below the baseline for
+ \value AlignSubScript Characters are placed below the base line for
normal text.
- \value AlignMiddle The center of the object is vertically aligned with the base line.
- Currently, this is only implemented for inline objects.
+ \value AlignMiddle The center of the object is vertically aligned with the
+ base line. Currently, this is only implemented for
+ inline objects.
\value AlignBottom The bottom edge of the object is vertically aligned with
the base line.
\value AlignTop The top edge of the object is vertically aligned with
the base line.
+ \value AlignBaseline The base lines of the characters are aligned.
*/
/*!
@@ -2136,8 +2145,9 @@ QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
\fn void QTextBlockFormat::setLineHeight(qreal height, int heightType)
\since 4.8
- This sets the line height for the paragraph to the value in height
- which is dependant on heightType, described by the LineHeightTypes enum.
+ Sets the line height for the paragraph to the value given by \a height
+ which is dependent on \a heightType in the way described by the
+ LineHeightTypes enum.
\sa LineHeightTypes, lineHeight(), lineHeightType()
*/
@@ -2147,11 +2157,16 @@ QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
\fn qreal QTextBlockFormat::lineHeight(qreal scriptLineHeight, qreal scaling) const
\since 4.8
- This returns what the height of the lines in the paragraph will be depending
- on the given height of the script line and the scaling. The value that is returned
- is also dependant on the given LineHeightType of the paragraph as well as the LineHeight
- setting that has been set for the paragraph. The scaling is needed for the heights
- that include a fixed number of pixels, to scale them appropriately for printing.
+ Returns the height of the lines in the paragraph based on the height of the
+ script line given by \a scriptLineHeight and the specified \a scaling
+ factor.
+
+ The value that is returned is also dependent on the given LineHeightType of
+ the paragraph as well as the LineHeight setting that has been set for the
+ paragraph.
+
+ The scaling is needed for heights that include a fixed number of pixels, to
+ scale them appropriately for printing.
\sa LineHeightTypes, setLineHeight(), lineHeightType()
*/
@@ -2237,6 +2252,13 @@ QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
numbering scheme used for items in the list. Note that lists that use the
decimal numbering scheme begin counting at 1 rather than 0.
+ Style properties can be set to further configure the appearance of list
+ items; for example, the ListNumberPrefix and ListNumberSuffix properties
+ can be used to customize the numbers used in an ordered list so that they
+ appear as (1), (2), (3), etc.:
+
+ \snippet doc/src/snippets/textdocument-listitemstyles/mainwindow.cpp add a styled, ordered list
+
\sa QTextList
*/
@@ -2328,8 +2350,11 @@ QTextListFormat::QTextListFormat(const QTextFormat &fmt)
\fn void QTextListFormat::setNumberPrefix(const QString &numberPrefix)
\since 4.8
- Sets the list format's number prefix. This can be used with all
- sorted list types. It does not have any effect on unsorted list types.
+ Sets the list format's number prefix to the string specified by
+ \a numberPrefix. This can be used with all sorted list types. It does not
+ have any effect on unsorted list types.
+
+ The default prefix is an empty string.
\sa numberPrefix()
*/
@@ -2347,8 +2372,10 @@ QTextListFormat::QTextListFormat(const QTextFormat &fmt)
\fn void QTextListFormat::setNumberSuffix(const QString &numberSuffix)
\since 4.8
- Sets the list format's number suffix. This can be used with all
- sorted list types. It does not have any effect on unsorted list types.
+ Sets the list format's number suffix to the string specified by
+ \a numberSuffix. This can be used with all sorted list types. It does not
+ have any effect on unsorted list types.
+
The default suffix is ".".
\sa numberSuffix()
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 988ae9375d..c1bc846bd5 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -584,7 +584,7 @@ bool QTextLayout::cacheEnabled() const
this option is for widgets like QLineEdit or custom widgets without
a QTextDocument. Default value is Qt::LogicalMoveStyle.
- \sa setCursorMoveStyle()
+ \sa cursorMoveStyle()
*/
void QTextLayout::setCursorMoveStyle(Qt::CursorMoveStyle style)
{
@@ -2233,10 +2233,20 @@ QList<QGlyphRun> QTextLine::glyphs(int from, int length) const
glyphIndexes.setRawFont(font);
QPair<QFontEngine *, int> key(fontEngine, int(flags));
- if (!glyphsHash.contains(key))
+ if (!glyphsHash.contains(key)) {
glyphsHash.insert(key, glyphIndexes);
- else
- glyphsHash[key] += glyphIndexes;
+ } else {
+ QGlyphRun &glyphRun = glyphsHash[key];
+
+ QVector<quint32> indexes = glyphRun.glyphIndexes();
+ QVector<QPointF> positions = glyphRun.positions();
+
+ indexes += glyphIndexes.glyphIndexes();
+ positions += glyphIndexes.positions();
+
+ glyphRun.setGlyphIndexes(indexes);
+ glyphRun.setPositions(positions);
+ }
}
}
@@ -2559,8 +2569,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
} else {
bool rtl = eng->isRightToLeft();
bool visual = eng->visualCursorMovement();
+ int end = qMin(lineEnd, si->position + l) - si->position;
if (reverse) {
- int end = qMin(lineEnd, si->position + l) - si->position;
int glyph_end = end == l ? si->num_glyphs : logClusters[end];
int glyph_start = glyph_pos;
if (visual && !rtl && !(lastLine && itm == (visualOrder[nItems - 1] + firstItem)))
@@ -2576,7 +2586,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
for (int i = glyph_start; i <= glyph_end; i++)
x += glyphs.effectiveAdvance(i);
}
- x += eng->offsetInLigature(si, pos, line.length, glyph_pos);
+ x += eng->offsetInLigature(si, pos, end, glyph_pos);
}
*cursorPos = pos + si->position;
@@ -2691,6 +2701,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
}
int glyph_pos = -1;
+ QFixed edge;
// has to be inside run
if (cpos == QTextLine::CursorOnCharacter) {
if (si.analysis.bidiLevel % 2) {
@@ -2701,6 +2712,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
if (pos < x)
break;
glyph_pos = gs;
+ edge = pos;
break;
}
pos -= glyphs.effectiveAdvance(gs);
@@ -2713,6 +2725,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
if (pos > x)
break;
glyph_pos = gs;
+ edge = pos;
}
pos += glyphs.effectiveAdvance(gs);
++gs;
@@ -2726,6 +2739,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
while (gs <= ge) {
if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) {
glyph_pos = gs;
+ edge = pos;
dist = qAbs(x-pos);
}
pos -= glyphs.effectiveAdvance(gs);
@@ -2735,6 +2749,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
while (ge >= gs) {
if (glyphs.attributes[ge].clusterStart && qAbs(x-pos) < dist) {
glyph_pos = ge;
+ edge = pos;
dist = qAbs(x-pos);
}
pos += glyphs.effectiveAdvance(ge);
@@ -2746,6 +2761,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
while (gs <= ge) {
if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) {
glyph_pos = gs;
+ edge = pos;
dist = qAbs(x-pos);
}
pos += glyphs.effectiveAdvance(gs);
@@ -2757,6 +2773,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
pos += glyphs.effectiveAdvance(gs);
if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) {
glyph_pos = gs;
+ edge = pos;
dist = qAbs(x-pos);
}
++gs;
@@ -2773,16 +2790,13 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
if (rtl && nchars > 0)
return insertionPoints[lastLine ? nchars : nchars - 1];
}
- return si.position + end;
+ return eng->positionInLigature(&si, end, x, pos, -1,
+ cpos == QTextLine::CursorOnCharacter);
}
}
Q_ASSERT(glyph_pos != -1);
- int j;
- for (j = 0; j < eng->length(item); ++j)
- if (logClusters[j] == glyph_pos)
- break;
-// qDebug("at pos %d (in run: %d)", si.position + j, j);
- return si.position + j;
+ return eng->positionInLigature(&si, end, x, edge, glyph_pos,
+ cpos == QTextLine::CursorOnCharacter);
}
}
// right of last item
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 1619c9c3e7..2addc0f4b0 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -591,6 +591,7 @@ void QTextOdfWriter::writeCharacterFormat(QXmlStreamWriter &writer, QTextCharFor
QString value;
switch (format.verticalAlignment()) {
case QTextCharFormat::AlignMiddle:
+ case QTextCharFormat::AlignBaseline:
case QTextCharFormat::AlignNormal: value = QString::fromLatin1("0%"); break;
case QTextCharFormat::AlignSuperScript: value = QString::fromLatin1("super"); break;
case QTextCharFormat::AlignSubScript: value = QString::fromLatin1("sub"); break;
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 97d1226032..8c243edda2 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -70,6 +70,10 @@
#include <schemehandler.h>
#endif
+#ifdef Q_WS_S60
+#include <CDirectoryLocalizer.h> // CDirectoryLocalizer
+#endif
+
QT_BEGIN_NAMESPACE
_LIT(KCacheSubDir, "Cache\\");
@@ -444,18 +448,31 @@ static QString defaultLocalizedDirectoryName(QString&)
QString QDesktopServices::displayName(StandardLocation type)
{
- static LocalizerFunc ptrLocalizerFunc = NULL;
-
- if (!ptrLocalizerFunc) {
- ptrLocalizerFunc = reinterpret_cast<LocalizerFunc>
- (qt_resolveS60PluginFunc(S60Plugin_LocalizedDirectoryName));
- if (!ptrLocalizerFunc)
- ptrLocalizerFunc = &defaultLocalizedDirectoryName;
- }
+ QString ret;
+#ifdef Q_WS_S60
QString rawPath = storageLocation(type);
- return ptrLocalizerFunc(rawPath);
-}
+ TRAPD(err,
+ QT_TRYCATCH_LEAVING(
+ CDirectoryLocalizer* localizer = CDirectoryLocalizer::NewL();
+ CleanupStack::PushL(localizer);
+ localizer->SetFullPath(qt_QString2TPtrC(QDir::toNativeSeparators(rawPath)));
+ if (localizer->IsLocalized()) {
+ TPtrC locName(localizer->LocalizedName());
+ ret = qt_TDesC2QString(locName);
+ }
+ CleanupStack::PopAndDestroy(localizer);
+ )
+ )
+
+ if (err != KErrNone)
+ ret = QString();
+#else
+ qWarning("QDesktopServices::displayName() not implemented for this platform version");
+#endif
+
+ return ret;
+}
QT_END_NAMESPACE
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index f125f82131..7395604f48 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -56,4 +56,10 @@ symbian {
} else {
DEFINES += USE_SCHEMEHANDLER
}
+
+ contains(CONFIG, is_using_gnupoc) {
+ LIBS += -ldirectorylocalizer
+ } else {
+ LIBS += -lDirectoryLocalizer
+ }
}
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 8a93c286ac..2d63f63184 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1127,12 +1127,19 @@ void QLineEdit::setDragEnabled(bool b)
behavior applies.
*/
+/*!
+ Returns the movement style for the cursor in the line edit.
+*/
Qt::CursorMoveStyle QLineEdit::cursorMoveStyle() const
{
Q_D(const QLineEdit);
return d->control->cursorMoveStyle();
}
+/*!
+ Sets the movement style for the cursor in the line edit to the given
+ \a style.
+*/
void QLineEdit::setCursorMoveStyle(Qt::CursorMoveStyle style)
{
Q_D(QLineEdit);
diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp
index fde683d16d..2fe9706edf 100644
--- a/src/gui/widgets/qmdiarea.cpp
+++ b/src/gui/widgets/qmdiarea.cpp
@@ -2176,7 +2176,7 @@ void QMdiArea::setTabsClosable(bool closable)
Tabs are not movable by default.
- \sa QTabBar::tabsMovable, setViewMode()
+ \sa QTabBar::movable, setViewMode()
*/
bool QMdiArea::tabsMovable() const
{
diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp
index ade798f99b..c6551e591e 100644
--- a/src/gui/widgets/qtabwidget.cpp
+++ b/src/gui/widgets/qtabwidget.cpp
@@ -883,7 +883,7 @@ QSize QTabWidget::minimumSizeHint() const
.expandedTo(QApplication::globalStrut());
}
-/*
+/*!
\reimp
*/
int QTabWidget::heightForWidth(int width) const
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 5e50b08da8..c1298e214a 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += folderlistmodel particles gestures
+contains(QT_CONFIG, opengl): SUBDIRS += shaders
diff --git a/src/imports/shaders/glfunctions.h b/src/imports/shaders/glfunctions.h
new file mode 100755
index 0000000000..8529519560
--- /dev/null
+++ b/src/imports/shaders/glfunctions.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 GLFUNCTIONS_H
+#define GLFUNCTIONS_H
+
+#ifndef QT_OPENGL_ES
+
+#ifndef Q_WS_MAC
+# ifndef APIENTRYP
+# ifdef APIENTRY
+# define APIENTRYP APIENTRY *
+# else
+# define APIENTRY
+# define APIENTRYP *
+# endif
+# endif
+#else
+# define APIENTRY
+# define APIENTRYP *
+#endif
+
+#define GL_TEXTURE0 0x84C0
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_BGRA 0x80E1
+
+typedef void (APIENTRYP type_glActiveTexture)(GLenum texture);
+typedef void (APIENTRYP type_glGenerateMipmap)(GLenum target);
+typedef void (APIENTRYP type_glVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+
+#define glActiveTexture ((type_glActiveTexture)QGLContext::currentContext()->getProcAddress(QLatin1String("glActiveTexture")))
+#define glGenerateMipmap ((type_glGenerateMipmap)QGLContext::currentContext()->getProcAddress(QLatin1String("glGenerateMipmap")))
+#define glVertexAttribPointer ((type_glVertexAttribPointer)QGLContext::currentContext()->getProcAddress(QLatin1String("glVertexAttribPointer")))
+
+#endif
+
+#endif // GLFUNCTIONS_H
diff --git a/src/imports/shaders/qmldir b/src/imports/shaders/qmldir
new file mode 100644
index 0000000000..b2a9de2132
--- /dev/null
+++ b/src/imports/shaders/qmldir
@@ -0,0 +1,2 @@
+plugin qmlshadersplugin
+
diff --git a/src/imports/shaders/qmlshadersplugin_plugin.cpp b/src/imports/shaders/qmlshadersplugin_plugin.cpp
new file mode 100644
index 0000000000..c03ef2c8c6
--- /dev/null
+++ b/src/imports/shaders/qmlshadersplugin_plugin.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 "qmlshadersplugin_plugin.h"
+#include "shadereffectitem.h"
+#include "shadereffectsource.h"
+
+#include <QtDeclarative/qdeclarative.h>
+
+void qmlshaderspluginPlugin::registerTypes(const char *uri)
+{
+ qmlRegisterType<ShaderEffectItem>(uri, 1, 0, "ShaderEffectItem");
+ qmlRegisterType<ShaderEffectSource>(uri, 1, 0, "ShaderEffectSource");
+}
+
+Q_EXPORT_PLUGIN2(qmlshadersplugin, qmlshaderspluginPlugin)
+
diff --git a/src/imports/shaders/qmlshadersplugin_plugin.h b/src/imports/shaders/qmlshadersplugin_plugin.h
new file mode 100644
index 0000000000..2614a448c4
--- /dev/null
+++ b/src/imports/shaders/qmlshadersplugin_plugin.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 QMLSHADERSPLUGIN_PLUGIN_H
+#define QMLSHADERSPLUGIN_PLUGIN_H
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class qmlshaderspluginPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+
+public:
+ void registerTypes(const char *uri);
+};
+
+#endif // QMLSHADERSPLUGIN_PLUGIN_H
+
diff --git a/src/imports/shaders/scenegraph/qsggeometry.cpp b/src/imports/shaders/scenegraph/qsggeometry.cpp
new file mode 100644
index 0000000000..05c111aca5
--- /dev/null
+++ b/src/imports/shaders/scenegraph/qsggeometry.cpp
@@ -0,0 +1,310 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 "qsggeometry.h"
+
+QT_BEGIN_NAMESPACE
+
+
+/*!
+ Convenience function which returns attributes to be used for 2D solid
+ color drawing.
+ */
+
+const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D()
+{
+ static Attribute data[] = {
+ { 0, 2, GL_FLOAT }
+ };
+ static AttributeSet attrs = { 1, sizeof(float) * 2, data };
+ return attrs;
+}
+
+/*!
+ Convenience function which returns attributes to be used for textured 2D drawing.
+ */
+
+const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D()
+{
+ static Attribute data[] = {
+ { 0, 2, GL_FLOAT },
+ { 1, 2, GL_FLOAT }
+ };
+ static AttributeSet attrs = { 2, sizeof(float) * 4, data };
+ return attrs;
+}
+
+/*!
+ Convenience function which returns attributes to be used for per vertex colored 2D drawing.
+ */
+
+const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
+{
+ static Attribute data[] = {
+ { 0, 2, GL_FLOAT },
+ { 1, 4, GL_UNSIGNED_BYTE }
+ };
+ static AttributeSet attrs = { 2, 2 * sizeof(float) + 4 * sizeof(char), data };
+ return attrs;
+}
+
+
+/*!
+ \class QSGGeometry
+ \brief The QSGGeometry class provides low-level storage for graphics primitives
+ in the QML Scene Graph.
+
+ The QSGGeometry class provides a few convenience attributes and attribute accessors
+ by default. The defaultAttributes_Point2D() function returns attributes to be used
+ in normal solid color rectangles, while the defaultAttributes_TexturedPoint2D function
+ returns attributes to be used for the common pixmap usecase.
+ */
+
+
+/*!
+ Constructs a geometry object based on \a attributes.
+
+ The object allocate space for \a vertexCount vertices based on the accumulated
+ size in \a attributes and for \a indexCount.
+
+ Geometry objects are constructed with GL_TRIANGLE_STRIP as default drawing mode.
+
+ The attribute structure is assumed to be POD and the geometry object
+ assumes this will not go away. There is no memory management involved.
+ */
+
+QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
+ int vertexCount,
+ int indexCount,
+ int indexType)
+ : m_drawing_mode(GL_TRIANGLE_STRIP)
+ , m_vertex_count(0)
+ , m_index_count(0)
+ , m_index_type(indexType)
+ , m_attributes(attributes)
+ , m_data(0)
+ , m_index_data_offset(-1)
+ , m_owns_data(false)
+{
+ Q_ASSERT(m_attributes.count > 0);
+ Q_ASSERT(m_attributes.stride > 0);
+
+ // Because allocate reads m_vertex_count, m_index_count and m_owns_data, these
+ // need to be set before calling allocate...
+ allocate(vertexCount, indexCount);
+}
+
+QSGGeometry::~QSGGeometry()
+{
+ if (m_owns_data)
+ qFree(m_data);
+}
+
+/*!
+ \fn int QSGGeometry::vertexCount() const
+
+ Returns the number of vertices in this geometry object.
+ */
+
+/*!
+ \fn int QSGGeometry::indexCount() const
+
+ Returns the number of indices in this geometry object.
+ */
+
+
+
+/*!
+ \fn void *QSGGeometry::vertexData()
+
+ Returns a pointer to the raw vertex data of this geometry object.
+
+ \sa vertexDataAsPoint2D(), vertexDataAsTexturedPoint2D
+ */
+
+/*!
+ \fn const void *QSGGeometry::vertexData() const
+
+ Returns a pointer to the raw vertex data of this geometry object.
+
+ \sa vertexDataAsPoint2D(), vertexDataAsTexturedPoint2D
+ */
+
+/*!
+ Returns a pointer to the raw index data of this geometry object.
+
+ \sa indexDataAsUShort(), indexDataAsUInt()
+ */
+void *QSGGeometry::indexData()
+{
+ return m_index_data_offset < 0
+ ? 0
+ : ((char *) m_data + m_index_data_offset);
+}
+
+/*!
+ Returns a pointer to the raw index data of this geometry object.
+
+ \sa indexDataAsUShort(), indexDataAsUInt()
+ */
+const void *QSGGeometry::indexData() const
+{
+ return m_index_data_offset < 0
+ ? 0
+ : ((char *) m_data + m_index_data_offset);
+}
+
+/*!
+ Sets the drawing mode to be used for this geometry.
+
+ The default value is GL_TRIANGLE_STRIP.
+ */
+void QSGGeometry::setDrawingMode(GLenum mode)
+{
+ m_drawing_mode = mode;
+}
+
+/*!
+ \fn int QSGGeometry::drawingMode() const
+
+ Returns the drawing mode of this geometry.
+
+ The default value is GL_TRIANGLE_STRIP.
+ */
+
+/*!
+ \fn int QSGGeometry::indexType() const
+
+ Returns the primitive type used for indices in this
+ geometry object.
+ */
+
+
+/*!
+ Resizes the vertex and index data of this geometry object to fit \a vertexCount
+ vertices and \a indexCount indices.
+
+ Vertex and index data will be invalidated after this call and the caller must
+ */
+void QSGGeometry::allocate(int vertexCount, int indexCount)
+{
+ if (vertexCount == m_vertex_count && indexCount == m_index_count)
+ return;
+
+ m_vertex_count = vertexCount;
+ m_index_count = indexCount;
+
+ bool canUsePrealloc = m_index_count <= 0;
+ int vertexByteSize = m_attributes.stride * m_vertex_count;
+
+ if (m_owns_data)
+ qFree(m_data);
+
+ if (canUsePrealloc && vertexByteSize <= (int) sizeof(m_prealloc)) {
+ m_data = (void *) &m_prealloc[0];
+ m_index_data_offset = -1;
+ m_owns_data = false;
+ } else {
+ Q_ASSERT(m_index_type == GL_UNSIGNED_INT || m_index_type == GL_UNSIGNED_SHORT);
+ int indexByteSize = indexCount * (m_index_type == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32));
+ m_data = (void *) qMalloc(vertexByteSize + indexByteSize);
+ m_index_data_offset = vertexByteSize;
+ m_owns_data = true;
+ }
+
+}
+
+/*!
+ Updates the geometry \a g with the coordinates in \a rect.
+
+ The function assumes the geometry object contains a single triangle strip
+ of QSGGeometry::Point2D vertices
+ */
+void QSGGeometry::updateRectGeometry(QSGGeometry *g, const QRectF &rect)
+{
+ Point2D *v = g->vertexDataAsPoint2D();
+ v[0].x = rect.left();
+ v[0].y = rect.top();
+
+ v[1].x = rect.right();
+ v[1].y = rect.top();
+
+ v[2].x = rect.left();
+ v[2].y = rect.bottom();
+
+ v[3].x = rect.right();
+ v[3].y = rect.bottom();
+}
+
+/*!
+ Updates the geometry \a g with the coordinates in \a rect and texture
+ coordinates from \a textureRect.
+
+ \a textureRect should be in normalized coordinates.
+
+ \a g is assumed to be a triangle strip of four vertices of type
+ QSGGeometry::TexturedPoint2D.
+ */
+void QSGGeometry::updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &textureRect)
+{
+ TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D();
+ v[0].x = rect.left();
+ v[0].y = rect.top();
+ v[0].tx = textureRect.left();
+ v[0].ty = textureRect.top();
+
+ v[1].x = rect.right();
+ v[1].y = rect.top();
+ v[1].tx = textureRect.right();
+ v[1].ty = textureRect.top();
+
+ v[2].x = rect.left();
+ v[2].y = rect.bottom();
+ v[2].tx = textureRect.left();
+ v[2].ty = textureRect.bottom();
+
+ v[3].x = rect.right();
+ v[3].y = rect.bottom();
+ v[3].tx = textureRect.right();
+ v[3].ty = textureRect.bottom();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/shaders/scenegraph/qsggeometry.h b/src/imports/shaders/scenegraph/qsggeometry.h
new file mode 100644
index 0000000000..b6663f8866
--- /dev/null
+++ b/src/imports/shaders/scenegraph/qsggeometry.h
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 QSGGEOMETRY_H
+#define QSGGEOMETRY_H
+
+#include <QtOpenGL/qgl.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QSGGeometry
+{
+public:
+ struct Attribute
+ {
+ int position;
+ int tupleSize;
+ int type;
+ };
+
+ struct AttributeSet {
+ int count;
+ int stride;
+ const Attribute *attributes;
+ };
+
+ struct Point2D { float x, y; };
+ struct TexturedPoint2D { float x, y; float tx, ty; };
+ struct ColoredPoint2D { float x, y; unsigned char r, g, b, a; };
+
+ static const AttributeSet &defaultAttributes_Point2D();
+ static const AttributeSet &defaultAttributes_TexturedPoint2D();
+ static const AttributeSet &defaultAttributes_ColoredPoint2D();
+
+ QSGGeometry(const QSGGeometry::AttributeSet &attribs,
+ int vertexCount,
+ int indexCount = 0,
+ int indexType = GL_UNSIGNED_SHORT);
+ ~QSGGeometry();
+
+ void setDrawingMode(GLenum mode);
+ inline GLenum drawingMode() const { return m_drawing_mode; }
+
+ void allocate(int vertexCount, int indexCount = 0);
+
+ int vertexCount() const { return m_vertex_count; }
+
+ void *vertexData() { return m_data; }
+ inline Point2D *vertexDataAsPoint2D();
+ inline TexturedPoint2D *vertexDataAsTexturedPoint2D();
+ inline ColoredPoint2D *vertexDataAsColoredPoint2D();
+
+ inline const void *vertexData() const { return m_data; }
+ inline const Point2D *vertexDataAsPoint2D() const;
+ inline const TexturedPoint2D *vertexDataAsTexturedPoint2D() const;
+ inline const ColoredPoint2D *vertexDataAsColoredPoint2D() const;
+
+ inline int indexType() const { return m_index_type; }
+
+ int indexCount() const { return m_index_count; }
+
+ void *indexData();
+ inline uint *indexDataAsUInt();
+ inline quint16 *indexDataAsUShort();
+
+ const void *indexData() const;
+ inline const uint *indexDataAsUInt() const;
+ inline const quint16 *indexDataAsUShort() const;
+
+ inline int attributeCount() const { return m_attributes.count; }
+ inline const Attribute *attributes() const { return m_attributes.attributes; }
+ inline int stride() const { return m_attributes.stride; }
+
+ static void updateRectGeometry(QSGGeometry *g, const QRectF &rect);
+ static void updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &sourceRect);
+
+private:
+ int m_drawing_mode;
+ int m_vertex_count;
+ int m_index_count;
+ int m_index_type;
+ const AttributeSet &m_attributes;
+ void *m_data;
+ int m_index_data_offset;
+
+ void *m_reserved_pointer;
+
+ uint m_owns_data : 1;
+ uint m_reserved_bits : 31;
+
+ float m_prealloc[16];
+};
+
+inline uint *QSGGeometry::indexDataAsUInt()
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_INT);
+ return (uint *) indexData();
+}
+
+inline quint16 *QSGGeometry::indexDataAsUShort()
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT);
+ return (quint16 *) indexData();
+}
+
+inline const uint *QSGGeometry::indexDataAsUInt() const
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_INT);
+ return (uint *) indexData();
+}
+
+inline const quint16 *QSGGeometry::indexDataAsUShort() const
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT);
+ return (quint16 *) indexData();
+}
+
+inline QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D()
+{
+ Q_ASSERT(m_attributes.count == 1);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ return (Point2D *) m_data;
+}
+
+inline QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D()
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 4 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT);
+ return (TexturedPoint2D *) m_data;
+}
+
+inline QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D()
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE);
+ return (ColoredPoint2D *) m_data;
+}
+
+inline const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const
+{
+ Q_ASSERT(m_attributes.count == 1);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ return (const Point2D *) m_data;
+}
+
+inline const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D() const
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 4 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT);
+ return (const TexturedPoint2D *) m_data;
+}
+
+inline const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D() const
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE);
+ return (const ColoredPoint2D *) m_data;
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QSGGEOMETRY_H
diff --git a/src/imports/shaders/shadereffect.cpp b/src/imports/shaders/shadereffect.cpp
new file mode 100644
index 0000000000..bbea43c0c7
--- /dev/null
+++ b/src/imports/shaders/shadereffect.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 "shadereffect.h"
+#include "shadereffectbuffer.h"
+#include "shadereffectsource.h"
+
+#include <QDeclarativeItem>
+#include <QPainter>
+#include <QtOpenGL>
+
+static QTransform savedWorldTransform;
+
+ShaderEffect::ShaderEffect(QObject *parent)
+ : QGraphicsEffect(parent)
+ , m_changed(true)
+{
+}
+
+ShaderEffect::~ShaderEffect()
+{
+}
+
+void ShaderEffect::prepareBufferedDraw(QPainter *painter)
+{
+ // This workaround needed because QGraphicsEffect seems to always utilize default painters worldtransform
+ // instead of the active painters worldtransform.
+ const ShaderEffectBuffer *effectBuffer = dynamic_cast<ShaderEffectBuffer*> (painter->device());
+ if (effectBuffer) {
+ savedWorldTransform = painter->worldTransform() * savedWorldTransform;
+ painter->setWorldTransform(savedWorldTransform);
+ } else {
+ savedWorldTransform = painter->worldTransform();
+ }
+}
+
+void ShaderEffect::draw (QPainter *painter)
+{
+ const QGLContext *context = QGLContext::currentContext();
+
+ prepareBufferedDraw(painter);
+
+ if (context) {
+ updateRenderTargets();
+ }
+
+ if (!context || m_renderTargets.count() == 0 || !hideOriginal())
+ drawSource(painter);
+}
+
+void ShaderEffect::updateRenderTargets()
+{
+ if (!m_changed)
+ return;
+
+ m_changed = false;
+
+ int count = m_renderTargets.count();
+ for (int i = 0; i < count; i++) {
+ if (m_renderTargets[i]->isLive() || m_renderTargets[i]->isDirtyTexture()) {
+ m_renderTargets[i]->updateBackbuffer();
+ ShaderEffectBuffer* target = m_renderTargets[i]->fbo();
+ if (target && target->isValid() && target->width() > 0 && target->height() > 0) {
+ QPainter p(target);
+ p.setCompositionMode(QPainter::CompositionMode_Clear);
+ p.fillRect(QRect(QPoint(0, 0), target->size()), Qt::transparent);
+ p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+
+ QRectF sourceRect = m_renderTargets[i]->sourceRect();
+ QSize textureSize = m_renderTargets[i]->textureSize();
+
+ qreal yflip = m_renderTargets[i]->isMirrored() ? -1.0 : 1.0; // flip y to match scenegraph, it also flips texturecoordinates
+ qreal xscale = 1.0;
+ qreal yscale = 1.0 * yflip;
+
+ qreal leftMargin = 0.0;
+ qreal rightMargin = 0.0;
+ qreal topMargin = 0.0;
+ qreal bottomMargin = 0.0;
+
+ qreal width = m_renderTargets[i]->sourceItem()->width();
+ qreal height = m_renderTargets[i]->sourceItem()->height();
+
+ if (!sourceRect.isEmpty()) {
+ leftMargin = -sourceRect.left();
+ rightMargin = sourceRect.right() - width;
+ topMargin = -sourceRect.top();
+ bottomMargin = sourceRect.bottom() - height;
+ }
+
+ if ((width + leftMargin + rightMargin) > 0 && (height + topMargin + bottomMargin) > 0) {
+ if (!textureSize.isEmpty()) {
+ qreal textureWidth = textureSize.width();
+ qreal textureHeight = textureSize.height();
+
+ xscale = width / (width + leftMargin + rightMargin);
+ yscale = height / (height + topMargin + bottomMargin);
+
+ p.translate(textureWidth / 2, textureHeight / 2);
+ p.scale(xscale, yscale * yflip);
+ p.translate(-textureWidth / 2, -textureHeight / 2);
+ p.scale(textureWidth / width, textureHeight / height);
+ } else {
+ xscale = width / (width + leftMargin + rightMargin);
+ yscale = height / (height + topMargin + bottomMargin);
+
+ p.translate(width / 2, height / 2);
+ p.scale(xscale, yscale * yflip);
+ p.translate(-width / 2, -height / 2);
+ }
+ }
+
+ drawSource(&p);
+ p.end();
+ m_renderTargets[i]->markSceneGraphDirty();
+ }
+ }
+ }
+}
+
+void ShaderEffect::sourceChanged (ChangeFlags flags)
+{
+ Q_UNUSED(flags);
+ m_changed = true;
+}
+
+void ShaderEffect::addRenderTarget(ShaderEffectSource *target)
+{
+ if (!m_renderTargets.contains(target))
+ m_renderTargets.append(target);
+}
+
+void ShaderEffect::removeRenderTarget(ShaderEffectSource *target)
+{
+ int index = m_renderTargets.indexOf(target);
+ if (index >= 0)
+ m_renderTargets.remove(index);
+ else
+ qWarning() << "ShaderEffect::removeRenderTarget - did not find target.";
+}
+
+bool ShaderEffect::hideOriginal() const
+{
+ if (m_renderTargets.count() == 0)
+ return false;
+
+ // Just like scenegraph version, if there is even one source that says "hide original" we hide it.
+ int count = m_renderTargets.count();
+ for (int i = 0; i < count; i++) {
+ if (m_renderTargets[i]->hideSource())
+ return true;
+ }
+ return false;
+}
diff --git a/src/imports/shaders/shadereffect.h b/src/imports/shaders/shadereffect.h
new file mode 100644
index 0000000000..35a697b136
--- /dev/null
+++ b/src/imports/shaders/shadereffect.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 SHADEREFFECT_H
+#define SHADEREFFECT_H
+
+#include <QGraphicsEffect>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectSource;
+
+class ShaderEffect : public QGraphicsEffect
+{
+ Q_OBJECT
+
+public:
+ ShaderEffect(QObject *parent = 0);
+ ~ShaderEffect();
+ void addRenderTarget(ShaderEffectSource *target);
+ void removeRenderTarget(ShaderEffectSource *target);
+
+protected:
+ virtual void draw (QPainter *painter);
+ virtual void sourceChanged (ChangeFlags flags);
+
+private:
+ void prepareBufferedDraw(QPainter *painter);
+ void updateRenderTargets();
+ bool hideOriginal() const;
+
+public:
+ QVector<ShaderEffectSource*> m_renderTargets;
+ bool m_changed : 1;
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+#endif // SHADEREFFECT_H
diff --git a/src/imports/shaders/shadereffectbuffer.cpp b/src/imports/shaders/shadereffectbuffer.cpp
new file mode 100644
index 0000000000..4c76adaae3
--- /dev/null
+++ b/src/imports/shaders/shadereffectbuffer.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 "shadereffectbuffer.h"
+
+ShaderEffectBuffer::ShaderEffectBuffer(const QSize & size, const QGLFramebufferObjectFormat & format)
+ : QGLFramebufferObject(size, format)
+{
+}
+
+ShaderEffectBuffer::~ShaderEffectBuffer()
+{
+}
+
diff --git a/src/imports/shaders/shadereffectbuffer.h b/src/imports/shaders/shadereffectbuffer.h
new file mode 100644
index 0000000000..dcab6ec683
--- /dev/null
+++ b/src/imports/shaders/shadereffectbuffer.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 SHADEREFFECTBUFFER_H
+#define SHADEREFFECTBUFFER_H
+
+#include <QtOpenGL>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectBuffer : public QGLFramebufferObject
+{
+public:
+ ShaderEffectBuffer(const QSize &size, const QGLFramebufferObjectFormat &format);
+ ~ShaderEffectBuffer();
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+#endif // SHADEREFFECTBUFFER_H
diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp
new file mode 100644
index 0000000000..5bb906ccfb
--- /dev/null
+++ b/src/imports/shaders/shadereffectitem.cpp
@@ -0,0 +1,915 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 "shadereffectitem.h"
+#include "shadereffect.h"
+#include "glfunctions.h"
+
+#include <QPainter>
+#include <QtOpenGL>
+
+static const char qt_default_vertex_code[] =
+ "uniform highp mat4 qt_ModelViewProjectionMatrix;\n"
+ "attribute highp vec4 qt_Vertex;\n"
+ "attribute highp vec2 qt_MultiTexCoord0;\n"
+ "varying highp vec2 qt_TexCoord0;\n"
+ "void main(void)\n"
+ "{\n"
+ "qt_TexCoord0 = qt_MultiTexCoord0;\n"
+ "gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n"
+ "}\n";
+
+static const char qt_default_fragment_code[] =
+ "varying highp vec2 qt_TexCoord0;\n"
+ "uniform lowp sampler2D source;\n"
+ "void main(void)\n"
+ "{\n"
+ "gl_FragColor = texture2D(source, qt_TexCoord0.st);\n"
+ "}\n";
+
+static const char qt_postion_attribute_name[] = "qt_Vertex";
+static const char qt_texcoord_attribute_name[] = "qt_MultiTexCoord0";
+static const char qt_emptyAttributeName[] = "";
+
+
+/*!
+ \qmlclass ShaderEffectItem ShaderEffectItem
+ \ingroup qmlshadersplugin
+ \brief The ShaderEffectItem object alters the output of given item with OpenGL shaders.
+ \inherits Item
+
+ ShaderEffectItem is available in the \bold{Qt.labs.shaders 1.0} module.
+ \e {Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.}
+
+ This element provides preliminary support for embedding OpenGL shader code into QML,
+ and may be heavily changed or removed in later versions.
+
+ Requirement for the use of shaders is that the application is either using
+ Qt OpenGL graphicssystem or is forced to use OpenGL by setting QGLWidget as the viewport to QDeclarativeView (recommened way).
+
+ ShaderEffectItem internal behaviour is such that during the paint event it first renders its
+ ShaderEffectSource items into a OpenGL framebuffer object which can be used as a texture. If the ShaderEffectSource is defined to be an image,
+ it is directly uploaded as a texture. The texture(s) containing the source pixelcontent are then bound to graphics
+ pipeline texture units. Finally a textured mesh is passed to the vertex- and fragmentshaders which
+ then produce the final output for the ShaderEffectItem. It is possible to alter the mesh structure by defining
+ the amount vertices it contains, but currently it is not possible to import complex 3D-models to be used as the mesh.
+
+ It is possible to define one or more ShaderEffectItems to be a ShaderEffectSource for other ShaderEffectItems, but ShaderEffectItem
+ should never be declared as a child element of its source item(s) because it would cause circular loop in the painting.
+
+ A standard set of vertex attributes are provided for the shaders:
+
+ \list
+ \o qt_Vertex - The primary position of the vertex.
+ \o qt_MultiTexCoord0 - The texture co-ordinate at each vertex for texture unit 0.
+ \endlist
+
+ Additionally following uniforms are available for shaders:
+
+ \list
+ \o qt_Opacity - Effective opacity of the item.
+ \o qt_ModelViewProjectionMatrix - current 4x4 transformation matrix of the item.
+ \endlist
+
+ Furthermore, it is possible to utilize automatic QML propertybinding into vertex- and fragment shader
+ uniforms. Conversions are done according to the table below:
+
+ \table
+ \header
+ \o QML property
+ \o GLSL uniform
+ \row
+ \o property double foo: 1.0
+ \o uniform highp float foo
+ \row
+ \o property real foo: 1.0
+ \o uniform highp float foo
+ \row
+ \o property bool foo: true
+ \o uniform bool foo
+ \row
+ \o property int foo: 1
+ \o uniform int foo
+ \row
+ \o property variant foo: Qt.point(1,1)
+ \o uniform highp vec2 foo
+ \row
+ \o property variant foo: Qt.size(1, 1)
+ \o uniform highp vec2 foo
+ \row
+ \o property variant foo: Qt.rect(1, 1, 2, 2)
+ \o uniform highp vec4 foo
+ \row
+ \o property color foo: "#00000000"
+ \o uniform lowp vec4 foo
+ \row
+ \o property variant foo: Qt.vector3d(1.0, 2.0, 0.0)
+ \o uniform highp vec3 foo
+ \row
+ \o property variant foo: ShaderEffectSource { SourceItem: bar }
+ \o uniform lowp sampler2D foo
+ \endtable
+ \note
+ The uniform precision definitions in the above table are not strict, it is possible to choose the uniform
+ precision based on what is the most suitable for the shader code for that particular uniform.
+
+
+ The below example uses fragment shader to create simple wiggly effect to a text label.
+ Automatic property binding takes care of binding the properties to the uniforms if their
+ names are identical. ShaderEffectSource referring to textLabel is bound to sampler2D uniform inside the fragment
+ shader code.
+
+ \qml
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ width: 300
+ height: 300
+ color: "black"
+
+ Text {
+ id: textLabel
+ text: "Hello World"
+ anchors.centerIn: parent
+ font.pixelSize: 32
+ color: "white"
+
+ }
+
+ ShaderEffectItem {
+ property variant source: ShaderEffectSource { sourceItem: textLabel; hideSource: true }
+ property real wiggleAmount: 0.005
+ anchors.fill: textLabel
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wiggleAmount;
+ void main(void)
+ {
+ highp vec2 wiggledTexCoord = qt_TexCoord0;
+ wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount;
+ gl_FragColor = texture2D(source, wiggledTexCoord.st);
+ }
+ "
+ }
+}
+ \endqml
+ \image Example1.png
+
+*/
+
+ShaderEffectItem::ShaderEffectItem(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+ , m_meshResolution(1, 1)
+ , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
+ , m_blending(true)
+ , m_program_dirty(true)
+ , m_active(true)
+ , m_respectsMatrix(false)
+ , m_respectsOpacity(false)
+ , m_checkedViewportUpdateMode(false)
+ , m_checkedOpenGL(false)
+ , m_checkedShaderPrograms(false)
+ , m_hasShaderPrograms(false)
+ , m_mirrored(false)
+ , m_defaultVertexShader(true)
+{
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+ connect(this, SIGNAL(visibleChanged()), this, SLOT(handleVisibilityChange()));
+ m_active = isVisible();
+}
+
+ShaderEffectItem::~ShaderEffectItem()
+{
+ reset();
+}
+
+
+/*!
+ \qmlproperty string ShaderEffectItem::fragmentShader
+ This property holds the OpenGL fragment shader code.
+
+ The default fragment shader is following:
+
+ \code
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = texture2D(source, qt_TexCoord0.st);
+ }
+ \endcode
+
+*/
+
+/*!
+ \property ShaderEffectItem::fragmentShader
+ \brief the OpenGL fragment shader code.
+*/
+
+void ShaderEffectItem::setFragmentShader(const QString &code)
+{
+ if (m_fragment_code.constData() == code.constData())
+ return;
+
+ m_fragment_code = code;
+ if (isComponentComplete()) {
+ reset();
+ updateProperties();
+ }
+ emit fragmentShaderChanged();
+}
+
+/*!
+ \qmlproperty string ShaderEffectItem::vertexShader
+ This property holds the OpenGL vertex shader code.
+
+ The default vertex shader is following:
+
+ \code
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ \endcode
+
+*/
+
+/*!
+ \property ShaderEffectItem::vertexShader
+ \brief the OpenGL vertex shader code.
+*/
+
+void ShaderEffectItem::setVertexShader(const QString &code)
+{
+ if (m_vertex_code.constData() == code.constData())
+ return;
+
+ m_vertex_code = code;
+ m_defaultVertexShader = false;
+ if (isComponentComplete()) {
+ reset();
+ updateProperties();
+ }
+ emit vertexShaderChanged();
+}
+
+/*!
+ \qmlproperty bool ShaderEffectItem::blending
+ This property defines whether item is drawn using blending.
+
+ If true, the RGBA pixel output from the fragment shader is blended with
+ the pixel RGBA-values already in the framebuffer.
+
+ If false, fragment shader output is written to framebuffer as such.
+
+ Usually drawing without blending is slightly faster, thus disabling blending
+ might be a good choice when item is used as a background element.
+
+ \note
+ By default the pixel data in textures is stored in 32-bit premultiplied alpha format.
+ This should be taken into account when blending or reading the pixel values
+ in the fragment shader code.
+
+ The default value is true.
+*/
+
+/*!
+ \property ShaderEffectItem::blending
+ \brief the drawing is done using blending.
+*/
+
+void ShaderEffectItem::setBlending(bool enable)
+{
+ if (m_blending == enable)
+ return;
+
+ m_blending = enable;
+ m_changed = true;
+ emit blendingChanged();
+}
+
+
+/*!
+ \qmlproperty QSize ShaderEffectItem::meshResolution
+ This property defines to how many triangles the item is divided into before its
+ vertices are passed to the vertex shader.
+
+ Triangles are defined as triangle strips and the amount of triangles can be controlled
+ separately for x and y-axis.
+
+ The default value is QSize(1,1).
+*/
+
+/*!
+ \property ShaderEffectItem::meshResolution
+ \brief the amount of triangles in the mesh for both x and y-axis.
+*/
+
+void ShaderEffectItem::setMeshResolution(const QSize &size)
+{
+ if (size == m_meshResolution)
+ return;
+
+ m_meshResolution = size;
+ emit meshResolutionChanged();
+ updateGeometry();
+}
+
+void ShaderEffectItem::componentComplete()
+{
+ updateProperties();
+ QDeclarativeItem::componentComplete();
+}
+
+void ShaderEffectItem::checkViewportUpdateMode()
+{
+ if (!m_checkedViewportUpdateMode) {
+ QGraphicsScene *s = scene();
+ if (s){
+ QList<QGraphicsView*> views = s->views();
+ for (int i = 0; i < views.count(); i++) {
+ if (views[i]->viewportUpdateMode() != QGraphicsView::FullViewportUpdate) {
+ qWarning() << "ShaderEffectItem::checkViewportUpdateMode - consider setting QGraphicsView::FullViewportUpdate mode with OpenGL!";
+ }
+ }
+ }
+ m_checkedViewportUpdateMode = true;
+ }
+}
+
+void ShaderEffectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ if (!m_active) return;
+
+ const QGLContext *context = QGLContext::currentContext();
+
+ if (context) {
+ if (!m_checkedShaderPrograms) {
+ m_hasShaderPrograms = QGLShaderProgram::hasOpenGLShaderPrograms(context);
+ m_checkedShaderPrograms = true;
+
+ if (!m_hasShaderPrograms)
+ qWarning() << "ShaderEffectItem::paint - Shader programs are not supported";
+ }
+
+ if ( !m_hasShaderPrograms )
+ return;
+
+ checkViewportUpdateMode();
+ painter->save();
+ painter->beginNativePainting();
+ QMatrix4x4 combinedMatrix = QMatrix4x4(painter->transform());
+ renderEffect(painter, combinedMatrix);
+ painter->endNativePainting();
+ painter->restore();
+ } else {
+ if (!m_checkedOpenGL) {
+ qWarning() << "ShaderEffectItem::paint - OpenGL not available";
+ m_checkedOpenGL = true;
+ }
+ }
+}
+
+void ShaderEffectItem::renderEffect(QPainter *painter, const QMatrix4x4 &matrix)
+{
+ if (!painter || !painter->device())
+ return;
+
+ if (!m_program.isLinked() || m_program_dirty)
+ updateShaderProgram();
+
+ m_program.bind();
+
+ QMatrix4x4 combinedMatrix;
+ combinedMatrix.scale(2.0 / painter->device()->width(), -2.0 / painter->device()->height(), 1.0);
+ combinedMatrix.translate(-painter->device()->width() / 2.0, -painter->device()->height() / 2.0 );
+ combinedMatrix *= matrix;
+ updateEffectState(combinedMatrix);
+
+ for (int i = 0; i < m_attributeNames.size(); ++i) {
+ m_program.enableAttributeArray(m_geometry.attributes()[i].position);
+ }
+
+ bindGeometry();
+
+ // Optimization, disable depth test when we know we don't need it.
+ if (m_defaultVertexShader) {
+ glDepthMask(false);
+ glDisable(GL_DEPTH_TEST);
+ } else {
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_GREATER);
+ glDepthMask(true);
+#if defined(QT_OPENGL_ES)
+ glClearDepthf(0);
+#else
+ glClearDepth(0);
+#endif
+ glClearColor(0, 0, 0, 0);
+ glClear(GL_DEPTH_BUFFER_BIT);
+ }
+
+ if (m_blending){
+ glEnable(GL_BLEND);
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ } else {
+ glDisable(GL_BLEND);
+ }
+
+ if (m_geometry.indexCount())
+ glDrawElements(m_geometry.drawingMode(), m_geometry.indexCount(), m_geometry.indexType(), m_geometry.indexData());
+ else
+ glDrawArrays(m_geometry.drawingMode(), 0, m_geometry.vertexCount());
+
+ glDepthMask(false);
+ glDisable(GL_DEPTH_TEST);
+
+ for (int i = 0; i < m_attributeNames.size(); ++i)
+ m_program.disableAttributeArray(m_geometry.attributes()[i].position);
+}
+
+void ShaderEffectItem::updateEffectState(const QMatrix4x4 &matrix)
+{
+ for (int i = m_sources.size() - 1; i >= 0; --i) {
+ const ShaderEffectItem::SourceData &source = m_sources.at(i);
+ if (!source.source)
+ continue;
+
+ glActiveTexture(GL_TEXTURE0 + i);
+ source.source->bind();
+ }
+
+ if (m_respectsOpacity)
+ m_program.setUniformValue("qt_Opacity", static_cast<float> (effectiveOpacity()));
+
+ if (m_respectsMatrix){
+ m_program.setUniformValue("qt_ModelViewProjectionMatrix", matrix);
+ }
+
+ QSet<QByteArray>::const_iterator it;
+ for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) {
+ const QByteArray &name = *it;
+ QVariant v = property(name.constData());
+
+ switch (v.type()) {
+ case QVariant::Color:
+ m_program.setUniformValue(name.constData(), qvariant_cast<QColor>(v));
+ break;
+ case QVariant::Double:
+ m_program.setUniformValue(name.constData(), (float) qvariant_cast<double>(v));
+ break;
+ case QVariant::Transform:
+ m_program.setUniformValue(name.constData(), qvariant_cast<QTransform>(v));
+ break;
+ case QVariant::Int:
+ m_program.setUniformValue(name.constData(), v.toInt());
+ break;
+ case QVariant::Bool:
+ m_program.setUniformValue(name.constData(), GLint(v.toBool()));
+ break;
+ case QVariant::Size:
+ case QVariant::SizeF:
+ m_program.setUniformValue(name.constData(), v.toSizeF());
+ break;
+ case QVariant::Point:
+ case QVariant::PointF:
+ m_program.setUniformValue(name.constData(), v.toPointF());
+ break;
+ case QVariant::Rect:
+ case QVariant::RectF:
+ {
+ QRectF r = v.toRectF();
+ m_program.setUniformValue(name.constData(), r.x(), r.y(), r.width(), r.height());
+ }
+ break;
+ case QVariant::Vector3D:
+ m_program.setUniformValue(name.constData(), qvariant_cast<QVector3D>(v));
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static inline int size_of_type(GLenum type)
+{
+ static int sizes[] = {
+ sizeof(char),
+ sizeof(unsigned char),
+ sizeof(short),
+ sizeof(unsigned short),
+ sizeof(int),
+ sizeof(unsigned int),
+ sizeof(float),
+ 2,
+ 3,
+ 4,
+ sizeof(double)
+ };
+ return sizes[type - GL_BYTE];
+}
+
+void ShaderEffectItem::bindGeometry()
+{
+ char const *const *attrNames = m_attributeNames.constData();
+ int offset = 0;
+ for (int j = 0; j < m_attributeNames.size(); ++j) {
+ if (!*attrNames[j])
+ continue;
+ Q_ASSERT_X(j < m_geometry.attributeCount(), "ShaderEffectItem::bindGeometry()", "Geometry lacks attribute required by material");
+ const QSGGeometry::Attribute &a = m_geometry.attributes()[j];
+ Q_ASSERT_X(j == a.position, "ShaderEffectItem::bindGeometry()", "Geometry does not have continuous attribute positions");
+#if defined(QT_OPENGL_ES_2)
+ GLboolean normalize = a.type != GL_FLOAT;
+#else
+ GLboolean normalize = a.type != GL_FLOAT && a.type != GL_DOUBLE;
+#endif
+ if (normalize)
+ qWarning() << "ShaderEffectItem::bindGeometry() - non supported attribute type!";
+
+ m_program.setAttributeArray(a.position, (GLfloat*) (((char*) m_geometry.vertexData()) + offset), a.tupleSize, m_geometry.stride());
+ //glVertexAttribPointer(a.position, a.tupleSize, a.type, normalize, m_geometry.stride(), (char *) m_geometry.vertexData() + offset);
+ offset += a.tupleSize * size_of_type(a.type);
+ }
+}
+
+void ShaderEffectItem::updateGeometry()
+{
+ QRectF srcRect(0, 1, 1, -1);
+
+ if (m_mirrored)
+ srcRect = QRectF(0, 0, 1, 1);
+
+ QRectF dstRect = QRectF(0,0, width(), height());
+
+ int vmesh = m_meshResolution.height();
+ int hmesh = m_meshResolution.width();
+
+ QSGGeometry *g = &m_geometry;
+ if (vmesh == 1 && hmesh == 1) {
+ if (g->vertexCount() != 4)
+ g->allocate(4);
+ QSGGeometry::updateTexturedRectGeometry(g, dstRect, srcRect);
+ return;
+ }
+
+ g->allocate((vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2));
+
+ QSGGeometry::TexturedPoint2D *vdata = g->vertexDataAsTexturedPoint2D();
+
+ for (int iy = 0; iy <= vmesh; ++iy) {
+ float fy = iy / float(vmesh);
+ float y = float(dstRect.top()) + fy * float(dstRect.height());
+ float ty = float(srcRect.top()) + fy * float(srcRect.height());
+ for (int ix = 0; ix <= hmesh; ++ix) {
+ float fx = ix / float(hmesh);
+ vdata->x = float(dstRect.left()) + fx * float(dstRect.width());
+ vdata->y = y;
+ vdata->tx = float(srcRect.left()) + fx * float(srcRect.width());
+ vdata->ty = ty;
+ ++vdata;
+ }
+ }
+
+ quint16 *indices = (quint16 *)g->indexDataAsUShort();
+ int i = 0;
+ for (int iy = 0; iy < vmesh; ++iy) {
+ *(indices++) = i + hmesh + 1;
+ for (int ix = 0; ix <= hmesh; ++ix, ++i) {
+ *(indices++) = i + hmesh + 1;
+ *(indices++) = i;
+ }
+ *(indices++) = i - 1;
+ }
+}
+
+void ShaderEffectItem::setActive(bool enable)
+{
+ if (m_active == enable)
+ return;
+
+ if (m_active) {
+ for (int i = 0; i < m_sources.size(); ++i) {
+ ShaderEffectSource *source = m_sources.at(i).source;
+ if (!source)
+ continue;
+ disconnect(source, SIGNAL(repaintRequired()), this, SLOT(markDirty()));
+ source->derefFromEffectItem();
+ }
+ }
+
+ m_active = enable;
+
+ if (m_active) {
+ for (int i = 0; i < m_sources.size(); ++i) {
+ ShaderEffectSource *source = m_sources.at(i).source;
+ if (!source)
+ continue;
+ source->refFromEffectItem();
+ connect(source, SIGNAL(repaintRequired()), this, SLOT(markDirty()));
+ }
+ }
+
+ emit activeChanged();
+ markDirty();
+}
+
+void ShaderEffectItem::preprocess()
+{
+ for (int i = 0; i < m_sources.size(); ++i) {
+ ShaderEffectSource *source = m_sources.at(i).source;
+ if (source)
+ source->updateBackbuffer();
+ }
+}
+
+void ShaderEffectItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ if (newGeometry.size() != oldGeometry.size())
+ updateGeometry();
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+void ShaderEffectItem::changeSource(int index)
+{
+ Q_ASSERT(index >= 0 && index < m_sources.size());
+ QVariant v = property(m_sources.at(index).name.constData());
+ setSource(v, index);
+}
+
+void ShaderEffectItem::markDirty() {
+ update();
+}
+
+void ShaderEffectItem::setSource(const QVariant &var, int index)
+{
+ Q_ASSERT(index >= 0 && index < m_sources.size());
+
+ SourceData &source = m_sources[index];
+
+ source.source = 0;
+ source.item = 0;
+ if (var.isNull()) {
+ return;
+ } else if (!qVariantCanConvert<QObject *>(var)) {
+ qWarning("Could not assign source of type '%s' to property '%s'.", var.typeName(), source.name.constData());
+ return;
+ }
+
+ QObject *obj = qVariantValue<QObject *>(var);
+
+ source.source = qobject_cast<ShaderEffectSource *>(obj);
+ source.item = qobject_cast<QDeclarativeItem *>(obj);
+
+ if (!source.item)
+ qWarning("Could not assign property '%s', did not implement QDeclarativeItem.", source.name.constData());
+
+ if (!source.source)
+ qWarning("Could not assign property '%s', did not implement ShaderEffectSource.", source.name.constData());
+
+ // TODO: Find better solution.
+ // 'source.item' needs a canvas to get a scenegraph node.
+ // The easiest way to make sure it gets a canvas is to
+ // make it a part of the same item tree as 'this'.
+ if (source.item && source.item->parentItem() == 0) {
+ source.item->setParentItem(this);
+ // Unlike in scenegraph, we cannot set item invisible here because qgraphicsview would optimize it away.
+ }
+
+ // Unlike in scenegraph, ref counting is used to optimize memory consumption. Sources themself may free fbos when not referenced.
+ if (m_active && source.source) {
+ source.source->refFromEffectItem();
+ connect(source.source, SIGNAL(repaintRequired()), this, SLOT(markDirty()));
+ }
+}
+
+void ShaderEffectItem::disconnectPropertySignals()
+{
+ disconnect(this, 0, this, SLOT(markDirty()));
+ for (int i = 0; i < m_sources.size(); ++i) {
+ SourceData &source = m_sources[i];
+ disconnect(this, 0, source.mapper, 0);
+ disconnect(source.mapper, 0, this, 0);
+ }
+}
+
+void ShaderEffectItem::connectPropertySignals()
+{
+ QSet<QByteArray>::const_iterator it;
+ for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) {
+ int pi = metaObject()->indexOfProperty(it->constData());
+ if (pi >= 0) {
+ QMetaProperty mp = metaObject()->property(pi);
+ if (!mp.hasNotifySignal())
+ qWarning("ShaderEffectItem: property '%s' does not have notification method!", it->constData());
+ QByteArray signalName("2");
+ signalName.append(mp.notifySignal().signature());
+ connect(this, signalName, this, SLOT(markDirty()));
+ } else {
+ qWarning("ShaderEffectItem: '%s' does not have a matching property!", it->constData());
+ }
+ }
+ for (int i = 0; i < m_sources.size(); ++i) {
+ SourceData &source = m_sources[i];
+ int pi = metaObject()->indexOfProperty(source.name.constData());
+ if (pi >= 0) {
+ QMetaProperty mp = metaObject()->property(pi);
+ QByteArray signalName("2");
+ signalName.append(mp.notifySignal().signature());
+ connect(this, signalName, source.mapper, SLOT(map()));
+ source.mapper->setMapping(this, i);
+ connect(source.mapper, SIGNAL(mapped(int)), this, SLOT(changeSource(int)));
+ } else {
+ qWarning("ShaderEffectItem: '%s' does not have a matching source!", source.name.constData());
+ }
+ }
+}
+
+void ShaderEffectItem::reset()
+{
+ disconnectPropertySignals();
+
+ m_program.removeAllShaders();
+ m_attributeNames.clear();
+ m_uniformNames.clear();
+ for (int i = 0; i < m_sources.size(); ++i) {
+ const SourceData &source = m_sources.at(i);
+ if (m_active && source.source)
+ source.source->derefFromEffectItem();
+ delete source.mapper;
+ }
+
+ m_sources.clear();
+ m_program_dirty = true;
+}
+
+void ShaderEffectItem::updateProperties()
+{
+ QString vertexCode = m_vertex_code;
+ QString fragmentCode = m_fragment_code;
+
+ if (vertexCode.isEmpty())
+ vertexCode = qt_default_vertex_code;
+
+ if (fragmentCode.isEmpty())
+ fragmentCode = qt_default_fragment_code;
+
+ lookThroughShaderCode(vertexCode);
+ lookThroughShaderCode(fragmentCode);
+
+ if (!m_attributeNames.contains(qt_postion_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'%s\'.", qt_postion_attribute_name);
+ if (!m_attributeNames.contains(qt_texcoord_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'%s\'.", qt_texcoord_attribute_name);
+ if (!m_respectsMatrix)
+ qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'.");
+
+ for (int i = 0; i < m_sources.size(); ++i) {
+ QVariant v = property(m_sources.at(i).name);
+ setSource(v, i); // Property exists.
+ }
+
+ connectPropertySignals();
+}
+
+void ShaderEffectItem::updateShaderProgram()
+{
+ QString vertexCode = m_vertex_code;
+ QString fragmentCode = m_fragment_code;
+
+ if (vertexCode.isEmpty())
+ vertexCode = QString::fromLatin1(qt_default_vertex_code);
+
+ if (fragmentCode.isEmpty())
+ fragmentCode = QString::fromLatin1(qt_default_fragment_code);
+
+ m_program.addShaderFromSourceCode(QGLShader::Vertex, vertexCode);
+ m_program.addShaderFromSourceCode(QGLShader::Fragment, fragmentCode);
+
+ for (int i = 0; i < m_attributeNames.size(); ++i) {
+ m_program.bindAttributeLocation(m_attributeNames.at(i), m_geometry.attributes()[i].position);
+ }
+
+ if (!m_program.link()) {
+ qWarning("ShaderEffectItem: Shader compilation failed:");
+ qWarning() << m_program.log();
+ }
+
+ if (!m_attributeNames.contains(qt_postion_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'qt_Vertex\'.");
+ if (!m_attributeNames.contains(qt_texcoord_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'qt_MultiTexCoord0\'.");
+ if (!m_respectsMatrix)
+ qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'.");
+
+ if (m_program.isLinked()) {
+ m_program.bind();
+ for (int i = 0; i < m_sources.size(); ++i)
+ m_program.setUniformValue(m_sources.at(i).name.constData(), i);
+ }
+
+ m_program_dirty = false;
+}
+
+void ShaderEffectItem::lookThroughShaderCode(const QString &code)
+{
+ // Regexp for matching attributes and uniforms.
+ // In human readable form: attribute|uniform [lowp|mediump|highp] <type> <name>
+ static QRegExp re(QLatin1String("\\b(attribute|uniform)\\b\\s*\\b(?:lowp|mediump|highp)?\\b\\s*\\b(\\w+)\\b\\s*\\b(\\w+)"));
+ Q_ASSERT(re.isValid());
+
+ int pos = -1;
+
+ //QString wideCode = QString::fromLatin1(code.constData(), code.size());
+ QString wideCode = code;
+
+ while ((pos = re.indexIn(wideCode, pos + 1)) != -1) {
+ QByteArray decl = re.cap(1).toLatin1(); // uniform or attribute
+ QByteArray type = re.cap(2).toLatin1(); // type
+ QByteArray name = re.cap(3).toLatin1(); // variable name
+
+ if (decl == "attribute") {
+ if (name == qt_postion_attribute_name) {
+ m_attributeNames.insert(0, qt_postion_attribute_name);
+ } else if (name == "qt_MultiTexCoord0") {
+ if (m_attributeNames.at(0) == 0) {
+ m_attributeNames.insert(0, qt_emptyAttributeName);
+ }
+ m_attributeNames.insert(1, qt_texcoord_attribute_name);
+ } else {
+ // TODO: Support user defined attributes.
+ qWarning("ShaderEffectItem: Attribute \'%s\' not recognized.", name.constData());
+ }
+ } else {
+ Q_ASSERT(decl == "uniform");
+
+ if (name == "qt_ModelViewProjectionMatrix") {
+ m_respectsMatrix = true;
+ } else if (name == "qt_Opacity") {
+ m_respectsOpacity = true;
+ } else {
+ m_uniformNames.insert(name);
+ if (type == "sampler2D") {
+ SourceData d;
+ d.mapper = new QSignalMapper;
+ d.source = 0;
+ d.name = name;
+ d.item = 0;
+ m_sources.append(d);
+ }
+ }
+ }
+ }
+}
+
+void ShaderEffectItem::handleVisibilityChange()
+{
+ setActive(isVisible());
+}
diff --git a/src/imports/shaders/shadereffectitem.h b/src/imports/shaders/shadereffectitem.h
new file mode 100644
index 0000000000..1d275439f2
--- /dev/null
+++ b/src/imports/shaders/shadereffectitem.h
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 SHADEREFFECTITEM_H
+#define SHADEREFFECTITEM_H
+
+#include <QDeclarativeItem>
+#include <QtOpenGL>
+#include "shadereffectsource.h"
+#include "scenegraph/qsggeometry.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectItem : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_PROPERTY(QString fragmentShader READ fragmentShader WRITE setFragmentShader NOTIFY fragmentShaderChanged)
+ Q_PROPERTY(QString vertexShader READ vertexShader WRITE setVertexShader NOTIFY vertexShaderChanged)
+ Q_PROPERTY(bool blending READ blending WRITE setBlending NOTIFY blendingChanged)
+ Q_PROPERTY(QSize meshResolution READ meshResolution WRITE setMeshResolution NOTIFY meshResolutionChanged)
+
+public:
+ ShaderEffectItem(QDeclarativeItem* parent = 0);
+ ~ShaderEffectItem();
+
+ virtual void componentComplete();
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+ QString fragmentShader() const { return m_fragment_code; }
+ void setFragmentShader(const QString &code);
+
+ QString vertexShader() const { return m_vertex_code; }
+ void setVertexShader(const QString &code);
+
+ bool blending() const { return m_blending; }
+ void setBlending(bool enable);
+
+ QSize meshResolution() const { return m_meshResolution; }
+ void setMeshResolution(const QSize &size);
+
+ void preprocess();
+
+Q_SIGNALS:
+ void fragmentShaderChanged();
+ void vertexShaderChanged();
+ void blendingChanged();
+ void activeChanged();
+ void meshResolutionChanged();
+
+protected:
+ virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
+
+private Q_SLOTS:
+ void changeSource(int index);
+ void handleVisibilityChange();
+ void markDirty();
+
+private:
+ void checkViewportUpdateMode();
+ void renderEffect(QPainter *painter, const QMatrix4x4 &matrix);
+ void updateEffectState(const QMatrix4x4 &matrix);
+ void updateGeometry();
+ void bindGeometry();
+ void setSource(const QVariant &var, int index);
+ void disconnectPropertySignals();
+ void connectPropertySignals();
+ void reset();
+ void updateProperties();
+ void updateShaderProgram();
+ void lookThroughShaderCode(const QString &code);
+ bool active() const { return m_active; }
+ void setActive(bool enable);
+
+private:
+ QString m_fragment_code;
+ QString m_vertex_code;
+ QGLShaderProgram m_program;
+ QVector<const char *> m_attributeNames;
+ QSet<QByteArray> m_uniformNames;
+ QSize m_meshResolution;
+ QSGGeometry m_geometry;
+
+ struct SourceData
+ {
+ QSignalMapper *mapper;
+ QPointer<ShaderEffectSource> source;
+ QPointer<QDeclarativeItem> item;
+ QByteArray name;
+ };
+
+ QVector<SourceData> m_sources;
+
+ bool m_changed : 1;
+ bool m_blending : 1;
+ bool m_program_dirty : 1;
+ bool m_active : 1;
+ bool m_respectsMatrix : 1;
+ bool m_respectsOpacity : 1;
+ bool m_checkedViewportUpdateMode : 1;
+ bool m_checkedOpenGL : 1;
+ bool m_checkedShaderPrograms : 1;
+ bool m_hasShaderPrograms : 1;
+ bool m_mirrored : 1;
+ bool m_defaultVertexShader : 1;
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+#endif // SHADEREFFECTITEM_H
diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp
new file mode 100644
index 0000000000..dec3bb040e
--- /dev/null
+++ b/src/imports/shaders/shadereffectsource.cpp
@@ -0,0 +1,472 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 "shadereffectsource.h"
+#include "shadereffectbuffer.h"
+#include "shadereffect.h"
+#include "glfunctions.h"
+
+#include <QtOpenGL>
+
+/*!
+ \qmlclass ShaderEffectSource ShaderEffectSource
+ \ingroup qmlshadersplugin
+ \brief The ShaderEffectSource object encapsulates the source content for the ShaderEffectItem.
+
+ ShaderEffectSource is available in the \bold{Qt.labs.shaders 1.0} module.
+ \e {Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.}
+
+ This element provides preliminary support for OpenGL shaders in QML,
+ and may be heavily changed or removed in later versions.
+
+ Requirement for the ability to use of shaders is that the application is either using
+ opengl graphicssystem or has set QGLWidget as the viewport to QDeclarativeView (recommended way).
+
+ ShaderEffectSource object encapsulates the source content so that it can be utilized in ShaderEffectItem.
+ Source content can be a live QML object tree, or a snapshot of QML object tree.
+
+*/
+
+ShaderEffectSource::ShaderEffectSource(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+ , m_sourceItem(0)
+ , m_wrapMode(ClampToEdge)
+ , m_sourceRect(0, 0, 0, 0)
+ , m_textureSize(0, 0)
+ , m_format(RGBA)
+ , m_size(0, 0)
+ , m_fbo(0)
+ , m_multisampledFbo(0)
+ , m_refs(0)
+ , m_dirtyTexture(true)
+ , m_dirtySceneGraph(true)
+ , m_multisamplingSupported(false)
+ , m_checkedForMultisamplingSupport(false)
+ , m_live(true)
+ , m_hideSource(false)
+ , m_mirrored(false)
+{
+}
+
+ShaderEffectSource::~ShaderEffectSource()
+{
+ if (m_refs && m_sourceItem)
+ detachSourceItem();
+
+ delete m_fbo;
+ delete m_multisampledFbo;
+}
+
+/*!
+ \qmlproperty Item ShaderEffectSource::sourceItem
+ This property holds the Item which is used as the source for the shader effect.
+ If the item has children, those are included as well.
+
+ \note When source item content is passed to the ShaderEffectItem(s), it is always clipped to the boundingrect of the
+ sourceItem regardless of its clipping property.
+*/
+
+/*!
+ \property ShaderEffectSource::sourceItem
+ \brief the Item which is the source for the effect.
+*/
+
+void ShaderEffectSource::setSourceItem(QDeclarativeItem *item)
+{
+ if (item == m_sourceItem)
+ return;
+
+ if (m_sourceItem) {
+ disconnect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty()));
+ disconnect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty()));
+
+ if (m_refs)
+ detachSourceItem();
+ }
+
+ m_sourceItem = item;
+
+ if (m_sourceItem) {
+
+ // Must have some item as parent
+ if (m_sourceItem->parentItem() == 0)
+ m_sourceItem->setParentItem(this);
+
+ if (m_refs)
+ attachSourceItem();
+
+ connect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty()));
+ connect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty()));
+ }
+
+ updateSizeAndTexture();
+ emit sourceItemChanged();
+ emit repaintRequired();
+}
+
+/*!
+ \qmlproperty QRectF ShaderEffectSource::sourceRect
+ This property can be used to specify margins for the source content.
+
+ If other value than Qt.rect(0,0,0,0) is assigned to this property, it is interpreted as
+ specifying a relative source rectangle for the source content.
+
+ For example, setting Qt.rect(-10.0, -10.0, 120.0, 120.0) for a source that has width and height
+ of 100 pixels would produce 10 pixels margins to each side of the source.
+
+ Margins are useful when the original content is wanted to be spread outside the original source area,
+ like when creating a dropshadow with the shader or in other similar effects.
+
+ The default value is Qt.rect(0,0,0,0).
+*/
+
+/*!
+ \property ShaderEffectSource::sourceRect
+ \brief the relative sourceRect for the source.
+*/
+
+void ShaderEffectSource::setSourceRect(const QRectF &rect)
+{
+ if (rect == m_sourceRect)
+ return;
+ m_sourceRect = rect;
+ updateSizeAndTexture();
+ updateBackbuffer();
+ emit sourceRectChanged();
+ emit repaintRequired();
+
+ if (m_sourceItem) {
+ ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+ if (effect)
+ effect->m_changed = true;
+ }
+}
+
+/*!
+ \qmlproperty QSize ShaderEffectSource::textureSize
+ This property holds the size for the texture containing the source content.
+
+ If value QSize(0,0) is assigned to this property, texture is resized
+ according to the source size. Otherwise source content is scaled to
+ the given size.
+
+ The default value is QSize(0,0).
+*/
+
+/*!
+ \property ShaderEffectSource::textureSize
+ \brief the texture size for the source.
+*/
+
+void ShaderEffectSource::setTextureSize(const QSize &size)
+{
+ if (size == m_textureSize)
+ return;
+
+ m_textureSize = size;
+ updateSizeAndTexture();
+ emit textureSizeChanged();
+ emit repaintRequired();
+
+ if (m_sourceItem) {
+ ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+ if (effect)
+ effect->m_changed = true;
+ }
+}
+
+/*!
+ \qmlproperty bool ShaderEffectSource::live
+ This property holds the optimization flag to define whether the source item content is changing or
+ static.
+
+ If value true is assigned to this property, source item content is re-rendered into a
+ texture for every frame. Setting the value to false improves the performance as it skips
+ rendering the source item (and its chidleren) and instead immediately passes the previously
+ rendered and cached texture to the shaders.
+
+ The default value is true.
+*/
+
+/*!
+ \property ShaderEffectSource::live
+ \brief the flag tells whether source item content is changing between frames.
+*/
+
+void ShaderEffectSource::setLive(bool s)
+{
+ if (s == m_live)
+ return;
+
+ m_live = s;
+
+ emit liveChanged();
+ emit repaintRequired();
+}
+
+/*!
+ \qmlproperty bool ShaderEffectSource::hideSource
+ This property holds the flag to define whether the original source item is
+ hidden when the effect item is drawn.
+
+ The default value is false.
+*/
+
+/*!
+ \property ShaderEffectSource::hideSource
+ \brief the flag tells whether original source item content should be hidden.
+*/
+
+void ShaderEffectSource::setHideSource(bool hide)
+{
+ if (hide == m_hideSource)
+ return;
+
+ m_hideSource = hide;
+
+ emit hideSourceChanged();
+ emit repaintRequired();
+}
+
+/*!
+ \qmlproperty enumeration ShaderEffectSource::wrapMode
+
+ This property defines the wrap parameter for the source after it has been mapped as a texture.
+
+ \list
+ \o WrapMode.ClampToEdge - Causes texturecoordinates to be clamped to the range [ 1/2*N , 1 - 1/2*N ], where N is the texture width.
+ \o WrapMode.RepeatHorizontally - Causes the integer part of the horizontal texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a horizontal repeating pattern.
+ \o WrapMode.RepeatVertically - Causes the integer part of the vertical texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a vertical repeating pattern.
+ \o WrapMode.Repeat - Causes the integer part of both the horizontal and vertical texturecoordinates to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern.
+ \endlist
+
+ The default value is ClampToEdge.
+
+*/
+
+/*!
+ \property ShaderEffectSource::wrapMode
+ \brief the wrap parameter for the source after it has been mapped as a texture.
+*/
+
+void ShaderEffectSource::setWrapMode(WrapMode mode)
+{
+ if (mode == m_wrapMode)
+ return;
+
+ m_wrapMode = mode;
+ updateBackbuffer();
+ emit wrapModeChanged();
+}
+
+/*!
+ \qmlmethod ShaderEffectSource::grab()
+
+ Repaints the source item content into the texture.
+
+ This method is useful when ShaderEffectSource::live has been set to false and
+ the changes in the source item content is desired to be made visible for the shaders.
+
+*/
+
+void ShaderEffectSource::grab()
+{
+ m_dirtyTexture = true;
+ emit repaintRequired();
+}
+
+void ShaderEffectSource::bind() const
+{
+ GLint filtering = smooth() ? GL_LINEAR : GL_NEAREST;
+ GLuint hwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatHorizontally) ? GL_REPEAT : GL_CLAMP_TO_EDGE;
+ GLuint vwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatVertically) ? GL_REPEAT : GL_CLAMP_TO_EDGE;
+
+#if !defined(QT_OPENGL_ES_2)
+ glEnable(GL_TEXTURE_2D);
+#endif
+ if (m_fbo) {
+ glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
+ } else {
+ glBindTexture(GL_TEXTURE_2D, 0);
+ }
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, smooth() ? GL_LINEAR : GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, hwrap);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, vwrap);
+}
+
+void ShaderEffectSource::refFromEffectItem()
+{
+ if (m_refs++ == 0) {
+ attachSourceItem();
+ emit activeChanged();
+ }
+}
+
+void ShaderEffectSource::derefFromEffectItem()
+{
+ if (--m_refs == 0) {
+ detachSourceItem();
+ emit activeChanged();
+ }
+ Q_ASSERT(m_refs >= 0);
+}
+
+void ShaderEffectSource::updateBackbuffer()
+{
+ if (!m_sourceItem)
+ return;
+
+ // Multisampling is not (for now) supported.
+ QSize size = QSize(m_sourceItem->width(), m_sourceItem->height());
+ if (!m_textureSize.isEmpty())
+ size = m_textureSize;
+
+ if (size.height() > 0 && size.width() > 0) {
+ QGLFramebufferObjectFormat format;
+ format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ format.setInternalTextureFormat(m_format);
+
+ if (!m_fbo) {
+ m_fbo = new ShaderEffectBuffer(size, format);
+ } else {
+ if (m_fbo->size() != size || m_fbo->format().internalTextureFormat() != GLenum(m_format)) {
+ delete m_fbo;
+ m_fbo = 0;
+ m_fbo = new ShaderEffectBuffer(size, format);
+ }
+ }
+ }
+
+ // Note that real update for the source content happens in shadereffect.cpp
+ m_dirtyTexture = false;
+}
+
+void ShaderEffectSource::markSceneGraphDirty()
+{
+ m_dirtySceneGraph = true;
+ emit repaintRequired();
+}
+
+void ShaderEffectSource::markSourceSizeDirty()
+{
+ Q_ASSERT(m_sourceItem);
+ if (m_textureSize.isEmpty())
+ updateSizeAndTexture();
+ if (m_refs)
+ emit repaintRequired();
+}
+
+void ShaderEffectSource::updateSizeAndTexture()
+{
+ if (m_sourceItem) {
+ QSize size = m_textureSize;
+ if (size.isEmpty())
+ size = QSize(m_sourceItem->width(), m_sourceItem->height());
+ if (size.width() < 1)
+ size.setWidth(1);
+ if (size.height() < 1)
+ size.setHeight(1);
+ if (m_fbo && m_fbo->size() != size) {
+ delete m_fbo;
+ m_fbo = 0;
+ delete m_multisampledFbo;
+ m_fbo = m_multisampledFbo = 0;
+ }
+ if (m_size.width() != size.width()) {
+ m_size.setWidth(size.width());
+ emit widthChanged();
+ }
+ if (m_size.height() != size.height()) {
+ m_size.setHeight(size.height());
+ emit heightChanged();
+ }
+ m_dirtyTexture = true;
+ } else {
+ if (m_size.width() != 0) {
+ m_size.setWidth(0);
+ emit widthChanged();
+ }
+ if (m_size.height() != 0) {
+ m_size.setHeight(0);
+ emit heightChanged();
+ }
+ }
+}
+
+void ShaderEffectSource::attachSourceItem()
+{
+ if (!m_sourceItem)
+ return;
+
+ ShaderEffect *effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+
+ if (!effect) {
+ effect = new ShaderEffect();
+ m_sourceItem->setGraphicsEffect(effect);
+ }
+
+ if (effect)
+ effect->addRenderTarget(this);
+
+ m_sourceItem->update();
+}
+
+void ShaderEffectSource::detachSourceItem()
+{
+ if (!m_sourceItem)
+ return;
+
+ ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+
+ if (effect)
+ effect->removeRenderTarget(this);
+
+ delete m_fbo;
+ m_fbo = 0;
+
+ delete m_multisampledFbo;
+ m_multisampledFbo = 0;
+
+ m_dirtyTexture = true;
+}
diff --git a/src/imports/shaders/shadereffectsource.h b/src/imports/shaders/shadereffectsource.h
new file mode 100644
index 0000000000..275e5b2030
--- /dev/null
+++ b/src/imports/shaders/shadereffectsource.h
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 SHADEREFFECTSOURCE_H
+#define SHADEREFFECTSOURCE_H
+
+#include <QDeclarativeItem>
+#include <QtOpenGL>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectBuffer;
+
+class ShaderEffectSource : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeItem *sourceItem READ sourceItem WRITE setSourceItem NOTIFY sourceItemChanged)
+ Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged)
+ Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged)
+ Q_PROPERTY(bool live READ isLive WRITE setLive NOTIFY liveChanged)
+ Q_PROPERTY(bool hideSource READ hideSource WRITE setHideSource NOTIFY hideSourceChanged)
+ Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
+ Q_ENUMS(WrapMode)
+ Q_ENUMS(Format)
+
+public:
+ enum WrapMode {
+ ClampToEdge,
+ RepeatHorizontally,
+ RepeatVertically,
+ Repeat
+ };
+
+ enum Format {
+ Alpha = GL_ALPHA,
+ RGB = GL_RGB,
+ RGBA = GL_RGBA
+ };
+
+ ShaderEffectSource(QDeclarativeItem *parent = 0);
+ virtual ~ShaderEffectSource();
+
+ QDeclarativeItem *sourceItem() const { return m_sourceItem.data(); }
+ void setSourceItem(QDeclarativeItem *item);
+
+ QRectF sourceRect() const { return m_sourceRect; };
+ void setSourceRect(const QRectF &rect);
+
+ QSize textureSize() const { return m_textureSize; }
+ void setTextureSize(const QSize &size);
+
+ bool isLive() const { return m_live; }
+ void setLive(bool s);
+
+ bool hideSource() const { return m_hideSource; }
+ void setHideSource(bool hide);
+
+ WrapMode wrapMode() const { return m_wrapMode; };
+ void setWrapMode(WrapMode mode);
+
+ bool isActive() const { return m_refs; }
+ void bind() const;
+ void refFromEffectItem();
+ void derefFromEffectItem();
+ void updateBackbuffer();
+
+ ShaderEffectBuffer* fbo() { return m_fbo; }
+ bool isDirtyTexture() { return m_dirtyTexture; }
+ bool isMirrored() { return m_mirrored; }
+
+ Q_INVOKABLE void grab();
+
+Q_SIGNALS:
+ void sourceItemChanged();
+ void sourceRectChanged();
+ void textureSizeChanged();
+ void formatChanged();
+ void liveChanged();
+ void hideSourceChanged();
+ void activeChanged();
+ void repaintRequired();
+ void wrapModeChanged();
+
+public Q_SLOTS:
+ void markSceneGraphDirty();
+ void markSourceSizeDirty();
+
+private:
+ void updateSizeAndTexture();
+ void attachSourceItem();
+ void detachSourceItem();
+
+private:
+ QPointer<QDeclarativeItem> m_sourceItem;
+ WrapMode m_wrapMode;
+ QRectF m_sourceRect;
+ QSize m_textureSize;
+ Format m_format;
+ QSize m_size;
+
+ ShaderEffectBuffer *m_fbo;
+ ShaderEffectBuffer *m_multisampledFbo;
+ int m_refs;
+ bool m_dirtyTexture : 1;
+ bool m_dirtySceneGraph : 1;
+ bool m_multisamplingSupported : 1;
+ bool m_checkedForMultisamplingSupport : 1;
+ bool m_live : 1;
+ bool m_hideSource : 1;
+ bool m_mirrored : 1;
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+
+#endif // SHADEREFFECTSOURCE_H
diff --git a/src/imports/shaders/shaders.pro b/src/imports/shaders/shaders.pro
new file mode 100644
index 0000000000..d7a6275af5
--- /dev/null
+++ b/src/imports/shaders/shaders.pro
@@ -0,0 +1,38 @@
+TARGET = qmlshadersplugin
+TARGETPATH = Qt/labs/shaders
+include(../qimportbase.pri)
+
+QT += declarative opengl
+
+SOURCES += \
+ qmlshadersplugin_plugin.cpp \
+ shadereffect.cpp \
+ shadereffectitem.cpp \
+ shadereffectsource.cpp \
+ scenegraph/qsggeometry.cpp \
+ shadereffectbuffer.cpp
+
+HEADERS += \
+ qmlshadersplugin_plugin.h \
+ glfunctions.h \
+ shadereffect.h \
+ shadereffectitem.h \
+ shadereffectsource.h \
+ scenegraph/qsggeometry.h \
+ shadereffectbuffer.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+qmldir.files += $$PWD/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+symbian:{
+ TARGET.UID3 = 0x20034907
+ isEmpty(DESTDIR):importFiles.sources = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
+ else:importFiles.sources = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
+ importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
+ DEPLOYMENT = importFiles
+}
+
+INSTALLS += target qmldir
diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp
index 80ec7231d0..75456581f8 100644
--- a/src/network/access/qhttpmultipart.cpp
+++ b/src/network/access/qhttpmultipart.cpp
@@ -256,7 +256,7 @@ void QHttpPart::setBodyDevice(QIODevice *device)
/*!
Constructs a QHttpMultiPart with content type MixedType and sets
- parent as the parent object.
+ \a parent as the parent object.
\sa QHttpMultiPart::ContentType
*/
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index f64fcb641b..8fc8eb768d 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -301,6 +301,10 @@ static void ensureInitialized()
again, without emitting the authenticationRequired() signal. If it
rejects the credentials, this signal will be emitted again.
+ \note It is not possible to use a QueuedConnection to connect to
+ this signal, as the connection will fail if the authenticator has
+ not been filled in with new information when the signal returns.
+
\sa proxyAuthenticationRequired()
*/
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 2791eed766..666aba7e82 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -128,7 +128,7 @@ QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
\fn void QNetworkConfigurationManager::configurationRemoved(const QNetworkConfiguration &config)
This signal is emitted when a configuration is about to be removed from the system. The removed
- \a configuration is invalid but retains name and identifier.
+ configuration, specified by \a config, is invalid but retains name and identifier.
*/
/*!
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 54cd898c67..d468bc4cfd 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -385,6 +385,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
+
+ QMetaObject::invokeMethod(engine, "initialize");
}
}
@@ -408,19 +410,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
startPolling();
}
- if (firstUpdate) {
+ if (firstUpdate)
firstUpdate = false;
- QList<QBearerEngine*> enginesToInitialize = sessionEngines; //shallow copy the list in case it is modified when we unlock mutex
- Qt::ConnectionType connectionType;
- if (QCoreApplicationPrivate::mainThread() == QThread::currentThread())
- connectionType = Qt::DirectConnection;
- else
- connectionType = Qt::BlockingQueuedConnection;
- locker.unlock();
- foreach (QBearerEngine* engine, enginesToInitialize) {
- QMetaObject::invokeMethod(engine, "initialize", connectionType);
- }
- }
}
void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index bb98305173..e5d33bb8c8 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -26,7 +26,7 @@ win32:SOURCES += kernel/qhostinfo_win.cpp kernel/qnetworkinterface_win.cpp
integrity:SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation
-mac:SOURCES += kernel/qnetworkproxy_mac.cpp
+mac:contains(QT_CONFIG, coreservices) SOURCES += kernel/qnetworkproxy_mac.cpp
else:win32:SOURCES += kernel/qnetworkproxy_win.cpp
else:symbian:SOURCES += kernel/qnetworkproxy_symbian.cpp
else:SOURCES += kernel/qnetworkproxy_generic.cpp
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 5f5db17072..5c672ec227 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -149,6 +149,8 @@ bool QHttpSocketEngine::connectInternal()
// Handshake isn't done. If unconnected, start connecting.
if (d->state == None && d->socket->state() == QAbstractSocket::UnconnectedState) {
setState(QAbstractSocket::ConnectingState);
+ //limit buffer in internal socket, data is buffered in the external socket under application control
+ d->socket->setReadBufferSize(65536);
d->socket->connectToHost(d->proxy.hostName(), d->proxy.port());
}
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index 575c0bc73e..ab757987f6 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -1126,6 +1126,8 @@ bool QSocks5SocketEngine::connectInternal()
if (d->socks5State == QSocks5SocketEnginePrivate::Uninitialized
&& d->socketState != QAbstractSocket::ConnectingState) {
setState(QAbstractSocket::ConnectingState);
+ //limit buffer in internal socket, data is buffered in the external socket under application control
+ d->data->controlSocket->setReadBufferSize(65536);
d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port());
return false;
}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index b659289c3e..df61fb6c18 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -675,8 +675,8 @@ QString QSslSocket::peerVerifyName() const
/*!
\since 4.8
- Sets a different hostname for the certificate validation instead of the one used for the TCP
- connection.
+ Sets a different host name, given by \a hostName, for the certificate
+ validation instead of the one used for the TCP connection.
\sa connectToHostEncrypted()
*/
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index fb41b7c9e9..4747f29c8d 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -68,7 +68,7 @@
#endif
QT_BEGIN_NAMESPACE
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
#define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file
PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0;
PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0;
@@ -532,7 +532,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
resetDefaultCiphers();
//load symbols needed to receive certificates from system store
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security");
if (securityLib.load()) {
ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData");
@@ -813,7 +813,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
timer.start();
#endif
QList<QSslCertificate> systemCerts;
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
CFArrayRef cfCerts;
OSStatus status = 1;
@@ -1338,9 +1338,9 @@ bool QSslSocketBackendPrivate::startHandshake()
sslErrors.clear();
}
- // if we have a max read buffer size, reset the plain socket's to 1k
+ // if we have a max read buffer size, reset the plain socket's to 16k
if (readBufferMaxSize)
- plainSocket->setReadBufferSize(1024);
+ plainSocket->setReadBufferSize(16384);
connectionEncrypted = true;
emit q->encrypted();
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 86ecba07ce..ee6361ffaa 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -69,9 +69,11 @@ QT_BEGIN_NAMESPACE
#if defined(Q_OS_MAC)
#include <Security/SecCertificate.h>
#include <CoreFoundation/CFArray.h>
+#ifndef QT_NO_CORESERVICES
typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR);
typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
+#endif
#elif defined(Q_OS_WIN)
#include <windows.h>
#include <wincrypt.h>
@@ -132,7 +134,7 @@ public:
static void addDefaultCaCertificate(const QSslCertificate &cert);
static void addDefaultCaCertificates(const QList<QSslCertificate> &certs);
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
static PtrSecCertificateGetData ptrSecCertificateGetData;
static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates;
static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index e62af621fa..9ce7d55a33 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -90,6 +90,12 @@
QT_BEGIN_NAMESPACE
+inline static bool isPowerOfTwo(int x)
+{
+ // Assumption: x >= 1
+ return x == (x & -x);
+}
+
#if defined(Q_WS_WIN)
extern Q_GUI_EXPORT bool qt_cleartype_enabled;
#endif
@@ -201,6 +207,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
+#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+ QGLFunctions funcs(QGLContext::currentContext());
+ bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool isNpot = !isPowerOfTwo(texImage.size().width())
+ || !isPowerOfTwo(texImage.size().height());
+ if (isNpot && !npotSupported) {
+ qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures.");
+ }
+#endif
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
}
else if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
@@ -233,6 +248,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
QGLTexture *tex = ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA,
QGLContext::InternalBindOption |
QGLContext::CanFlipNativePixmapBindOption);
+#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+ QGLFunctions funcs(QGLContext::currentContext());
+ bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool isNpot = !isPowerOfTwo(currentBrushPixmap.size().width())
+ || !isPowerOfTwo(currentBrushPixmap.size().height());
+ if (isNpot && !npotSupported) {
+ qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures.");
+ }
+#endif
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
textureInvertedY = tex->options & QGLContext::InvertedYBindOption ? -1 : 1;
}
@@ -1436,19 +1460,30 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
ensureActive();
- QFontEngineGlyphCache::Type glyphType = textItem->fontEngine()->glyphFormat >= 0
- ? QFontEngineGlyphCache::Type(textItem->fontEngine()->glyphFormat)
- : d->glyphCacheType;
- if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
- if (d->device->alphaRequested() || state()->matrix.type() > QTransform::TxTranslate
- || (state()->composition_mode != QPainter::CompositionMode_Source
- && state()->composition_mode != QPainter::CompositionMode_SourceOver))
- {
- glyphType = QFontEngineGlyphCache::Raster_A8;
+ QPainterState *s = state();
+ float det = s->matrix.determinant();
+
+ // don't try to cache huge fonts or vastly transformed fonts
+ QFontEngine *fontEngine = textItem->fontEngine();
+ const qreal pixelSize = fontEngine->fontDef.pixelSize;
+ if (pixelSize * pixelSize * qAbs(det) < QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE ||
+ det < 0.25f || det > 4.f) {
+ QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0
+ ? QFontEngineGlyphCache::Type(textItem->fontEngine()->glyphFormat)
+ : d->glyphCacheType;
+ if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
+ if (d->device->alphaRequested() || s->matrix.type() > QTransform::TxTranslate
+ || (s->composition_mode != QPainter::CompositionMode_Source
+ && s->composition_mode != QPainter::CompositionMode_SourceOver))
+ {
+ glyphType = QFontEngineGlyphCache::Raster_A8;
+ }
}
- }
- d->drawCachedGlyphs(glyphType, textItem);
+ d->drawCachedGlyphs(glyphType, textItem);
+ } else {
+ QPaintEngineEx::drawStaticTextItem(textItem);
+ }
}
bool QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src)
@@ -1771,6 +1806,15 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
glBindTexture(GL_TEXTURE_2D, cache->texture());
+#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
+ QGLFunctions funcs(QGLContext::currentContext());
+ bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool isNpot = !isPowerOfTwo(cache->width())
+ || !isPowerOfTwo(cache->height());
+ if (isNpot && !npotSupported) {
+ qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures.");
+ }
+#endif
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
#if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO)
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 7ba92e4244..2895d5a9b0 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -158,6 +158,7 @@ public:
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
+ bool supportsTransformations(qreal, const QTransform &) const { return true; }
private:
Q_DISABLE_COPY(QGL2PaintEngineEx)
};
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 2b0c8f817f..5f5864d3c3 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -366,6 +366,10 @@ void QGL::setPreferredPaintEngine(QPaintEngine::Type engineType)
static inline void transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4])
{
+#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
#define M(row,col) m[col*4+row]
out[0] =
M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3];
@@ -376,6 +380,9 @@ static inline void transform_point(GLdouble out[4], const GLdouble m[16], const
out[3] =
M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3];
#undef M
+#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+# pragma GCC diagnostic pop
+#endif
}
static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz,
@@ -1993,7 +2000,7 @@ struct DDSFormat {
If you're using double buffering you can swap the screen contents
with the off-screen buffer using swapBuffers().
- Please note that QGLContext is not thread safe.
+ Please note that QGLContext is not \l{thread-safe}.
*/
/*!
@@ -3266,18 +3273,13 @@ bool QGLContext::areSharing(const QGLContext *context1, const QGLContext *contex
\fn QColor QGLContext::overlayTransparentColor() const
If this context is a valid context in an overlay plane, returns
- the plane's transparent color. Otherwise returns an \link
- QColor::isValid() invalid \endlink color.
-
- The returned color's \link QColor::pixel() pixel \endlink value is
- the index of the transparent color in the colormap of the overlay
- plane. (Naturally, the color's RGB values are meaningless.)
+ the plane's transparent color. Otherwise returns an
+ \{QColor::isValid()}{invalid} color.
The returned QColor object will generally work as expected only
when passed as the argument to QGLWidget::qglColor() or
QGLWidget::qglClearColor(). Under certain circumstances it can
- also be used to draw transparent graphics with a QPainter. See the
- examples/opengl/overlay_x11 example for details.
+ also be used to draw transparent graphics with a QPainter.
*/
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index e7fc5605d5..9ba8b75362 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -52,6 +52,9 @@
QT_BEGIN_NAMESPACE
+/*!
+ Returns an OpenGL format for the platform window format specified by \a format.
+*/
QGLFormat QGLFormat::fromPlatformWindowFormat(const QPlatformWindowFormat &format)
{
QGLFormat retFormat;
@@ -83,6 +86,9 @@ QGLFormat QGLFormat::fromPlatformWindowFormat(const QPlatformWindowFormat &forma
return retFormat;
}
+/*!
+ Returns a platform window format for the OpenGL format specified by \a format.
+*/
QPlatformWindowFormat QGLFormat::toPlatformWindowFormat(const QGLFormat &format)
{
QPlatformWindowFormat retFormat;
@@ -150,6 +156,8 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
if (shareContext) {
winFormat.setSharedContext(shareContext->d_func()->platformContext);
}
+ if (widget->testAttribute(Qt::WA_TranslucentBackground))
+ winFormat.setAlpha(true);
winFormat.setWindowApi(QPlatformWindowFormat::OpenGL);
winFormat.setWindowSurface(false);
widget->setPlatformWindowFormat(winFormat);
@@ -378,6 +386,10 @@ QGLContext::QGLContext(QPlatformGLContext *platformContext)
d->setupSharing();
}
+/*!
+ Returns a OpenGL context for the platform-specific OpenGL context given by
+ \a platformContext.
+*/
QGLContext *QGLContext::fromPlatformGLContext(QPlatformGLContext *platformContext)
{
if (!platformContext)
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index 91904d045c..86176c947f 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -183,9 +183,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as
d->ownsEglContext = true;
d->eglContext->setApi(QEgl::OpenGL);
- QGraphicsSystemEx *ex = QApplicationPrivate::graphicsSystem()->platformExtension();
- QSymbianGraphicsSystemEx *symex = static_cast<QSymbianGraphicsSystemEx*>(ex);
- if (symex && !symex->hasBCM2727()) {
+ if (!QSymbianGraphicsSystemEx::hasBCM2727()) {
// Most likely we have hw support for multisampling
// so let's enable it.
d->glFormat.setSampleBuffers(1);
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 22215aacb4..18b6eaaf91 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1407,10 +1407,6 @@ bool QGLWidgetPrivate::renderCxPm(QPixmap* pm)
return true;
}
-/*! \internal
- Free up any allocated colormaps. This fn is only called for
- top-level widgets.
-*/
void QGLWidgetPrivate::cleanupColormaps()
{
if (!cmap.handle()) {
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 3532390c5a..0af8108f03 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -205,13 +205,16 @@ int QGLFramebufferObjectFormat::samples() const
/*!
\since 4.8
- Enables or disables mipmapping. Mipmapping is disabled by default.
+ Enables mipmapping if \a enabled is true; otherwise disables it.
+
+ Mipmapping is disabled by default.
+
If mipmapping is enabled, additional memory will be allocated for
the mipmap levels. The mipmap levels can be updated by binding the
texture and calling glGenerateMipmap(). Mipmapping cannot be enabled
for multisampled framebuffer objects.
- \sa mipmap(), texture()
+ \sa mipmap(), QGLFramebufferObject::texture()
*/
void QGLFramebufferObjectFormat::setMipmap(bool enabled)
{
@@ -713,7 +716,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
as a texture, you first need to copy from it to a regular framebuffer
object using QGLContext::blitFramebuffer().
- \section Threading
+ \section1 Threading
As of Qt 4.8, it's possible to draw into a QGLFramebufferObject
using a QPainter in a separate thread. Note that OpenGL 2.0 or
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 810ac7da83..3afb3b1fae 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -77,7 +77,7 @@
\endlist
- \section Threading
+ \section1 Threading
As of Qt 4.8, it's possible to render into a QGLPixelBuffer using
a QPainter in a separate thread. Note that OpenGL 2.0 or OpenGL ES
diff --git a/src/opengl/qpaintengine_opengl_p.h b/src/opengl/qpaintengine_opengl_p.h
index 5d5f5ce652..8d0ea83a47 100644
--- a/src/opengl/qpaintengine_opengl_p.h
+++ b/src/opengl/qpaintengine_opengl_p.h
@@ -143,6 +143,7 @@ public:
Qt::HANDLE handle() const;
#endif
inline Type type() const { return QPaintEngine::OpenGL; }
+ bool supportsTransformations(qreal, const QTransform &) const { return true; }
private:
void drawPolyInternal(const QPolygonF &pa, bool close = true);
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 7f63aeaee8..ff551427ec 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -542,19 +542,27 @@ void QGLWindowSurface::beginPaint(const QRegion &)
d_ptr->did_paint = true;
updateGeometry();
- if (!context())
- return;
-
int clearFlags = 0;
- if (context()->d_func()->workaround_needsFullClearOnEveryFrame)
+ QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);
+
+ if (!ctx)
+ return;
+
+ if (ctx->d_func()->workaround_needsFullClearOnEveryFrame)
clearFlags = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
- else if (context()->format().alpha())
+ else if (ctx->format().alpha())
clearFlags = GL_COLOR_BUFFER_BIT;
if (clearFlags) {
+ if (d_ptr->fbo)
+ d_ptr->fbo->bind();
+
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(clearFlags);
+
+ if (d_ptr->fbo)
+ d_ptr->fbo->release();
}
}
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index f1ef0fbdee..267ecd443f 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -159,6 +159,7 @@ public:
QVGPaintEnginePrivate *vgPrivate() { Q_D(QVGPaintEngine); return d; }
void fillRegion(const QRegion& region, const QColor& color, const QSize& surfaceSize);
+ bool supportsTransformations(qreal, const QTransform &) const { return true; }
protected:
QVGPaintEngine(QVGPaintEnginePrivate &data);
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 34f5be912f..c62624b666 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -1316,11 +1316,112 @@ void QAccessibleTextEdit::addSelection(int startOffset, int endOffset)
QString QAccessibleTextEdit::attributes(int offset, int *startOffset, int *endOffset)
{
- // TODO - wait for a definition of attributes
- Q_UNUSED(offset);
- Q_UNUSED(startOffset);
- Q_UNUSED(endOffset);
- return QString();
+ /* The list of attributes can be found at:
+ http://linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2/textattributes
+ */
+
+ if (offset >= characterCount()) {
+ *startOffset = -1;
+ *endOffset = -1;
+ return QString();
+ }
+
+ QMap<QString, QString> attrs;
+
+ QTextCursor cursor = textEdit()->textCursor();
+
+ //cursor.charFormat returns the format of the previous character
+ cursor.setPosition(offset + 1);
+ QTextCharFormat charFormat = cursor.charFormat();
+
+ cursor.setPosition(offset);
+ QTextBlockFormat blockFormat = cursor.blockFormat();
+
+ QTextCharFormat charFormatComp;
+ QTextBlockFormat blockFormatComp;
+
+ *startOffset = offset;
+ cursor.setPosition(*startOffset);
+ while (*startOffset > 0) {
+ charFormatComp = cursor.charFormat();
+ cursor.setPosition(*startOffset - 1);
+ blockFormatComp = cursor.blockFormat();
+ if ((charFormat == charFormatComp) && (blockFormat == blockFormatComp))
+ (*startOffset)--;
+ else
+ break;
+ }
+
+ int limit = characterCount() + 1;
+ *endOffset = offset + 1;
+ cursor.setPosition(*endOffset);
+ while (*endOffset < limit) {
+ blockFormatComp = cursor.blockFormat();
+ cursor.setPosition(*endOffset + 1);
+ charFormatComp = cursor.charFormat();
+ if ((charFormat == charFormatComp) && (cursor.blockFormat() == blockFormatComp))
+ (*endOffset)++;
+ else
+ break;
+ }
+
+ QString family = charFormat.fontFamily();
+ if (!family.isEmpty()) {
+ family = family.replace('\\',"\\\\");
+ family = family.replace(':',"\\:");
+ family = family.replace(',',"\\,");
+ family = family.replace('=',"\\=");
+ family = family.replace(';',"\\;");
+ family = family.replace('\"',"\\\"");
+ attrs["font-family"] = '"'+family+'"';
+ }
+
+ int fontSize = int(charFormat.fontPointSize());
+ if (fontSize)
+ attrs["font-size"] = QString::number(fontSize).append("pt");
+
+ //Different weight values are not handled
+ attrs["font-weight"] = (charFormat.fontWeight() > QFont::Normal) ? "bold" : "normal";
+
+ QFont::Style style = charFormat.font().style();
+ attrs["font-style"] = (style == QFont::StyleItalic) ? "italic" : ((style == QFont::StyleOblique) ? "oblique": "normal");
+
+ attrs["text-underline-style"] = charFormat.font().underline() ? "solid" : "none";
+
+ QTextCharFormat::VerticalAlignment alignment = charFormat.verticalAlignment();
+ attrs["text-position"] = (alignment == QTextCharFormat::AlignSubScript) ? "sub" : ((alignment == QTextCharFormat::AlignSuperScript) ? "super" : "baseline" );
+
+ QBrush background = charFormat.background();
+ if (background.style() == Qt::SolidPattern) {
+ attrs["background-color"] = QString("rgb(%1,%2,%3)").arg(background.color().red()).arg(background.color().green()).arg(background.color().blue());
+ }
+
+ QBrush foreground = charFormat.foreground();
+ if (foreground.style() == Qt::SolidPattern) {
+ attrs["color"] = QString("rgb(%1,%2,%3)").arg(foreground.color().red()).arg(foreground.color().green()).arg(foreground.color().blue());
+ }
+
+ switch (blockFormat.alignment() & (Qt::AlignLeft | Qt::AlignRight | Qt::AlignHCenter | Qt::AlignJustify)) {
+ case Qt::AlignLeft:
+ attrs["text-align"] = "left";
+ break;
+ case Qt::AlignRight:
+ attrs["text-align"] = "right";
+ break;
+ case Qt::AlignHCenter:
+ attrs["text-align"] = "center";
+ break;
+ case Qt::AlignJustify:
+ attrs["text-align"] = "left";
+ break;
+ }
+
+ QString result;
+ foreach (const QString &attributeName, attrs.keys()) {
+ result.append(attributeName).append(':').append(attrs[attributeName]).append(';');
+ }
+
+ return result;
}
int QAccessibleTextEdit::cursorPosition()
@@ -1435,9 +1536,9 @@ QString QAccessibleTextEdit::textAtOffset(int offset, BoundaryType boundaryType,
if (offset >= characterCount())
return QString();
+ cursor.setPosition(offset);
switch (boundaryType) {
case CharBoundary:
- cursor.setPosition(offset);
*startOffset = cursor.position();
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
*endOffset = cursor.position();
diff --git a/src/plugins/accessible/widgets/rangecontrols.cpp b/src/plugins/accessible/widgets/rangecontrols.cpp
index fb53b10567..8868d53dc7 100644
--- a/src/plugins/accessible/widgets/rangecontrols.cpp
+++ b/src/plugins/accessible/widgets/rangecontrols.cpp
@@ -83,8 +83,6 @@ QAbstractSpinBox *QAccessibleAbstractSpinBox::abstractSpinBox() const
/*! \reimp */
int QAccessibleAbstractSpinBox::childCount() const
{
- if (!abstractSpinBox()->isVisible())
- return 0;
return ValueDown;
}
@@ -344,8 +342,6 @@ QDoubleSpinBox *QAccessibleDoubleSpinBox::doubleSpinBox() const
/*! \reimp */
int QAccessibleDoubleSpinBox::childCount() const
{
- if (!doubleSpinBox()->isVisible())
- return 0;
return ValueDown;
}
@@ -410,8 +406,6 @@ QVariant QAccessibleDoubleSpinBox::invokeMethodEx(QAccessible::Method, int, cons
/*! \reimp */
QString QAccessibleDoubleSpinBox::text(Text textType, int child) const
{
- if (!doubleSpinBox()->isVisible())
- return QString();
switch (textType) {
case Name:
if (child == ValueUp)
@@ -540,16 +534,12 @@ QRect QAccessibleScrollBar::rect(int child) const
/*! \reimp */
int QAccessibleScrollBar::childCount() const
{
- if (!scrollBar()->isVisible())
- return 0;
return LineDown;
}
/*! \reimp */
QString QAccessibleScrollBar::text(Text t, int child) const
{
- if (!scrollBar()->isVisible())
- return QString();
switch (t) {
case Value:
if (!child || child == Position)
@@ -698,16 +688,12 @@ QRect QAccessibleSlider::rect(int child) const
/*! \reimp */
int QAccessibleSlider::childCount() const
{
- if (!slider()->isVisible())
- return 0;
return PageRight;
}
/*! \reimp */
QString QAccessibleSlider::text(Text t, int child) const
{
- if (!slider()->isVisible())
- return QString();
switch (t) {
case Value:
if (!child || child == 2)
@@ -932,15 +918,11 @@ QRect QAccessibleDial::rect(int child) const
int QAccessibleDial::childCount() const
{
- if (!dial()->isVisible())
- return 0;
return SliderHandle;
}
QString QAccessibleDial::text(Text textType, int child) const
{
- if (!dial()->isVisible())
- return QString();
if (textType == Value && child >= Self && child <= SliderHandle)
return QString::number(dial()->value());
if (textType == Name) {
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp
index 70a182f2df..1b10a7b734 100644
--- a/src/plugins/accessible/widgets/simplewidgets.cpp
+++ b/src/plugins/accessible/widgets/simplewidgets.cpp
@@ -176,7 +176,7 @@ QString QAccessibleButton::text(Text t, int child) const
break;
}
if (str.isEmpty())
- str = QAccessibleWidgetEx::text(t, child);;
+ str = QAccessibleWidgetEx::text(t, child);
return qt_accStripAmp(str);
}
@@ -396,7 +396,7 @@ QString QAccessibleToolButton::text(Text t, int child) const
QString str;
switch (t) {
case Name:
- str = toolButton()->text();
+ str = toolButton()->accessibleName();
if (str.isEmpty())
str = toolButton()->text();
break;
diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp
index c793e52cf9..79be2cee0c 100644
--- a/src/plugins/bearer/icd/qicdengine.cpp
+++ b/src/plugins/bearer/icd/qicdengine.cpp
@@ -929,6 +929,7 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg)
configLocker.unlock();
locker.unlock();
+ emit iapStateChanged(iapid, icd_connection_state);
emit configurationChanged(ptr);
locker.relock();
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index f08d8bf363..a99c0a7891 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -183,6 +183,12 @@ void QNetworkSessionPrivateImpl::updateState(QNetworkSession::State newState)
icdConfig->mutex.lock();
icdConfig->state = QNetworkConfiguration::Defined;
icdConfig->mutex.unlock();
+
+ // Reset the state of the default configuration to Discovered
+ icdConfig = toIcdConfig(privateConfiguration(publicConfig));
+ icdConfig->mutex.lock();
+ icdConfig->state = QNetworkConfiguration::Discovered;
+ icdConfig->mutex.unlock();
} else {
if (!activeConfig.isValid()) {
// Active configuration (IAP) was removed from system
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 18861cfac1..d90c8ca955 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -63,27 +63,26 @@ class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate
{
public:
enum TransformationTypeFlags {
- Matrix_NegativeScale = 0x100,
+ Matrix_NegativeScaleX = 0x100,
+ Matrix_NegativeScaleY = 0x200,
Matrix_RectsUnsupported = (QTransform::TxRotate|QTransform::TxShear|QTransform::TxProject),
- Matrix_BlitsUnsupported = (Matrix_NegativeScale|Matrix_RectsUnsupported)
+#if (Q_DIRECTFB_VERSION >= 0x010403)
+ Matrix_BlitsUnsupported = (Matrix_RectsUnsupported)
+#else
+ Matrix_BlitsUnsupported = (Matrix_RectsUnsupported|Matrix_NegativeScaleX|Matrix_NegativeScaleY)
+#endif
};
inline static uint getTransformationType(const QTransform &transform)
{
int ret = transform.type();
- if (qMin(transform.m11(), transform.m22()) < 0) {
- ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale;
- }
+ if (transform.m11() < 0)
+ ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScaleX;
+ if (transform.m22() < 0)
+ ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScaleY;
return ret;
}
- enum CompositionModeStatus {
- PorterDuff_None = 0x0,
- PorterDuff_Supported = 0x1,
- PorterDuff_PremultiplyColors = 0x2,
- PorterDuff_AlwaysBlend = 0x4
- };
-
enum ClipType {
ClipUnset,
NoClip,
@@ -95,25 +94,24 @@ public:
QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p);
~QDirectFBPaintEnginePrivate();
- inline void setTransform(const QTransform &transforma);
- inline void setPen(const QPen &pen);
- inline void setCompositionMode(QPainter::CompositionMode mode);
- inline void setRenderHints(QPainter::RenderHints hints);
+ void setBrush(const QBrush &brush);
+ void setCompositionMode(QPainter::CompositionMode mode);
+ void setPen(const QPen &pen);
+ void setTransform(const QTransform &transforma);
+ void setRenderHints(QPainter::RenderHints hints);
- inline void setDFBColor(const QColor &color);
+ bool prepareForDraw(const QColor &color);
- inline void lock();
- inline void unlock();
+ void lock();
+ void unlock();
static inline void unlock(QDirectFBPaintDevice *device);
- inline bool isSimpleBrush(const QBrush &brush) const;
-
void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos, const QTransform &pixmapTransform);
void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src);
- inline bool supportsStretchBlit() const;
+ bool supportsStretchBlit() const;
- inline void updateClip();
+ void updateClip();
virtual void systemStateChanged();
static IDirectFBSurface *getSurface(const QImage &img, bool *release);
@@ -131,7 +129,8 @@ public:
IDirectFBSurface *surface;
bool antialiased;
- bool simplePen;
+ bool supportedBrush;
+ bool supportedPen;
uint transformationType; // this is QTransform::type() + Matrix_NegativeScale if qMin(transform.m11(), transform.m22()) < 0
@@ -141,13 +140,13 @@ public:
ClipType clipType;
QDirectFBPaintDevice *dfbDevice;
- uint compositionModeStatus;
+ bool supportedComposition;
bool isPremultiplied;
bool inClip;
QRect currentClip;
- QDirectFBPaintEngine *q;
+ QDirectFBPaintEngine *engine;
};
class SurfaceCache
@@ -183,14 +182,27 @@ static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB
#define VOID_ARG() static_cast<bool>(false)
enum PaintOperation {
- DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004,
- DRAW_PIXMAP = 0x0008, DRAW_TILED_PIXMAP = 0x0010, STROKE_PATH = 0x0020,
- DRAW_PATH = 0x0040, DRAW_POINTS = 0x0080, DRAW_ELLIPSE = 0x0100,
- DRAW_POLYGON = 0x0200, DRAW_TEXT = 0x0400, FILL_PATH = 0x0800,
- FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, DRAW_ROUNDED_RECT = 0x4000,
- DRAW_STATICTEXT = 0x8000, ALL = 0xffff
+ DRAW_RECTS = 0x0001,
+ DRAW_LINES = 0x0002,
+ DRAW_IMAGE = 0x0004,
+ DRAW_PIXMAP = 0x0008,
+ DRAW_TILED_PIXMAP = 0x0010,
+ STROKE_PATH = 0x0020,
+ DRAW_PATH = 0x0040,
+ DRAW_POINTS = 0x0080,
+ DRAW_ELLIPSE = 0x0100,
+ DRAW_POLYGON = 0x0200,
+ DRAW_TEXT = 0x0400,
+ FILL_PATH = 0x0800,
+ FILL_RECT = 0x1000,
+ DRAW_COLORSPANS = 0x2000,
+ DRAW_ROUNDED_RECT = 0x4000,
+ DRAW_STATICTEXT = 0x8000,
+ ALL = 0xffff
};
+//#define QT_DIRECTFB_WARN_ON_RASTERFALLBACKS ALL
+
enum { RasterWarn = 1, RasterDisable = 2 };
static inline uint rasterFallbacksMask(PaintOperation op)
{
@@ -268,8 +280,7 @@ static inline uint rasterFallbacksMask(PaintOperation op)
template <typename device, typename T1, typename T2, typename T3>
static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
- uint transformationType, bool simplePen,
- uint clipType, uint compositionModeStatus,
+ QDirectFBPaintEnginePrivate *priv,
const char *nameOne, const T1 &one,
const char *nameTwo, const T2 &two,
const char *nameThree, const T3 &three);
@@ -283,20 +294,14 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
rasterFallbackWarn("Falling back to raster engine for", \
__FUNCTION__, \
state()->painter->device(), \
- d_func()->transformationType, \
- d_func()->simplePen, \
- d_func()->clipType, \
- d_func()->compositionModeStatus, \
+ d_func(), \
#one, one, #two, two, #three, three); \
break; \
case RasterDisable|RasterWarn: \
rasterFallbackWarn("Disabled raster engine operation", \
__FUNCTION__, \
state()->painter->device(), \
- d_func()->transformationType, \
- d_func()->simplePen, \
- d_func()->clipType, \
- d_func()->compositionModeStatus, \
+ d_func(), \
#one, one, #two, two, #three, three); \
case RasterDisable: \
return; \
@@ -304,6 +309,8 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
}
template <class T>
+static inline void drawPoints(const T *points, int n, const QTransform &transform, IDirectFBSurface *surface);
+template <class T>
static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface);
template <class T>
static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface);
@@ -400,6 +407,14 @@ void QDirectFBPaintEngine::clipEnabledChanged()
d->updateClip();
}
+void QDirectFBPaintEngine::brushChanged()
+{
+ Q_D(QDirectFBPaintEngine);
+ d->setBrush(state()->brush);
+
+ QRasterPaintEngine::brushChanged();
+}
+
void QDirectFBPaintEngine::penChanged()
{
Q_D(QDirectFBPaintEngine);
@@ -494,23 +509,21 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
return;
if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
- || !d->simplePen
+ || !d->supportedPen
|| d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
- || !d->isSimpleBrush(brush)
- || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
+ || !d->supportedBrush
+ || !d->supportedComposition) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
- if (brush.style() != Qt::NoBrush) {
- d->setDFBColor(brush.color());
+ if (brush.style() != Qt::NoBrush && d->prepareForDraw(brush.color())) {
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
}
- if (pen.style() != Qt::NoPen) {
- d->setDFBColor(pen.color());
+ if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
}
}
@@ -524,23 +537,21 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
return;
if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
- || !d->simplePen
+ || !d->supportedPen
|| d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
- || !d->isSimpleBrush(brush)
- || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
+ || !d->supportedBrush
+ || !d->supportedComposition) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
- if (brush.style() != Qt::NoBrush) {
- d->setDFBColor(brush.color());
+ if (brush.style() != Qt::NoBrush && d->prepareForDraw(brush.color())) {
CLIPPED_PAINT(fillRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
}
- if (pen.style() != Qt::NoPen) {
- d->setDFBColor(pen.color());
+ if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRectF>)(rects, rectCount, state()->matrix, d->surface));
}
}
@@ -550,17 +561,16 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount)
Q_D(QDirectFBPaintEngine);
const QPen &pen = state()->pen;
- if (!d->simplePen
+ if (!d->supportedPen
|| d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
- || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
+ || !d->supportedComposition) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
return;
}
- if (pen.style() != Qt::NoPen) {
- d->setDFBColor(pen.color());
+ if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLine>)(lines, lineCount, state()->matrix, d->surface));
}
}
@@ -570,17 +580,16 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount)
Q_D(QDirectFBPaintEngine);
const QPen &pen = state()->pen;
- if (!d->simplePen
+ if (!d->supportedPen
|| d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
- || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
+ || !d->supportedComposition) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
return;
}
- if (pen.style() != Qt::NoPen) {
- d->setDFBColor(pen.color());
+ if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLineF>)(lines, lineCount, state()->matrix, d->surface));
}
}
@@ -610,7 +619,7 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
*/
#if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
- if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)
+ if (!d->supportedComposition
|| (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
|| (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip)
|| (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size())
@@ -664,7 +673,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
- if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)
+ if (!d->supportedComposition
|| (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
|| (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip)
|| (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size())) {
@@ -701,7 +710,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset);
d->lock();
QRasterPaintEngine::drawTiledPixmap(r, pixmap, offset);
- } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)
+ } else if (!d->supportedComposition
|| (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
|| (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip)
|| (!d->supportsStretchBlit() && state()->matrix.isScaling())) {
@@ -740,18 +749,40 @@ void QDirectFBPaintEngine::drawPath(const QPainterPath &path)
void QDirectFBPaintEngine::drawPoints(const QPointF *points, int pointCount)
{
- RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG());
Q_D(QDirectFBPaintEngine);
- d->lock();
- QRasterPaintEngine::drawPoints(points, pointCount);
+
+ const QPen &pen = state()->pen;
+ if (!d->supportedPen
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
+ || !d->supportedComposition) {
+ RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG());
+ d->lock();
+ QRasterPaintEngine::drawPoints(points, pointCount);
+ return;
+ }
+
+ if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawPoints<QPointF>)(points, pointCount, state()->matrix, d->surface));
+ }
}
void QDirectFBPaintEngine::drawPoints(const QPoint *points, int pointCount)
{
- RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG());
Q_D(QDirectFBPaintEngine);
- d->lock();
- QRasterPaintEngine::drawPoints(points, pointCount);
+
+ const QPen &pen = state()->pen;
+ if (!d->supportedPen
+ || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip
+ || !d->supportedComposition) {
+ RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG());
+ d->lock();
+ QRasterPaintEngine::drawPoints(points, pointCount);
+ return;
+ }
+
+ if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
+ CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawPoints<QPoint>)(points, pointCount, state()->matrix, d->surface));
+ }
}
void QDirectFBPaintEngine::drawEllipse(const QRectF &rect)
@@ -793,6 +824,29 @@ void QDirectFBPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
{
if (brush.style() == Qt::NoBrush)
return;
+
+ const QPainterPath::ElementType *elements = path.elements();
+ const qreal *points = path.points();
+
+ if (path.elementCount() == 5) {
+ if (elements[0] == QPainterPath::MoveToElement
+ && elements[1] == QPainterPath::LineToElement
+ && elements[2] == QPainterPath::LineToElement
+ && elements[3] == QPainterPath::LineToElement
+ && elements[4] == QPainterPath::LineToElement) {
+
+ if (points[1] == points[3]
+ && points[2] == points[4]
+ && points[5] == points[7]
+ && points[6] == points[0]) {
+ QRectF rect( points[0], points[1], points[4], points[5] );
+
+ fillRect( rect, brush );
+ return;
+ }
+ }
+ }
+
RASTERFALLBACK(FILL_PATH, path, brush, VOID_ARG());
Q_D(QDirectFBPaintEngine);
d->lock();
@@ -828,12 +882,13 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
return;
if (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported
- || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
+ || !d->supportedComposition) {
break;
}
- d->setDFBColor(color);
- const QRect r = state()->matrix.mapRect(rect).toRect();
- CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
+ if (d->prepareForDraw(color)) {
+ const QRect r = state()->matrix.mapRect(rect).toRect();
+ CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
+ }
return; }
case Qt::TexturePattern: {
@@ -842,7 +897,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
QTransform transform(stateTransform);
transform.translate(brushOrigin.x(), brushOrigin.y());
transform = brush.transform() * transform;
- if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)
+ if (!d->supportedComposition
|| (QDirectFBPaintEnginePrivate::getTransformationType(transform) & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
|| (!d->supportsStretchBlit() && transform.isScaling())) {
break;
@@ -870,12 +925,11 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color)
Q_D(QDirectFBPaintEngine);
if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
|| (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip)
- || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
+ || !d->supportedComposition) {
RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG());
d->lock();
QRasterPaintEngine::fillRect(rect, color);
- } else {
- d->setDFBColor(color);
+ } else if (d->prepareForDraw(color)) {
const QRect r = state()->matrix.mapRect(rect).toRect();
CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
}
@@ -909,12 +963,11 @@ void QDirectFBPaintEngine::initImageCache(int size)
// ---- QDirectFBPaintEnginePrivate ----
-
QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p)
- : surface(0), antialiased(false), simplePen(false),
+ : surface(0), antialiased(false), supportedBrush(false), supportedPen(false),
transformationType(0), opacity(255),
clipType(ClipUnset), dfbDevice(0),
- compositionModeStatus(0), isPremultiplied(false), inClip(false), q(p)
+ supportedComposition(false), isPremultiplied(false), inClip(false), engine(p)
{
fb = QDirectFBScreen::instance()->dfb();
surfaceCache = new SurfaceCache;
@@ -925,11 +978,6 @@ QDirectFBPaintEnginePrivate::~QDirectFBPaintEnginePrivate()
delete surfaceCache;
}
-bool QDirectFBPaintEnginePrivate::isSimpleBrush(const QBrush &brush) const
-{
- return (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased);
-}
-
void QDirectFBPaintEnginePrivate::lock()
{
// We will potentially get a new pointer to the buffer after a
@@ -961,25 +1009,9 @@ void QDirectFBPaintEnginePrivate::unlock(QDirectFBPaintDevice *device)
#endif
}
-void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform)
+void QDirectFBPaintEnginePrivate::setBrush(const QBrush &brush)
{
- transformationType = getTransformationType(transform);
- setPen(q->state()->pen);
-}
-
-void QDirectFBPaintEnginePrivate::setPen(const QPen &pen)
-{
- if (pen.style() == Qt::NoPen) {
- simplePen = true;
- } else if (pen.style() == Qt::SolidLine
- && !antialiased
- && pen.brush().style() == Qt::SolidPattern
- && pen.widthF() <= 1.0
- && (transformationType < QTransform::TxScale || pen.isCosmetic())) {
- simplePen = true;
- } else {
- simplePen = false;
- }
+ supportedBrush = (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased);
}
void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode)
@@ -989,23 +1021,19 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m
static const bool forceRasterFallBack = qgetenv("QT_DIRECTFB_FORCE_RASTER").toInt() > 0;
if (forceRasterFallBack) {
- compositionModeStatus = PorterDuff_None;
+ supportedComposition = false;
return;
}
- compositionModeStatus = PorterDuff_Supported|PorterDuff_PremultiplyColors|PorterDuff_AlwaysBlend;
+ supportedComposition = true;
switch (mode) {
case QPainter::CompositionMode_Clear:
surface->SetPorterDuff(surface, DSPD_CLEAR);
break;
case QPainter::CompositionMode_Source:
surface->SetPorterDuff(surface, DSPD_SRC);
- compositionModeStatus &= ~PorterDuff_AlwaysBlend;
- if (!isPremultiplied)
- compositionModeStatus &= ~PorterDuff_PremultiplyColors;
break;
case QPainter::CompositionMode_SourceOver:
- compositionModeStatus &= ~PorterDuff_AlwaysBlend;
surface->SetPorterDuff(surface, DSPD_SRC_OVER);
break;
case QPainter::CompositionMode_DestinationOver:
@@ -1013,8 +1041,6 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m
break;
case QPainter::CompositionMode_SourceIn:
surface->SetPorterDuff(surface, DSPD_SRC_IN);
- if (!isPremultiplied)
- compositionModeStatus &= ~PorterDuff_PremultiplyColors;
break;
case QPainter::CompositionMode_DestinationIn:
surface->SetPorterDuff(surface, DSPD_DST_IN);
@@ -1044,32 +1070,69 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m
break;
#endif
default:
- compositionModeStatus = PorterDuff_None;
+ supportedComposition = false;
break;
}
}
+void QDirectFBPaintEnginePrivate::setPen(const QPen &pen)
+{
+ if (pen.style() == Qt::NoPen) {
+ supportedPen = true;
+ } else if (pen.style() == Qt::SolidLine
+ && !antialiased
+ && pen.brush().style() == Qt::SolidPattern
+ && pen.widthF() <= 1.0
+ && (transformationType < QTransform::TxScale || pen.isCosmetic())) {
+ supportedPen = true;
+ } else {
+ supportedPen = false;
+ }
+}
+
+void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform)
+{
+ transformationType = getTransformationType(transform);
+ setPen(engine->state()->pen);
+}
+
void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
{
const bool old = antialiased;
antialiased = bool(hints & QPainter::Antialiasing);
if (old != antialiased) {
- setPen(q->state()->pen);
+ setPen(engine->state()->pen);
}
}
void QDirectFBPaintEnginePrivate::prepareForBlit(uint flags)
{
DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX;
- if (flags & Premultiplied)
- blittingFlags |= DSBLIT_SRC_PREMULTIPLY;
+
+#if (Q_DIRECTFB_VERSION >= 0x010403)
+ if (transformationType & Matrix_NegativeScaleX)
+ blittingFlags |= DSBLIT_FLIP_HORIZONTAL;
+
+ if (transformationType & Matrix_NegativeScaleY)
+ blittingFlags |= DSBLIT_FLIP_VERTICAL;
+#endif
+
if (flags & HasAlpha)
blittingFlags |= DSBLIT_BLEND_ALPHACHANNEL;
+
if (opacity != 255) {
blittingFlags |= DSBLIT_BLEND_COLORALPHA;
surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
}
+ if (flags & Premultiplied) {
+ if (blittingFlags & DSBLIT_BLEND_COLORALPHA)
+ blittingFlags |= DSBLIT_SRC_PREMULTCOLOR;
+ } else {
+ if (blittingFlags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA))
+ blittingFlags |= DSBLIT_SRC_PREMULTIPLY;
+ }
+
surface->SetBlittingFlags(surface, blittingFlags);
}
@@ -1080,14 +1143,14 @@ static inline uint ALPHA_MUL(uint x, uint a)
return t;
}
-void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color)
+bool QDirectFBPaintEnginePrivate::prepareForDraw(const QColor &color)
{
Q_ASSERT(surface);
- Q_ASSERT(compositionModeStatus & PorterDuff_Supported);
+ Q_ASSERT(supportedComposition);
const quint8 alpha = (opacity == 255 ?
color.alpha() : ALPHA_MUL(color.alpha(), opacity));
QColor col;
- if (compositionModeStatus & PorterDuff_PremultiplyColors) {
+ if (isPremultiplied) {
col = QColor(ALPHA_MUL(color.red(), alpha),
ALPHA_MUL(color.green(), alpha),
ALPHA_MUL(color.blue(), alpha),
@@ -1096,7 +1159,28 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color)
col = QColor(color.red(), color.green(), color.blue(), alpha);
}
surface->SetColor(surface, col.red(), col.green(), col.blue(), col.alpha());
- surface->SetDrawingFlags(surface, alpha == 255 && !(compositionModeStatus & PorterDuff_AlwaysBlend) ? DSDRAW_NOFX : DSDRAW_BLEND);
+
+ bool blend = false;
+
+ switch (engine->state()->composition_mode) {
+ case QPainter::CompositionMode_Clear:
+ case QPainter::CompositionMode_Source:
+ break;
+ case QPainter::CompositionMode_SourceOver:
+ if (alpha == 0)
+ return false;
+
+ if (alpha != 255)
+ blend = true;
+ break;
+ default:
+ blend = true;
+ break;
+ }
+
+ surface->SetDrawingFlags(surface, blend ? DSDRAW_BLEND : DSDRAW_NOFX);
+
+ return true;
}
IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, bool *release)
@@ -1137,7 +1221,7 @@ IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, boo
void QDirectFBPaintEnginePrivate::blit(const QRectF &dest, IDirectFBSurface *s, const QRectF &src)
{
const QRect sr = src.toRect();
- const QRect dr = q->state()->matrix.mapRect(dest).toRect();
+ const QRect dr = engine->state()->matrix.mapRect(dest).toRect();
if (dr.isEmpty())
return;
const DFBRectangle sRect = { sr.x(), sr.y(), sr.width(), sr.height() };
@@ -1167,10 +1251,10 @@ static inline qreal fixCoord(qreal rect_pos, qreal pixmapSize, qreal offset)
void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap,
const QPointF &off, const QTransform &pixmapTransform)
{
- const QTransform &transform = q->state()->matrix;
+ const QTransform &transform = engine->state()->matrix;
Q_ASSERT(!(getTransformationType(transform) & Matrix_BlitsUnsupported) &&
!(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported));
- const QRect destinationRect = transform.mapRect(dest).toRect().normalized();
+ const QRect destinationRect = dest.toRect();
QRect newClip = destinationRect;
if (!currentClip.isEmpty())
newClip &= currentClip;
@@ -1186,7 +1270,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
};
surface->SetClip(surface, &clip);
- QPointF offset = pixmapTransform.inverted().map(off);
+ QPointF offset = off;
Q_ASSERT(transform.type() <= QTransform::TxScale);
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
@@ -1293,7 +1377,12 @@ void QDirectFBPaintEnginePrivate::updateClip()
bool QDirectFBPaintEnginePrivate::supportsStretchBlit() const
{
#ifdef QT_DIRECTFB_STRETCHBLIT
- return !(q->state()->renderHints & QPainter::SmoothPixmapTransform);
+ DFBGraphicsDeviceDescription desc;
+
+ fb->GetDeviceDescription(fb, &desc);
+
+ return !(engine->state()->renderHints & QPainter::SmoothPixmapTransform)
+ || (desc.acceleration_mask & DFXL_STRETCHBLIT);
#else
return false;
#endif
@@ -1334,10 +1423,32 @@ void SurfaceCache::clear()
}
-static inline QRect mapRect(const QTransform &transform, const QRect &rect) { return transform.mapRect(rect); }
-static inline QRect mapRect(const QTransform &transform, const QRectF &rect) { return transform.mapRect(rect).toRect(); }
+static inline QRect map(const QTransform &transform, const QRect &rect) { return transform.mapRect(rect); }
+static inline QRect map(const QTransform &transform, const QRectF &rect) { return transform.mapRect(rect).toRect(); }
static inline QLine map(const QTransform &transform, const QLine &line) { return transform.map(line); }
static inline QLine map(const QTransform &transform, const QLineF &line) { return transform.map(line).toLine(); }
+static inline QPoint map(const QTransform &transform, const QPoint &point) { return transform.map(point); }
+static inline QPoint map(const QTransform &transform, const QPointF &point) { return transform.map(point).toPoint(); }
+
+template <class T>
+static inline void drawPoints(const T *points, int n, const QTransform &transform, IDirectFBSurface *surface)
+{
+ if (n == 1) {
+ const QPoint p = map(transform, points[0]);
+ surface->FillRectangle(surface, p.x(), p.y(), 1, 1);
+ } else {
+ QVarLengthArray<DFBRectangle, 32> rectArray(n);
+ for (int i=0; i<n; ++i) {
+ const QPoint p = map(transform, points[i]);
+ rectArray[i].x = p.x();
+ rectArray[i].y = p.y();
+ rectArray[i].w = 1;
+ rectArray[i].h = 1;
+ }
+ surface->FillRectangles(surface, rectArray.constData(), n);
+ }
+}
+
template <class T>
static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface)
{
@@ -1361,12 +1472,12 @@ template <class T>
static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
{
if (n == 1) {
- const QRect r = mapRect(transform, rects[0]);
+ const QRect r = map(transform, rects[0]);
surface->FillRectangle(surface, r.x(), r.y(), r.width(), r.height());
} else {
QVarLengthArray<DFBRectangle, 32> rectArray(n);
for (int i=0; i<n; ++i) {
- const QRect r = mapRect(transform, rects[i]);
+ const QRect r = map(transform, rects[i]);
rectArray[i].x = r.x();
rectArray[i].y = r.y();
rectArray[i].w = r.width();
@@ -1380,7 +1491,7 @@ template <class T>
static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
{
for (int i=0; i<n; ++i) {
- const QRect r = mapRect(transform, rects[i]);
+ const QRect r = map(transform, rects[i]);
surface->DrawRectangle(surface, r.x(), r.y(), r.width(), r.height());
}
}
@@ -1389,14 +1500,18 @@ template <typename T> inline const T *ptr(const T &t) { return &t; }
template <> inline const bool* ptr<bool>(const bool &) { return 0; }
template <typename device, typename T1, typename T2, typename T3>
static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
- uint transformationType, bool simplePen,
- uint clipType, uint compositionModeStatus,
+ QDirectFBPaintEnginePrivate *priv,
const char *nameOne, const T1 &one,
const char *nameTwo, const T2 &two,
const char *nameThree, const T3 &three)
{
QString out;
QDebug dbg(&out);
+
+
+ dbg << "***";
+
+
dbg << msg << (QByteArray(func) + "()") << "painting on";
if (dev->devType() == QInternal::Widget) {
dbg << static_cast<const QWidget*>(dev);
@@ -1404,10 +1519,55 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
dbg << dev << "of type" << dev->devType();
}
- dbg << QString::fromLatin1("transformationType 0x%1").arg(transformationType, 3, 16, QLatin1Char('0'))
- << "simplePen" << simplePen
- << "clipType" << clipType
- << "compositionModeStatus" << compositionModeStatus;
+ dbg << "\n\t";
+
+
+ dbg << ((priv->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) ? "*" : "") << QString::fromLatin1("transformationType 0x%1").arg(priv->transformationType, 3, 16, QLatin1Char('0'));
+
+ dbg << priv->engine->state()->matrix;
+
+ dbg << "\n\t";
+
+
+
+ dbg << (priv->supportedBrush ? "" : "*") << "supportedBrush" << priv->supportedBrush;
+
+ dbg << priv->engine->state()->brush;
+
+ dbg << "\n\t";
+
+ const QGradient *gradient = priv->engine->state()->brush.gradient();
+ if (gradient) {
+ const QGradientStops &stops = gradient->stops();
+
+ dbg << "gradient: " << *gradient;
+ dbg << "stops: " << stops.count();
+ dbg << "\n\t";
+
+ for (int i=0; i<stops.count(); i++) {
+ dbg << stops[i].first << stops[i].second;
+ }
+ dbg << "\n\t";
+ }
+
+
+ dbg << (priv->supportedPen ? "" : "*") << "supportedPen" << priv->supportedPen;
+
+ dbg << priv->engine->state()->pen;
+
+ dbg << "\n\t";
+
+
+
+ dbg << (priv->clipType == QDirectFBPaintEnginePrivate::ComplexClip ? "*" : "") << "clipType" << priv->clipType;
+
+ dbg << "\n\t";
+
+
+ dbg << (priv->supportedComposition ? "" : "*") << "supportedComposition" << priv->supportedComposition;
+
+ dbg << "\n\t";
+
const T1 *t1 = ptr(one);
const T2 *t2 = ptr(two);
@@ -1428,3 +1588,4 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
QT_END_NAMESPACE
#endif // QT_NO_QWS_DIRECTFB
+
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
index a3217d0f32..b71671dd6b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h
@@ -97,6 +97,7 @@ public:
virtual void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode);
virtual void clipEnabledChanged();
+ virtual void brushChanged();
virtual void penChanged();
virtual void opacityChanged();
virtual void compositionModeChanged();
diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index 7c7c1d7370..a84c5ac091 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -103,7 +103,11 @@ symbian {
exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) {
HEADERS += $$PHONON_MMF_DIR/download.h
SOURCES += $$PHONON_MMF_DIR/download.cpp
- LIBS += -lDownloadMgr
+ contains(CONFIG, is_using_gnupoc) {
+ LIBS += -ldownloadmgr
+ } else {
+ LIBS += -lDownloadMgr
+ }
DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD
}
}
diff --git a/src/plugins/platforms/glxconvenience/glxconvenience.pri b/src/plugins/platforms/glxconvenience/glxconvenience.pri
index d6c992229e..b4d43a30b5 100644
--- a/src/plugins/platforms/glxconvenience/glxconvenience.pri
+++ b/src/plugins/platforms/glxconvenience/glxconvenience.pri
@@ -5,3 +5,11 @@ HEADERS += \
SOURCES += \
$$PWD/qglxconvenience.cpp
+
+CONFIG += xrender
+
+xrender {
+ LIBS += -lXrender
+} else {
+ DEFINES += QT_NO_XRENDER
+}
diff --git a/src/plugins/platforms/glxconvenience/qglxconvenience.cpp b/src/plugins/platforms/glxconvenience/qglxconvenience.cpp
index c776f5bbf8..34633d9692 100644
--- a/src/plugins/platforms/glxconvenience/qglxconvenience.cpp
+++ b/src/plugins/platforms/glxconvenience/qglxconvenience.cpp
@@ -43,6 +43,10 @@
#include <QtCore/QVector>
+#ifndef QT_NO_XRENDER
+#include <X11/extensions/Xrender.h>
+#endif
+
enum {
XFocusOut = FocusOut,
XFocusIn = FocusIn,
@@ -84,14 +88,15 @@ QVector<int> qglx_buildSpec(const QPlatformWindowFormat &format, int drawableBit
spec[i++] = GLX_ALPHA_SIZE; spec[i++] = (format.alphaBufferSize() == -1) ? 1 : format.alphaBufferSize();
}
- spec[i++] = GLX_ACCUM_RED_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
- spec[i++] = GLX_ACCUM_GREEN_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
- spec[i++] = GLX_ACCUM_BLUE_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
+ if (format.accum()) {
+ spec[i++] = GLX_ACCUM_RED_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
+ spec[i++] = GLX_ACCUM_GREEN_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
+ spec[i++] = GLX_ACCUM_BLUE_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
- if (format.alpha()) {
- spec[i++] = GLX_ACCUM_ALPHA_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
+ if (format.alpha()) {
+ spec[i++] = GLX_ACCUM_ALPHA_SIZE; spec[i++] = (format.accumBufferSize() == -1) ? 1 : format.accumBufferSize();
+ }
}
-
} else {
spec[i++] = GLX_RENDER_TYPE; spec[i++] = GLX_COLOR_INDEX_BIT; //I'm really not sure if this works....
spec[i++] = GLX_BUFFER_SIZE; spec[i++] = 8;
@@ -136,8 +141,17 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , const QPlatformWindow
if (reducedFormat.alpha()) {
int alphaSize;
glXGetFBConfigAttrib(display,configs[i],GLX_ALPHA_SIZE,&alphaSize);
- if (alphaSize > 0)
- break;
+ if (alphaSize > 0) {
+ XVisualInfo *visual = glXGetVisualFromFBConfig(display, chosenConfig);
+#if !defined(QT_NO_XRENDER)
+ XRenderPictFormat *pictFormat = XRenderFindVisualFormat(display, visual->visual);
+ if (pictFormat->direct.alphaMask > 0)
+ break;
+#else
+ if (visual->depth == 32)
+ break;
+#endif
+ }
} else {
break; // Just choose the first in the list if there's no alpha requested
}
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index 50c3626d55..b9ab528b50 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -50,8 +50,8 @@ QMinimalIntegration::QMinimalIntegration()
QMinimalScreen *mPrimaryScreen = new QMinimalScreen();
mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320);
- mPrimaryScreen->mDepth = 16;
- mPrimaryScreen->mFormat = QImage::Format_RGB16;
+ mPrimaryScreen->mDepth = 32;
+ mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
mScreens.append(mPrimaryScreen);
}
diff --git a/src/plugins/platforms/minimal/qminimalintegration.h b/src/plugins/platforms/minimal/qminimalintegration.h
index df4a9daba7..d1fcc42c68 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.h
+++ b/src/plugins/platforms/minimal/qminimalintegration.h
@@ -51,7 +51,7 @@ class QMinimalScreen : public QPlatformScreen
{
public:
QMinimalScreen()
- : mDepth(16), mFormat(QImage::Format_RGB16) {}
+ : mDepth(32), mFormat(QImage::Format_ARGB32_Premultiplied) {}
QRect geometry() const { return mGeometry; }
int depth() const { return mDepth; }
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
index 72ad5a8b6a..0f27501c71 100644
--- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
@@ -115,8 +115,15 @@ void *QWaylandGLContext::getProcAddress(const QString &string)
void QWaylandGLContext::setEglSurface(EGLSurface surface)
{
- doneCurrent();
+ bool wasCurrent = false;
+ if (QPlatformGLContext::currentContext() == this) {
+ wasCurrent = true;
+ doneCurrent();
+ }
mSurface = surface;
+ if (wasCurrent) {
+ makeCurrent();
+ }
}
EGLConfig QWaylandGLContext::eglConfig() const
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
index e53381ed67..dff6ffab66 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
@@ -132,10 +132,12 @@ void QWaylandXCompositeGLXContext::geometryChanged()
Colormap cmap = XCreateColormap(mGlxIntegration->xDisplay(),mGlxIntegration->rootWindow(),visualInfo->visual,AllocNone);
XSetWindowAttributes a;
+ a.background_pixel = WhitePixel(mGlxIntegration->xDisplay(), mGlxIntegration->screen());
+ a.border_pixel = BlackPixel(mGlxIntegration->xDisplay(), mGlxIntegration->screen());
a.colormap = cmap;
mXWindow = XCreateWindow(mGlxIntegration->xDisplay(), mGlxIntegration->rootWindow(),0, 0, size.width(), size.height(),
0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWColormap, &a);
+ CWBackPixel|CWBorderPixel|CWColormap, &a);
XCompositeRedirectWindow(mGlxIntegration->xDisplay(), mXWindow, CompositeRedirectManual);
XMapWindow(mGlxIntegration->xDisplay(), mXWindow);
diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland/qwaylandclipboard.cpp
index f2e6ccf2e4..b7f6ae535b 100644
--- a/src/plugins/platforms/wayland/qwaylandclipboard.cpp
+++ b/src/plugins/platforms/wayland/qwaylandclipboard.cpp
@@ -48,16 +48,54 @@
#include <QtCore/QStringList>
#include <QtCore/QFile>
#include <QtCore/QtDebug>
+#include <QtGui/private/qdnd_p.h>
static QWaylandClipboard *clipboard;
+class QWaylandMimeData : public QInternalMimeData
+{
+public:
+ void clearAll();
+ void setFormats(const QStringList &formatList);
+ bool hasFormat_sys(const QString &mimeType) const;
+ QStringList formats_sys() const;
+ QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const;
+private:
+ QStringList mFormatList;
+};
+
+void QWaylandMimeData::clearAll()
+{
+ clear();
+ mFormatList.clear();
+}
+
+void QWaylandMimeData::setFormats(const QStringList &formatList)
+{
+ mFormatList = formatList;
+}
+
+bool QWaylandMimeData::hasFormat_sys(const QString &mimeType) const
+{
+ return formats().contains(mimeType);
+}
+
+QStringList QWaylandMimeData::formats_sys() const
+{
+ return mFormatList;
+}
+
+QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::Type type) const
+{
+ return clipboard->retrieveData(mimeType, type);
+}
+
class QWaylandSelection
{
public:
QWaylandSelection(QWaylandDisplay *display, QMimeData *data);
~QWaylandSelection();
-private:
static uint32_t getTime();
static void send(void *data, struct wl_selection *selection, const char *mime_type, int fd);
static void cancelled(void *data, struct wl_selection *selection);
@@ -125,7 +163,7 @@ void QWaylandSelection::cancelled(void *data, struct wl_selection *selection)
}
QWaylandClipboard::QWaylandClipboard(QWaylandDisplay *display)
- : mDisplay(display), mSelection(0), mMimeDataIn(0), mOffer(0)
+ : mDisplay(display), mMimeDataIn(0), mOffer(0)
{
clipboard = this;
}
@@ -157,32 +195,39 @@ void QWaylandClipboard::forceRoundtrip(struct wl_display *display)
wl_display_iterate(display, WL_DISPLAY_READABLE);
}
-const QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) const
+QVariant QWaylandClipboard::retrieveData(const QString &mimeType, QVariant::Type type) const
+{
+ Q_UNUSED(type);
+ if (mOfferedMimeTypes.isEmpty() || !mOffer)
+ return QVariant();
+ int pipefd[2];
+ if (pipe(pipefd) == -1) {
+ qWarning("QWaylandClipboard: pipe() failed");
+ return QVariant();
+ }
+ QByteArray mimeTypeBa = mimeType.toLatin1();
+ wl_selection_offer_receive(mOffer, mimeTypeBa.constData(), pipefd[1]);
+ QByteArray content;
+ forceRoundtrip(mDisplay->wl_display());
+ char buf[256];
+ int n;
+ close(pipefd[1]);
+ while ((n = read(pipefd[0], &buf, sizeof buf)) > 0)
+ content.append(buf, n);
+ close(pipefd[0]);
+ return content;
+}
+
+QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
{
Q_ASSERT(mode == QClipboard::Clipboard);
+ if (!mSelections.isEmpty())
+ return mSelections.last()->mMimeData;
if (!mMimeDataIn)
- mMimeDataIn = new QMimeData;
- mMimeDataIn->clear();
- if (!mOfferedMimeTypes.isEmpty() && mOffer) {
- foreach (const QString &mimeType, mOfferedMimeTypes) {
- int pipefd[2];
- if (pipe(pipefd) == -1) {
- qWarning("QWaylandClipboard::mimedata: pipe() failed");
- break;
- }
- QByteArray mimeTypeBa = mimeType.toLatin1();
- wl_selection_offer_receive(mOffer, mimeTypeBa.constData(), pipefd[1]);
- QByteArray content;
- forceRoundtrip(mDisplay->wl_display());
- char buf[256];
- int n;
- close(pipefd[1]);
- while ((n = read(pipefd[0], &buf, sizeof buf)) > 0)
- content.append(buf, n);
- close(pipefd[0]);
- mMimeDataIn->setData(mimeType, content);
- }
- }
+ mMimeDataIn = new QWaylandMimeData;
+ mMimeDataIn->clearAll();
+ if (!mOfferedMimeTypes.isEmpty() && mOffer)
+ mMimeDataIn->setFormats(mOfferedMimeTypes);
return mMimeDataIn;
}
@@ -192,7 +237,7 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
if (!mDisplay->inputDevices().isEmpty()) {
if (!data)
data = new QMimeData;
- mSelection = new QWaylandSelection(mDisplay, data);
+ mSelections.append(new QWaylandSelection(mDisplay, data));
} else {
qWarning("QWaylandClipboard::setMimeData: No input devices");
}
@@ -222,21 +267,27 @@ void QWaylandClipboard::offer(void *data,
struct wl_selection_offer *selection_offer,
const char *type)
{
+ Q_UNUSED(data);
Q_UNUSED(selection_offer);
- QWaylandClipboard *self = static_cast<QWaylandClipboard *>(data);
- self->mOfferedMimeTypes.append(QString::fromLatin1(type));
+ clipboard->mOfferedMimeTypes.append(QString::fromLatin1(type));
}
void QWaylandClipboard::keyboardFocus(void *data,
struct wl_selection_offer *selection_offer,
wl_input_device *input_device)
{
- QWaylandClipboard *self = static_cast<QWaylandClipboard *>(data);
+ Q_UNUSED(data);
if (!input_device) {
wl_selection_offer_destroy(selection_offer);
- self->mOffer = 0;
+ clipboard->mOffer = 0;
return;
}
- self->mOffer = selection_offer;
- self->emitChanged(QClipboard::Clipboard);
+ clipboard->mOffer = selection_offer;
+ if (clipboard->mSelections.isEmpty())
+ QMetaObject::invokeMethod(&clipboard->mEmitter, "emitChanged", Qt::QueuedConnection);
+}
+
+void QWaylandClipboardSignalEmitter::emitChanged()
+{
+ clipboard->emitChanged(QClipboard::Clipboard);
}
diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.h b/src/plugins/platforms/wayland/qwaylandclipboard.h
index dc51854df9..f45fb8da4c 100644
--- a/src/plugins/platforms/wayland/qwaylandclipboard.h
+++ b/src/plugins/platforms/wayland/qwaylandclipboard.h
@@ -44,18 +44,27 @@
#include <QtGui/QPlatformClipboard>
#include <QtCore/QStringList>
+#include <QtCore/QVariant>
class QWaylandDisplay;
class QWaylandSelection;
+class QWaylandMimeData;
struct wl_selection_offer;
+class QWaylandClipboardSignalEmitter : public QObject
+{
+ Q_OBJECT
+public slots:
+ void emitChanged();
+};
+
class QWaylandClipboard : public QPlatformClipboard
{
public:
QWaylandClipboard(QWaylandDisplay *display);
~QWaylandClipboard();
- const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) const;
+ QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
bool supportsMode(QClipboard::Mode mode) const;
@@ -63,6 +72,8 @@ public:
void createSelectionOffer(uint32_t id);
+ QVariant retrieveData(const QString &mimeType, QVariant::Type type) const;
+
private:
static void offer(void *data,
struct wl_selection_offer *selection_offer,
@@ -76,11 +87,11 @@ private:
static void forceRoundtrip(struct wl_display *display);
QWaylandDisplay *mDisplay;
- QWaylandSelection *mSelection;
- mutable QMimeData *mMimeDataIn;
+ QWaylandMimeData *mMimeDataIn;
QList<QWaylandSelection *> mSelections;
QStringList mOfferedMimeTypes;
struct wl_selection_offer *mOffer;
+ QWaylandClipboardSignalEmitter mEmitter;
};
#endif // QWAYLANDCLIPBOARD_H
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
index 14a8dcf38f..83516e9b4e 100644
--- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp
+++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
@@ -51,6 +51,10 @@
#include "gl_integration/qwaylandglintegration.h"
#endif
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+#include "windowmanager_integration/qwaylandwindowmanagerintegration.h"
+#endif
+
#include <QtCore/QAbstractEventDispatcher>
#include <QtGui/QApplication>
#include <QtGui/private/qapplication_p.h>
@@ -77,17 +81,17 @@ struct wl_buffer *QWaylandDisplay::createShmBuffer(int fd,
struct wl_visual *QWaylandDisplay::rgbVisual()
{
- return wl_display_get_rgb_visual(mDisplay);
+ return rgb_visual;
}
struct wl_visual *QWaylandDisplay::argbVisual()
{
- return wl_display_get_argb_visual(mDisplay);
+ return argb_visual;
}
struct wl_visual *QWaylandDisplay::argbPremultipliedVisual()
{
- return wl_display_get_premultiplied_argb_visual(mDisplay);
+ return premultiplied_argb_visual;
}
#ifdef QT_WAYLAND_GL_SUPPORT
@@ -97,6 +101,13 @@ QWaylandGLIntegration * QWaylandDisplay::eglIntegration()
}
#endif
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration()
+{
+ return mWindowManagerIntegration;
+}
+#endif
+
void QWaylandDisplay::shellHandleConfigure(void *data, struct wl_shell *shell,
uint32_t time, uint32_t edges,
struct wl_surface *surface,
@@ -116,6 +127,7 @@ const struct wl_shell_listener QWaylandDisplay::shellListener = {
};
QWaylandDisplay::QWaylandDisplay(void)
+ : argb_visual(0), premultiplied_argb_visual(0), rgb_visual(0)
{
mDisplay = wl_display_connect(NULL);
if (mDisplay == NULL) {
@@ -128,6 +140,11 @@ QWaylandDisplay::QWaylandDisplay(void)
#ifdef QT_WAYLAND_GL_SUPPORT
mEglIntegration = QWaylandGLIntegration::createGLIntegration(this);
#endif
+
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+ mWindowManagerIntegration = QWaylandWindowManagerIntegration::createIntegration(this);
+#endif
+
blockingReadEvents();
qRegisterMetaType<uint32_t>("uint32_t");
@@ -228,6 +245,11 @@ const struct wl_output_listener QWaylandDisplay::outputListener = {
QWaylandDisplay::outputHandleGeometry
};
+const struct wl_compositor_listener QWaylandDisplay::compositorListener = {
+ QWaylandDisplay::handleVisual,
+};
+
+
void QWaylandDisplay::waitForScreens()
{
flushRequests();
@@ -256,6 +278,8 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id,
wl_output_add_listener(output, &outputListener, this);
} else if (interface == "wl_compositor") {
mCompositor = wl_compositor_create(mDisplay, id, 1);
+ wl_compositor_add_listener(mCompositor,
+ &compositorListener, this);
} else if (interface == "wl_shm") {
mShm = wl_shm_create(mDisplay, id, 1);
} else if (interface == "wl_shell"){
@@ -271,3 +295,23 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id,
clipboard->createSelectionOffer(id);
}
}
+
+void QWaylandDisplay::handleVisual(void *data,
+ struct wl_compositor *compositor,
+ uint32_t id, uint32_t token)
+{
+ QWaylandDisplay *self = static_cast<QWaylandDisplay *>(data);
+
+ switch (token) {
+ case WL_COMPOSITOR_VISUAL_ARGB32:
+ self->argb_visual = wl_visual_create(self->mDisplay, id, 1);
+ break;
+ case WL_COMPOSITOR_VISUAL_PREMULTIPLIED_ARGB32:
+ self->premultiplied_argb_visual =
+ wl_visual_create(self->mDisplay, id, 1);
+ break;
+ case WL_COMPOSITOR_VISUAL_XRGB32:
+ self->rgb_visual = wl_visual_create(self->mDisplay, id, 1);
+ break;
+ }
+}
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland/qwaylanddisplay.h
index 7cb2df10b8..765be62eb4 100644
--- a/src/plugins/platforms/wayland/qwaylanddisplay.h
+++ b/src/plugins/platforms/wayland/qwaylanddisplay.h
@@ -55,6 +55,8 @@ class QWaylandBuffer;
class QPlatformScreen;
class QWaylandScreen;
class QWaylandGLIntegration;
+class QWaylandWindowManagerIntegration;
+
class QWaylandDisplay : public QObject {
Q_OBJECT
@@ -74,6 +76,11 @@ public:
#ifdef QT_WAYLAND_GL_SUPPORT
QWaylandGLIntegration *eglIntegration();
#endif
+
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+ QWaylandWindowManagerIntegration *windowManagerIntegration();
+#endif
+
void setCursor(QWaylandBuffer *buffer, int32_t x, int32_t y);
void syncCallback(wl_display_sync_func_t func, void *data);
@@ -109,7 +116,10 @@ private:
uint32_t mSocketMask;
+ struct wl_visual *argb_visual, *premultiplied_argb_visual, *rgb_visual;
+
static const struct wl_output_listener outputListener;
+ static const struct wl_compositor_listener compositorListener;
static int sourceUpdate(uint32_t mask, void *data);
static void displayHandleGlobal(struct wl_display *display,
uint32_t id,
@@ -120,10 +130,17 @@ private:
int32_t x, int32_t y,
int32_t width, int32_t height);
+ static void handleVisual(void *data,
+ struct wl_compositor *compositor,
+ uint32_t id, uint32_t token);
#ifdef QT_WAYLAND_GL_SUPPORT
QWaylandGLIntegration *mEglIntegration;
#endif
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+ QWaylandWindowManagerIntegration *mWindowManagerIntegration;
+#endif
+
static void shellHandleConfigure(void *data, struct wl_shell *shell,
uint32_t time, uint32_t edges,
struct wl_surface *surface,
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index 734591fe7d..333a953b29 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -46,6 +46,11 @@
#include "qwaylandinputdevice.h"
#include "qwaylandscreen.h"
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+#include "windowmanager_integration/qwaylandwindowmanagerintegration.h"
+#endif
+
+#include <QCoreApplication>
#include <QtGui/QWidget>
#include <QtGui/QWindowSystemInterface>
@@ -60,6 +65,11 @@ QWaylandWindow::QWaylandWindow(QWidget *window)
static WId id = 1;
mWindowId = id++;
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+ mDisplay->windowManagerIntegration()->mapClientToProcess(qApp->applicationPid());
+ mDisplay->windowManagerIntegration()->authenticateWithToken();
+#endif
+
mSurface = mDisplay->createSurface(this);
}
@@ -120,7 +130,6 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer)
}
}
-
void QWaylandWindow::damage(const QRegion &region)
{
//We have to do sync stuff before calling damage, or we might
diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro
index 76f8be5927..dca72fd2ed 100644
--- a/src/plugins/platforms/wayland/wayland.pro
+++ b/src/plugins/platforms/wayland/wayland.pro
@@ -40,8 +40,10 @@ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
INCLUDEPATH += $$PWD
include ($$PWD/gl_integration/gl_integration.pri)
+include ($$PWD/windowmanager_integration/windowmanager_integration.pri)
include (../fontdatabases/genericunix/genericunix.pri)
target.path += $$[QT_INSTALL_PLUGINS]/platforms
INSTALLS += target
+
diff --git a/src/plugins/platforms/wayland/wayland_sha1.txt b/src/plugins/platforms/wayland/wayland_sha1.txt
new file mode 100644
index 0000000000..d2624378e0
--- /dev/null
+++ b/src/plugins/platforms/wayland/wayland_sha1.txt
@@ -0,0 +1,3 @@
+This version of the Qt Wayland plugin is checked against the following sha1
+from the Wayland repository:
+eff7fc0d99be2e51eaa351785030c8d374ac71de
diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp
new file mode 100644
index 0000000000..e4a621814e
--- /dev/null
+++ b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the 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 "qwaylandwindowmanagerintegration.h"
+#include "qwaylandwindowmanager-client-protocol.h"
+
+#include <stdint.h>
+
+QWaylandWindowManagerIntegration *QWaylandWindowManagerIntegration::createIntegration(QWaylandDisplay *waylandDisplay)
+{
+ return new QWaylandWindowManagerIntegration(waylandDisplay);
+}
+
+QWaylandWindowManagerIntegration::QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay)
+ : mWaylandDisplay(waylandDisplay)
+ , mWaylandWindowManager(0)
+{
+ wl_display_add_global_listener(mWaylandDisplay->wl_display(),
+ QWaylandWindowManagerIntegration::wlHandleListenerGlobal,
+ this);
+}
+
+QWaylandWindowManagerIntegration::~QWaylandWindowManagerIntegration()
+{
+
+}
+
+struct wl_windowmanager *QWaylandWindowManagerIntegration::windowManager() const
+{
+ return mWaylandWindowManager;
+}
+
+void QWaylandWindowManagerIntegration::wlHandleListenerGlobal(wl_display *display, uint32_t id, const char *interface, uint32_t version, void *data)
+{
+ if (strcmp(interface, "wl_windowmanager") == 0) {
+ QWaylandWindowManagerIntegration *integration = static_cast<QWaylandWindowManagerIntegration *>(data);
+ integration->mWaylandWindowManager = wl_windowmanager_create(display, id);
+ }
+}
+
+void QWaylandWindowManagerIntegration::mapClientToProcess(long long processId)
+{
+ if (mWaylandWindowManager)
+ wl_windowmanager_map_client_to_process(mWaylandWindowManager, (uint32_t) processId);
+}
+
+void QWaylandWindowManagerIntegration::authenticateWithToken(const QByteArray &token)
+{
+ QByteArray authToken = token;
+ if (authToken.isEmpty())
+ authToken = qgetenv("WL_AUTHENTICATION_TOKEN");
+ if (mWaylandWindowManager)
+ wl_windowmanager_authenticate_with_token(mWaylandWindowManager, authToken.constData());
+}
diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h
new file mode 100644
index 0000000000..a79f2053b2
--- /dev/null
+++ b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the 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$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDWINDOWMANAGERINTEGRATION_H
+#define QWAYLANDWINDOWMANAGERINTEGRATION_H
+
+#include <QObject>
+#include "wayland-client.h"
+#include "qwaylanddisplay.h"
+
+class QWaylandWindowManagerIntegration
+{
+public:
+ explicit QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay);
+ virtual ~QWaylandWindowManagerIntegration();
+ static QWaylandWindowManagerIntegration *createIntegration(QWaylandDisplay *waylandDisplay);
+ struct wl_windowmanager *windowManager() const;
+
+ void mapSurfaceToProcess(struct wl_surface *surface, long long processId);
+ void mapClientToProcess(long long processId);
+ void authenticateWithToken(const QByteArray &token = QByteArray());
+
+private:
+ static void wlHandleListenerGlobal(wl_display *display, uint32_t id,
+ const char *interface, uint32_t version, void *data);
+
+private:
+ QWaylandDisplay *mWaylandDisplay;
+ struct wl_windowmanager *mWaylandWindowManager;
+};
+
+#endif // QWAYLANDWINDOWMANAGERINTEGRATION_H
diff --git a/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri b/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri
new file mode 100644
index 0000000000..664389a334
--- /dev/null
+++ b/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri
@@ -0,0 +1,16 @@
+DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
+
+contains(DEFINES, QT_WAYLAND_WINDOWMANAGER_SUPPORT) {
+
+ HEADERS += \
+ $$PWD/qwaylandwindowmanagerintegration.h
+
+ SOURCES += \
+ $$PWD/qwaylandwindowmanagerintegration.cpp
+
+ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/wayland
+ HEADERS += \
+ $$QT_SOURCE_TREE/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h
+ SOURCES += \
+ $$QT_SOURCE_TREE/src/3rdparty/wayland/wayland-windowmanager-protocol.c
+}
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index c687e4c29a..0a02c7eff5 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -113,7 +113,8 @@ QXcbWindow::QXcbWindow(QWidget *tlw)
#if defined(XCB_USE_GLX) || defined(XCB_USE_EGL)
if (tlw->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL
- && QApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
+ && QApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)
+ || tlw->platformWindowFormat().alpha())
{
#if defined(XCB_USE_GLX)
XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(m_screen),m_screen->screenNumber(), tlw->platformWindowFormat());
@@ -131,13 +132,17 @@ QXcbWindow::QXcbWindow(QWidget *tlw)
visualInfo = XGetVisualInfo(DISPLAY_FROM_XCB(this), VisualIDMask, &visualInfoTemplate, &matchingCount);
#endif //XCB_USE_GLX
if (visualInfo) {
+ m_depth = visualInfo->depth;
+ m_format = (m_depth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
Colormap cmap = XCreateColormap(DISPLAY_FROM_XCB(this), m_screen->root(), visualInfo->visual, AllocNone);
XSetWindowAttributes a;
+ a.background_pixel = WhitePixel(DISPLAY_FROM_XCB(this), m_screen->screenNumber());
+ a.border_pixel = BlackPixel(DISPLAY_FROM_XCB(this), m_screen->screenNumber());
a.colormap = cmap;
m_window = XCreateWindow(DISPLAY_FROM_XCB(this), m_screen->root(), tlw->x(), tlw->y(), tlw->width(), tlw->height(),
0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWColormap, &a);
+ CWBackPixel|CWBorderPixel|CWColormap, &a);
printf("created GL window: %d\n", m_window);
} else {
@@ -147,6 +152,8 @@ QXcbWindow::QXcbWindow(QWidget *tlw)
#endif //defined(XCB_USE_GLX) || defined(XCB_USE_EGL)
{
m_window = xcb_generate_id(xcb_connection());
+ m_depth = m_screen->screen()->root_depth;
+ m_format = (m_depth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
Q_XCB_CALL(xcb_create_window(xcb_connection(),
XCB_COPY_FROM_PARENT, // depth -- same as root
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 3f4d2d2853..69d0bc2f1d 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -44,6 +44,7 @@
#include <QtGui/QPlatformWindow>
#include <QtGui/QPlatformWindowFormat>
+#include <QtGui/QImage>
#include <xcb/xcb.h>
#include <xcb/sync.h>
@@ -74,6 +75,8 @@ public:
QPlatformGLContext *glContext() const;
xcb_window_t window() const { return m_window; }
+ uint depth() const { return m_depth; }
+ QImage::Format format() const { return m_format; }
void handleExposeEvent(const xcb_expose_event_t *event);
void handleClientMessageEvent(const xcb_client_message_event_t *event);
@@ -99,6 +102,9 @@ private:
xcb_window_t m_window;
QPlatformGLContext *m_context;
+ uint m_depth;
+ QImage::Format m_format;
+
xcb_sync_int64_t m_syncValue;
xcb_sync_counter_t m_syncCounter;
diff --git a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp
index 827a899c6a..4fcd207df3 100644
--- a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp
@@ -54,11 +54,12 @@
#include <stdio.h>
#include <qdebug.h>
+#include <qpainter.h>
class QXcbShmImage : public QXcbObject
{
public:
- QXcbShmImage(QXcbScreen *connection, const QSize &size);
+ QXcbShmImage(QXcbScreen *connection, const QSize &size, uint depth, QImage::Format format);
~QXcbShmImage() { destroy(); }
QImage *image() { return &m_qimage; }
@@ -81,7 +82,7 @@ private:
QRegion m_dirty;
};
-QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size)
+QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QImage::Format format)
: QXcbObject(screen->connection())
, m_gc(0)
, m_gc_window(0)
@@ -91,7 +92,7 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size)
size.width(),
size.height(),
XCB_IMAGE_FORMAT_Z_PIXMAP,
- screen->depth(),
+ depth,
0,
~0,
0);
@@ -111,7 +112,7 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size)
if (shmctl(m_shm_info.shmid, IPC_RMID, 0) == -1)
qWarning() << "QXcbWindowSurface: Error while marking the shared memory segment to be destroyed";
- m_qimage = QImage( (uchar*) m_xcb_image->data, m_xcb_image->width, m_xcb_image->height, m_xcb_image->stride, screen->format());
+ m_qimage = QImage( (uchar*) m_xcb_image->data, m_xcb_image->width, m_xcb_image->height, m_xcb_image->stride, format);
}
void QXcbShmImage::destroy()
@@ -189,6 +190,16 @@ QPaintDevice *QXcbWindowSurface::paintDevice()
void QXcbWindowSurface::beginPaint(const QRegion &region)
{
m_image->preparePaint(region);
+
+ if (m_image->image()->hasAlphaChannel()) {
+ QPainter p(m_image->image());
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ const QVector<QRect> rects = region.rects();
+ const QColor blank = Qt::transparent;
+ for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
+ p.fillRect(*it, blank);
+ }
+ }
}
void QXcbWindowSurface::endPaint(const QRegion &)
@@ -232,9 +243,10 @@ void QXcbWindowSurface::resize(const QSize &size)
QWindowSurface::resize(size);
QXcbScreen *screen = static_cast<QXcbScreen *>(QPlatformScreen::platformScreenForWidget(window()));
+ QXcbWindow* win = static_cast<QXcbWindow *>(window()->platformWindow());
delete m_image;
- m_image = new QXcbShmImage(screen, size);
+ m_image = new QXcbShmImage(screen, size, win->depth(), win->format());
Q_XCB_NOOP(connection());
m_syncingResize = true;
diff --git a/src/plugins/platforms/xlib/qxlibclipboard.cpp b/src/plugins/platforms/xlib/qxlibclipboard.cpp
index dbe81e0c87..2c1d91bde8 100644
--- a/src/plugins/platforms/xlib/qxlibclipboard.cpp
+++ b/src/plugins/platforms/xlib/qxlibclipboard.cpp
@@ -161,12 +161,11 @@ QXlibClipboard::QXlibClipboard(QXlibScreen *screen)
{
}
-const QMimeData * QXlibClipboard::mimeData(QClipboard::Mode mode) const
+QMimeData * QXlibClipboard::mimeData(QClipboard::Mode mode)
{
if (mode == QClipboard::Clipboard) {
if (!m_xClipboard) {
- QXlibClipboard *that = const_cast<QXlibClipboard *>(this);
- that->m_xClipboard = new QXlibClipboardMime(mode,that);
+ m_xClipboard = new QXlibClipboardMime(mode, this);
}
Window clipboardOwner = XGetSelectionOwner(screen()->display()->nativeDisplay(),QXlibStatic::atom(QXlibStatic::CLIPBOARD));
if (clipboardOwner == owner()) {
@@ -176,8 +175,7 @@ const QMimeData * QXlibClipboard::mimeData(QClipboard::Mode mode) const
}
} else if (mode == QClipboard::Selection) {
if (!m_xSelection) {
- QXlibClipboard *that = const_cast<QXlibClipboard *>(this);
- that->m_xSelection = new QXlibClipboardMime(mode,that);
+ m_xSelection = new QXlibClipboardMime(mode, this);
}
Window clipboardOwner = XGetSelectionOwner(screen()->display()->nativeDisplay(),XA_PRIMARY);
if (clipboardOwner == owner()) {
diff --git a/src/plugins/platforms/xlib/qxlibclipboard.h b/src/plugins/platforms/xlib/qxlibclipboard.h
index 5d78a7f962..8fdc18b7d4 100644
--- a/src/plugins/platforms/xlib/qxlibclipboard.h
+++ b/src/plugins/platforms/xlib/qxlibclipboard.h
@@ -51,7 +51,7 @@ class QXlibClipboard : public QPlatformClipboard
public:
QXlibClipboard(QXlibScreen *screen);
- const QMimeData *mimeData(QClipboard::Mode mode) const;
+ QMimeData *mimeData(QClipboard::Mode mode);
void setMimeData(QMimeData *data, QClipboard::Mode mode);
bool supportsMode(QClipboard::Mode mode) const;
diff --git a/src/plugins/platforms/xlib/qxlibintegration.cpp b/src/plugins/platforms/xlib/qxlibintegration.cpp
index 90ef066e93..02104d9f74 100644
--- a/src/plugins/platforms/xlib/qxlibintegration.cpp
+++ b/src/plugins/platforms/xlib/qxlibintegration.cpp
@@ -150,7 +150,7 @@ bool QXlibIntegration::hasOpenGL() const
{
#if !defined(QT_NO_OPENGL)
#if !defined(QT_OPENGL_ES_2)
- QXlibScreen *screen = static_cast<const QXlibScreen *>(mScreens.at(0));
+ QXlibScreen *screen = static_cast<QXlibScreen *>(mScreens.at(0));
return glXQueryExtension(screen->display()->nativeDisplay(), 0, 0) != 0;
#else
static bool eglHasbeenInitialized = false;
diff --git a/src/plugins/platforms/xlib/qxlibscreen.cpp b/src/plugins/platforms/xlib/qxlibscreen.cpp
index 8f21ec34c5..b069985a5c 100644
--- a/src/plugins/platforms/xlib/qxlibscreen.cpp
+++ b/src/plugins/platforms/xlib/qxlibscreen.cpp
@@ -41,6 +41,8 @@
#include "qxlibscreen.h"
+#include <X11/extensions/Xfixes.h>
+
#include "qxlibcursor.h"
#include "qxlibwindow.h"
#include "qxlibkeyboard.h"
diff --git a/src/plugins/platforms/xlib/qxlibstatic.h b/src/plugins/platforms/xlib/qxlibstatic.h
index b46b28db95..9caa2fac36 100644
--- a/src/plugins/platforms/xlib/qxlibstatic.h
+++ b/src/plugins/platforms/xlib/qxlibstatic.h
@@ -136,6 +136,7 @@ typedef char *XPointer;
#endif
#ifndef QT_NO_XFIXES
+#include <X11/extensions/Xfixes.h>
typedef Bool (*PtrXFixesQueryExtension)(Display *, int *, int *);
typedef Status (*PtrXFixesQueryVersion)(Display *, int *, int *);
typedef void (*PtrXFixesSetCursorName)(Display *dpy, Cursor cursor, const char *name);
diff --git a/src/plugins/platforms/xlib/qxlibwindow.cpp b/src/plugins/platforms/xlib/qxlibwindow.cpp
index 1666b1c7e3..823fae9de3 100644
--- a/src/plugins/platforms/xlib/qxlibwindow.cpp
+++ b/src/plugins/platforms/xlib/qxlibwindow.cpp
@@ -47,14 +47,6 @@
#include "qxlibstatic.h"
#include "qxlibdisplay.h"
-#include <QtGui/QWindowSystemInterface>
-#include <QSocketNotifier>
-#include <QApplication>
-#include <QDebug>
-
-#include <QtGui/private/qwindowsurface_p.h>
-#include <QtGui/private/qapplication_p.h>
-
#if !defined(QT_NO_OPENGL)
#if !defined(QT_OPENGL_ES_2)
#include "qglxintegration.h"
@@ -66,6 +58,15 @@
#endif //QT_OPENGL_ES_2
#endif //QT_NO_OPENGL
+
+#include <QtGui/QWindowSystemInterface>
+#include <QSocketNotifier>
+#include <QApplication>
+#include <QDebug>
+
+#include <QtGui/private/qwindowsurface_p.h>
+#include <QtGui/private/qapplication_p.h>
+
//#define MYX11_DEBUG
QT_BEGIN_NAMESPACE
@@ -80,9 +81,10 @@ QXlibWindow::QXlibWindow(QWidget *window)
int w = window->width();
int h = window->height();
- if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL
- && QApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL) ) {
#if !defined(QT_NO_OPENGL)
+ if(window->platformWindowFormat().windowApi() == QPlatformWindowFormat::OpenGL
+ && QApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)
+ || window->platformWindowFormat().alpha()) {
#if !defined(QT_OPENGL_ES_2)
XVisualInfo *visualInfo = qglx_findVisualInfo(mScreen->display()->nativeDisplay(),mScreen->xScreenNumber(),window->platformWindowFormat());
#else
@@ -101,18 +103,28 @@ QXlibWindow::QXlibWindow(QWidget *window)
visualInfo = XGetVisualInfo(mScreen->display()->nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount);
#endif //!defined(QT_OPENGL_ES_2)
if (visualInfo) {
- Colormap cmap = XCreateColormap(mScreen->display()->nativeDisplay(),mScreen->rootWindow(),visualInfo->visual,AllocNone);
+ mDepth = visualInfo->depth;
+ mFormat = (mDepth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ mVisual = visualInfo->visual;
+ Colormap cmap = XCreateColormap(mScreen->display()->nativeDisplay(), mScreen->rootWindow(), visualInfo->visual, AllocNone);
XSetWindowAttributes a;
+ a.background_pixel = WhitePixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
+ a.border_pixel = BlackPixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
a.colormap = cmap;
x_window = XCreateWindow(mScreen->display()->nativeDisplay(), mScreen->rootWindow(),x, y, w, h,
0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWColormap, &a);
+ CWBackPixel|CWBorderPixel|CWColormap, &a);
} else {
qFatal("no window!");
}
+ } else
#endif //!defined(QT_NO_OPENGL)
- } else {
+ {
+ mDepth = mScreen->depth();
+ mFormat = (mDepth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ mVisual = mScreen->defaultVisual();
+
x_window = XCreateSimpleWindow(mScreen->display()->nativeDisplay(), mScreen->rootWindow(),
x, y, w, h, 0 /*border_width*/,
mScreen->blackPixel(), mScreen->whitePixel());
diff --git a/src/plugins/platforms/xlib/qxlibwindow.h b/src/plugins/platforms/xlib/qxlibwindow.h
index adc2f85887..da29efbff1 100644
--- a/src/plugins/platforms/xlib/qxlibwindow.h
+++ b/src/plugins/platforms/xlib/qxlibwindow.h
@@ -122,6 +122,10 @@ public:
Window xWindow() const;
GC graphicsContext() const;
+ inline uint depth() const { return mDepth; }
+ QImage::Format format() const { return mFormat; }
+ Visual* visual() const { return mVisual; }
+
protected:
QVector<Atom> getNetWmState() const;
void setMWMHints(const QXlibMWMHints &mwmhints);
@@ -135,6 +139,10 @@ private:
Window x_window;
GC gc;
+ uint mDepth;
+ QImage::Format mFormat;
+ Visual* mVisual;
+
GC createGC();
QPlatformGLContext *mGLContext;
diff --git a/src/plugins/platforms/xlib/qxlibwindowsurface.cpp b/src/plugins/platforms/xlib/qxlibwindowsurface.cpp
index add21ac58f..e0c272d110 100644
--- a/src/plugins/platforms/xlib/qxlibwindowsurface.cpp
+++ b/src/plugins/platforms/xlib/qxlibwindowsurface.cpp
@@ -49,6 +49,8 @@
#include "qxlibscreen.h"
#include "qxlibdisplay.h"
+#include "qpainter.h"
+
# include <sys/ipc.h>
# include <sys/shm.h>
# include <X11/extensions/XShm.h>
@@ -80,20 +82,19 @@ void QXlibShmImageInfo::destroy()
void QXlibWindowSurface::resizeShmImage(int width, int height)
{
+ QXlibScreen *screen = QXlibScreen::testLiteScreenForWidget(window());
+ QXlibWindow *win = static_cast<QXlibWindow*>(window()->platformWindow());
#ifdef DONT_USE_MIT_SHM
- shm_img = QImage(width, height, QImage::Format_RGB32);
+ shm_img = QImage(width, height, win->format());
#else
- QXlibScreen *screen = QXlibScreen::testLiteScreenForWidget(window());
if (image_info)
image_info->destroy();
else
image_info = new QXlibShmImageInfo(screen->display()->nativeDisplay());
- Visual *visual = screen->defaultVisual();
-
- XImage *image = XShmCreateImage (screen->display()->nativeDisplay(), visual, 24, ZPixmap, 0,
+ XImage *image = XShmCreateImage (screen->display()->nativeDisplay(), win->visual(), win->depth(), ZPixmap, 0,
&image_info->shminfo, width, height);
@@ -109,7 +110,7 @@ void QXlibWindowSurface::resizeShmImage(int width, int height)
Q_ASSERT(shm_attach_status == True);
- shm_img = QImage( (uchar*) image->data, image->width, image->height, image->bytes_per_line, QImage::Format_RGB32 );
+ shm_img = QImage( (uchar*) image->data, image->width, image->height, image->bytes_per_line, win->format() );
#endif
painted = false;
}
@@ -160,11 +161,11 @@ void QXlibWindowSurface::flush(QWidget *widget, const QRegion &region, const QPo
#ifdef DONT_USE_MIT_SHM
// just convert the image every time...
if (!shm_img.isNull()) {
- Visual *visual = DefaultVisual(screen->display(), screen->xScreenNumber());
+ QXlibWindow *win = static_cast<QXlibWindow*>(window()->platformWindow());
QImage image = shm_img;
//img.convertToFormat(
- XImage *xi = XCreateImage(screen->display(), visual, 24, ZPixmap,
+ XImage *xi = XCreateImage(screen->display(), win->visual(), win->depth(), ZPixmap,
0, (char *) image.scanLine(0), image.width(), image.height(),
32, image.bytesPerLine());
@@ -214,6 +215,16 @@ void QXlibWindowSurface::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
resizeBuffer(size());
+
+ if (shm_img.hasAlphaChannel()) {
+ QPainter p(&shm_img);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ const QVector<QRect> rects = region.rects();
+ const QColor blank = Qt::transparent;
+ for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
+ p.fillRect(*it, blank);
+ }
+ }
}
void QXlibWindowSurface::endPaint(const QRegion &region)
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 2d0c2016dc..94ce675f26 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -11,7 +11,6 @@ unix:!symbian {
embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers
!win32:!embedded:!mac:!symbian:!contains(QT_CONFIG, no-gui):SUBDIRS *= inputmethods
!symbian:!contains(QT_CONFIG, no-gui):SUBDIRS += accessible
-symbian:SUBDIRS += s60
contains(QT_CONFIG, phonon): SUBDIRS *= phonon
qpa:SUBDIRS += platforms
contains(QT_CONFIG, declarative): SUBDIRS *= qmltooling
diff --git a/src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro b/src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro
deleted file mode 100644
index e7a69f2f68..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro
+++ /dev/null
@@ -1,51 +0,0 @@
-TARGET = declarativeobserver
-QT += declarative
-
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling
-QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
-
-SOURCES += \
- qdeclarativeobserverplugin.cpp \
- qdeclarativeviewobserver.cpp \
- editor/abstractliveedittool.cpp \
- editor/liveselectiontool.cpp \
- editor/livelayeritem.cpp \
- editor/livesingleselectionmanipulator.cpp \
- editor/liverubberbandselectionmanipulator.cpp \
- editor/liveselectionrectangle.cpp \
- editor/liveselectionindicator.cpp \
- editor/boundingrecthighlighter.cpp \
- editor/subcomponentmasklayeritem.cpp \
- editor/zoomtool.cpp \
- editor/colorpickertool.cpp \
- editor/qmltoolbar.cpp \
- editor/toolbarcolorbox.cpp
-
-HEADERS += \
- qdeclarativeobserverplugin.h \
- qdeclarativeobserverprotocol.h \
- qdeclarativeviewobserver_p.h \
- qdeclarativeviewobserver_p_p.h \
- qmlobserverconstants_p.h \
- editor/abstractliveedittool_p.h \
- editor/liveselectiontool_p.h \
- editor/livelayeritem_p.h \
- editor/livesingleselectionmanipulator_p.h \
- editor/liverubberbandselectionmanipulator_p.h \
- editor/liveselectionrectangle_p.h \
- editor/liveselectionindicator_p.h \
- editor/boundingrecthighlighter_p.h \
- editor/subcomponentmasklayeritem_p.h \
- editor/zoomtool_p.h \
- editor/colorpickertool_p.h \
- editor/qmltoolbar_p.h \
- editor/toolbarcolorbox_p.h
-
-RESOURCES += editor/editor.qrc
-
-target.path += $$[QT_INSTALL_PLUGINS]/qmltooling
-INSTALLS += target
-
-symbian:TARGET.UID3=0x20031E90
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp
deleted file mode 100644
index a97a537cd6..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "abstractliveedittool_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
-
-#include <QDeclarativeEngine>
-
-#include <QtDebug>
-#include <QGraphicsItem>
-#include <QDeclarativeItem>
-
-QT_BEGIN_NAMESPACE
-
-AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewObserver *editorView)
- : QObject(editorView), m_observer(editorView)
-{
-}
-
-
-AbstractLiveEditTool::~AbstractLiveEditTool()
-{
-}
-
-QDeclarativeViewObserver *AbstractLiveEditTool::observer() const
-{
- return m_observer;
-}
-
-QDeclarativeView *AbstractLiveEditTool::view() const
-{
- return m_observer->declarativeView();
-}
-
-QGraphicsScene* AbstractLiveEditTool::scene() const
-{
- return view()->scene();
-}
-
-void AbstractLiveEditTool::updateSelectedItems()
-{
- selectedItemsChanged(items());
-}
-
-QList<QGraphicsItem*> AbstractLiveEditTool::items() const
-{
- return observer()->selectedItems();
-}
-
-bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList)
-{
- QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
- if (firstSelectableItem == 0)
- return false;
- if (toQDeclarativeItem(firstSelectableItem) != 0)
- return true;
-
- return false;
-
-}
-
-bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList)
-{
- QList<QGraphicsItem*> selectedItems = observer()->selectedItems();
-
- foreach (QGraphicsItem *item, itemList) {
- QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
- if (declarativeItem
- && selectedItems.contains(declarativeItem)
- /*&& (declarativeItem->qmlItemNode().hasShowContent() || selectNonContentItems)*/)
- return true;
- }
-
- return false;
-
-}
-
-bool AbstractLiveEditTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/)
-{
- return false;
-}
-
-QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
-{
- return qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
-}
-
-QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)
-{
- foreach (QGraphicsItem *item, itemList) {
- if (item->flags().testFlag(QGraphicsItem::ItemIsMovable))
- return item;
- }
- return 0;
-}
-
-QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList<QGraphicsItem*>
- &itemList)
-{
- foreach (QGraphicsItem *item, itemList) {
- QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
- if (declarativeItem /*&& (declarativeItem->qmlItemNode().hasShowContent())*/)
- return declarativeItem;
- }
-
- return 0;
-}
-
-QList<QGraphicsObject*> AbstractLiveEditTool::toGraphicsObjectList(const QList<QGraphicsItem*>
- &itemList)
-{
- QList<QGraphicsObject*> gfxObjects;
- foreach (QGraphicsItem *item, itemList) {
- QGraphicsObject *obj = item->toGraphicsObject();
- if (obj)
- gfxObjects << obj;
- }
-
- return gfxObjects;
-}
-
-QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item)
-{
- QString className(QLatin1String("QGraphicsItem"));
- QString objectStringId;
-
- QString constructedName;
-
- QGraphicsObject *gfxObject = item->toGraphicsObject();
- if (gfxObject) {
- className = QLatin1String(gfxObject->metaObject()->className());
-
- className.remove(QRegExp(QLatin1String("_QMLTYPE_\\d+")));
- className.remove(QRegExp(QLatin1String("_QML_\\d+")));
- if (className.startsWith(QLatin1String("QDeclarative")))
- className = className.remove(QLatin1String("QDeclarative"));
-
- QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(gfxObject);
- if (declarativeItem) {
- objectStringId = m_observer->idStringForObject(declarativeItem);
- }
-
- if (!objectStringId.isEmpty()) {
- constructedName = objectStringId + QLatin1String(" (") + className + QLatin1Char(')');
- } else {
- if (!gfxObject->objectName().isEmpty()) {
- constructedName = gfxObject->objectName() + QLatin1String(" (") + className + QLatin1Char(')');
- } else {
- constructedName = className;
- }
- }
- }
-
- return constructedName;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h
deleted file mode 100644
index 97aac35366..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef ABSTRACTLIVEEDITTOOL_H
-#define ABSTRACTLIVEEDITTOOL_H
-
-#include <QtCore/QList>
-#include <QtCore/QObject>
-
-QT_BEGIN_NAMESPACE
-class QMouseEvent;
-class QGraphicsItem;
-class QDeclarativeItem;
-class QKeyEvent;
-class QGraphicsScene;
-class QGraphicsObject;
-class QWheelEvent;
-class QDeclarativeView;
-QT_END_NAMESPACE
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-
-class AbstractLiveEditTool : public QObject
-{
- Q_OBJECT
-public:
- AbstractLiveEditTool(QDeclarativeViewObserver *observer);
-
- virtual ~AbstractLiveEditTool();
-
- virtual void mousePressEvent(QMouseEvent *event) = 0;
- virtual void mouseMoveEvent(QMouseEvent *event) = 0;
- virtual void mouseReleaseEvent(QMouseEvent *event) = 0;
- virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0;
-
- virtual void hoverMoveEvent(QMouseEvent *event) = 0;
- virtual void wheelEvent(QWheelEvent *event) = 0;
-
- virtual void keyPressEvent(QKeyEvent *event) = 0;
- virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
- virtual void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList) = 0;
-
- virtual void clear() = 0;
-
- void updateSelectedItems();
- QList<QGraphicsItem*> items() const;
-
- bool topItemIsMovable(const QList<QGraphicsItem*> &itemList);
- bool topItemIsResizeHandle(const QList<QGraphicsItem*> &itemList);
- bool topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList);
-
- QString titleForItem(QGraphicsItem *item);
-
- static QList<QGraphicsObject*> toGraphicsObjectList(const QList<QGraphicsItem*> &itemList);
- static QGraphicsItem* topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList);
- static QDeclarativeItem* topMovableDeclarativeItem(const QList<QGraphicsItem*> &itemList);
- static QDeclarativeItem *toQDeclarativeItem(QGraphicsItem *item);
-
-protected:
- virtual void selectedItemsChanged(const QList<QGraphicsItem*> &objectList) = 0;
-
- QDeclarativeViewObserver *observer() const;
- QDeclarativeView *view() const;
- QGraphicsScene *scene() const;
-
-private:
- QDeclarativeViewObserver *m_observer;
- QList<QGraphicsItem*> m_itemList;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // ABSTRACTLIVEEDITTOOL_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp b/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp
deleted file mode 100644
index e9594d50a6..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "boundingrecthighlighter_p.h"
-
-#include "../qdeclarativeviewobserver_p.h"
-#include "../qmlobserverconstants_p.h"
-
-#include <QtGui/QGraphicsPolygonItem>
-
-#include <QtCore/QTimer>
-#include <QtCore/QObject>
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-const qreal AnimDelta = 0.025f;
-const int AnimInterval = 30;
-const int AnimFrames = 10;
-
-BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
- QObject *parent)
- : QObject(parent),
- highlightedObject(itemToHighlight),
- highlightPolygon(0),
- highlightPolygonEdge(0)
-{
- highlightPolygon = new BoundingBoxPolygonItem(parentItem);
- highlightPolygonEdge = new BoundingBoxPolygonItem(parentItem);
-
- highlightPolygon->setPen(QPen(QColor(0, 22, 159)));
- highlightPolygonEdge->setPen(QPen(QColor(158, 199, 255)));
-
- highlightPolygon->setFlag(QGraphicsItem::ItemIsSelectable, false);
- highlightPolygonEdge->setFlag(QGraphicsItem::ItemIsSelectable, false);
-}
-
-BoundingBox::~BoundingBox()
-{
- highlightedObject.clear();
-}
-
-BoundingBoxPolygonItem::BoundingBoxPolygonItem(QGraphicsItem *item) : QGraphicsPolygonItem(item)
-{
- QPen pen;
- pen.setColor(QColor(108, 141, 221));
- pen.setWidth(1);
- setPen(pen);
-}
-
-int BoundingBoxPolygonItem::type() const
-{
- return Constants::EditorItemType;
-}
-
-BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewObserver *view) :
- LiveLayerItem(view->declarativeView()->scene()),
- m_view(view),
- m_animFrame(0)
-{
- m_animTimer = new QTimer(this);
- m_animTimer->setInterval(AnimInterval);
- connect(m_animTimer, SIGNAL(timeout()), SLOT(animTimeout()));
-}
-
-BoundingRectHighlighter::~BoundingRectHighlighter()
-{
-
-}
-
-void BoundingRectHighlighter::animTimeout()
-{
- ++m_animFrame;
- if (m_animFrame == AnimFrames) {
- m_animTimer->stop();
- }
-
- qreal alpha = m_animFrame / float(AnimFrames);
-
- foreach (BoundingBox *box, m_boxes) {
- box->highlightPolygonEdge->setOpacity(alpha);
- }
-}
-
-void BoundingRectHighlighter::clear()
-{
- if (m_boxes.length()) {
- m_animTimer->stop();
-
- foreach (BoundingBox *box, m_boxes) {
- freeBoundingBox(box);
- }
- }
-}
-
-BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const
-{
- foreach (BoundingBox *box, m_boxes) {
- if (box->highlightedObject.data() == item) {
- return box;
- }
- }
- return 0;
-}
-
-void BoundingRectHighlighter::highlight(QList<QGraphicsObject*> items)
-{
- if (items.isEmpty())
- return;
-
- bool animate = false;
-
- QList<BoundingBox *> newBoxes;
- foreach (QGraphicsObject *itemToHighlight, items) {
- BoundingBox *box = boxFor(itemToHighlight);
- if (!box) {
- box = createBoundingBox(itemToHighlight);
- animate = true;
- }
-
- newBoxes << box;
- }
- qSort(newBoxes);
-
- if (newBoxes != m_boxes) {
- clear();
- m_boxes << newBoxes;
- }
-
- highlightAll(animate);
-}
-
-void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight)
-{
- if (!itemToHighlight)
- return;
-
- bool animate = false;
-
- BoundingBox *box = boxFor(itemToHighlight);
- if (!box) {
- box = createBoundingBox(itemToHighlight);
- m_boxes << box;
- animate = true;
- qSort(m_boxes);
- }
-
- highlightAll(animate);
-}
-
-BoundingBox *BoundingRectHighlighter::createBoundingBox(QGraphicsObject *itemToHighlight)
-{
- if (!m_freeBoxes.isEmpty()) {
- BoundingBox *box = m_freeBoxes.last();
- if (box->highlightedObject.isNull()) {
- box->highlightedObject = itemToHighlight;
- box->highlightPolygon->show();
- box->highlightPolygonEdge->show();
- m_freeBoxes.removeLast();
- return box;
- }
- }
-
- BoundingBox *box = new BoundingBox(itemToHighlight, this, this);
-
- connect(itemToHighlight, SIGNAL(xChanged()), this, SLOT(refresh()));
- connect(itemToHighlight, SIGNAL(yChanged()), this, SLOT(refresh()));
- connect(itemToHighlight, SIGNAL(widthChanged()), this, SLOT(refresh()));
- connect(itemToHighlight, SIGNAL(heightChanged()), this, SLOT(refresh()));
- connect(itemToHighlight, SIGNAL(rotationChanged()), this, SLOT(refresh()));
- connect(itemToHighlight, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*)));
-
- return box;
-}
-
-void BoundingRectHighlighter::removeBoundingBox(BoundingBox *box)
-{
- delete box;
- box = 0;
-}
-
-void BoundingRectHighlighter::freeBoundingBox(BoundingBox *box)
-{
- if (!box->highlightedObject.isNull()) {
- disconnect(box->highlightedObject.data(), SIGNAL(xChanged()), this, SLOT(refresh()));
- disconnect(box->highlightedObject.data(), SIGNAL(yChanged()), this, SLOT(refresh()));
- disconnect(box->highlightedObject.data(), SIGNAL(widthChanged()), this, SLOT(refresh()));
- disconnect(box->highlightedObject.data(), SIGNAL(heightChanged()), this, SLOT(refresh()));
- disconnect(box->highlightedObject.data(), SIGNAL(rotationChanged()), this, SLOT(refresh()));
- }
-
- box->highlightedObject.clear();
- box->highlightPolygon->hide();
- box->highlightPolygonEdge->hide();
- m_boxes.removeOne(box);
- m_freeBoxes << box;
-}
-
-void BoundingRectHighlighter::itemDestroyed(QObject *obj)
-{
- foreach (BoundingBox *box, m_boxes) {
- if (box->highlightedObject.data() == obj) {
- freeBoundingBox(box);
- break;
- }
- }
-}
-
-void BoundingRectHighlighter::highlightAll(bool animate)
-{
- foreach (BoundingBox *box, m_boxes) {
- if (box && box->highlightedObject.isNull()) {
- // clear all highlights
- clear();
- return;
- }
- QGraphicsObject *item = box->highlightedObject.data();
-
- QRectF boundingRectInSceneSpace(item->mapToScene(item->boundingRect()).boundingRect());
- QRectF boundingRectInLayerItemSpace = mapRectFromScene(boundingRectInSceneSpace);
- QRectF bboxRect = m_view->adjustToScreenBoundaries(boundingRectInLayerItemSpace);
- QRectF edgeRect = bboxRect;
- edgeRect.adjust(-1, -1, 1, 1);
-
- box->highlightPolygon->setPolygon(QPolygonF(bboxRect));
- box->highlightPolygonEdge->setPolygon(QPolygonF(edgeRect));
-
- if (animate)
- box->highlightPolygonEdge->setOpacity(0);
- }
-
- if (animate) {
- m_animFrame = 0;
- m_animTimer->start();
- }
-}
-
-void BoundingRectHighlighter::refresh()
-{
- if (!m_boxes.isEmpty())
- highlightAll(true);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h b/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h
deleted file mode 100644
index ab7e595acd..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef BOUNDINGRECTHIGHLIGHTER_H
-#define BOUNDINGRECTHIGHLIGHTER_H
-
-#include "livelayeritem_p.h"
-
-#include <QtCore/QObject>
-#include <QtCore/QWeakPointer>
-
-QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
-QT_FORWARD_DECLARE_CLASS(QPainter)
-QT_FORWARD_DECLARE_CLASS(QWidget)
-QT_FORWARD_DECLARE_CLASS(QStyleOptionGraphicsItem)
-QT_FORWARD_DECLARE_CLASS(QTimer)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-class BoundingBox;
-
-class BoundingRectHighlighter : public LiveLayerItem
-{
- Q_OBJECT
-public:
- explicit BoundingRectHighlighter(QDeclarativeViewObserver *view);
- ~BoundingRectHighlighter();
- void clear();
- void highlight(QList<QGraphicsObject*> items);
- void highlight(QGraphicsObject* item);
-
-private slots:
- void refresh();
- void animTimeout();
- void itemDestroyed(QObject *);
-
-private:
- BoundingBox *boxFor(QGraphicsObject *item) const;
- void highlightAll(bool animate);
- BoundingBox *createBoundingBox(QGraphicsObject *itemToHighlight);
- void removeBoundingBox(BoundingBox *box);
- void freeBoundingBox(BoundingBox *box);
-
-private:
- Q_DISABLE_COPY(BoundingRectHighlighter)
-
- QDeclarativeViewObserver *m_view;
- QList<BoundingBox* > m_boxes;
- QList<BoundingBox* > m_freeBoxes;
- QTimer *m_animTimer;
- qreal m_animScale;
- int m_animFrame;
-
-};
-
-class BoundingBox : public QObject
-{
- Q_OBJECT
-public:
- explicit BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
- QObject *parent = 0);
- ~BoundingBox();
- QWeakPointer<QGraphicsObject> highlightedObject;
- QGraphicsPolygonItem *highlightPolygon;
- QGraphicsPolygonItem *highlightPolygonEdge;
-
-private:
- Q_DISABLE_COPY(BoundingBox)
-
-};
-
-class BoundingBoxPolygonItem : public QGraphicsPolygonItem
-{
-public:
- explicit BoundingBoxPolygonItem(QGraphicsItem *item);
- int type() const;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // BOUNDINGRECTHIGHLIGHTER_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp
deleted file mode 100644
index 50d724e9e0..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "colorpickertool_p.h"
-
-#include "../qdeclarativeviewobserver_p.h"
-
-#include <QtGui/QMouseEvent>
-#include <QtGui/QKeyEvent>
-#include <QtCore/QRectF>
-#include <QtGui/QRgb>
-#include <QtGui/QImage>
-#include <QtGui/QApplication>
-#include <QtGui/QPalette>
-
-QT_BEGIN_NAMESPACE
-
-ColorPickerTool::ColorPickerTool(QDeclarativeViewObserver *view) :
- AbstractLiveEditTool(view)
-{
- m_selectedColor.setRgb(0,0,0);
-}
-
-ColorPickerTool::~ColorPickerTool()
-{
-
-}
-
-void ColorPickerTool::mousePressEvent(QMouseEvent * /*event*/)
-{
-}
-
-void ColorPickerTool::mouseMoveEvent(QMouseEvent *event)
-{
- pickColor(event->pos());
-}
-
-void ColorPickerTool::mouseReleaseEvent(QMouseEvent *event)
-{
- pickColor(event->pos());
-}
-
-void ColorPickerTool::mouseDoubleClickEvent(QMouseEvent * /*event*/)
-{
-}
-
-
-void ColorPickerTool::hoverMoveEvent(QMouseEvent * /*event*/)
-{
-}
-
-void ColorPickerTool::keyPressEvent(QKeyEvent * /*event*/)
-{
-}
-
-void ColorPickerTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/)
-{
-}
-void ColorPickerTool::wheelEvent(QWheelEvent * /*event*/)
-{
-}
-
-void ColorPickerTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
-{
-}
-
-void ColorPickerTool::clear()
-{
- view()->setCursor(Qt::CrossCursor);
-}
-
-void ColorPickerTool::selectedItemsChanged(const QList<QGraphicsItem*> &/*itemList*/)
-{
-}
-
-void ColorPickerTool::pickColor(const QPoint &pos)
-{
- QRgb fillColor = view()->backgroundBrush().color().rgb();
- if (view()->backgroundBrush().style() == Qt::NoBrush)
- fillColor = view()->palette().color(QPalette::Base).rgb();
-
- QRectF target(0,0, 1, 1);
- QRect source(pos.x(), pos.y(), 1, 1);
- QImage img(1, 1, QImage::Format_ARGB32);
- img.fill(fillColor);
- QPainter painter(&img);
- view()->render(&painter, target, source);
- m_selectedColor = QColor::fromRgb(img.pixel(0, 0));
-
- emit selectedColorChanged(m_selectedColor);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h
deleted file mode 100644
index b955eeec4b..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef COLORPICKERTOOL_H
-#define COLORPICKERTOOL_H
-
-#include "abstractliveedittool_p.h"
-
-#include <QtGui/QColor>
-
-QT_FORWARD_DECLARE_CLASS(QPoint)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class ColorPickerTool : public AbstractLiveEditTool
-{
- Q_OBJECT
-public:
- explicit ColorPickerTool(QDeclarativeViewObserver *view);
-
- virtual ~ColorPickerTool();
-
- void mousePressEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void mouseDoubleClickEvent(QMouseEvent *event);
-
- void hoverMoveEvent(QMouseEvent *event);
-
- void keyPressEvent(QKeyEvent *event);
- void keyReleaseEvent(QKeyEvent *keyEvent);
-
- void wheelEvent(QWheelEvent *event);
-
- void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList);
-
- void clear();
-
-signals:
- void selectedColorChanged(const QColor &color);
-
-protected:
-
- void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
-
-private:
- void pickColor(const QPoint &pos);
-
-private:
- QColor m_selectedColor;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // COLORPICKERTOOL_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/editor.qrc b/src/plugins/qmltooling/declarativeobserver/editor/editor.qrc
deleted file mode 100644
index 77744d57bb..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/editor.qrc
+++ /dev/null
@@ -1,24 +0,0 @@
-<RCC>
- <qresource prefix="/qml">
- <file>images/resize_handle.png</file>
- <file>images/select.png</file>
- <file>images/select-marquee.png</file>
- <file>images/color-picker.png</file>
- <file>images/play.png</file>
- <file>images/pause.png</file>
- <file>images/from-qml.png</file>
- <file>images/to-qml.png</file>
- <file>images/color-picker-hicontrast.png</file>
- <file>images/zoom.png</file>
- <file>images/color-picker-24.png</file>
- <file>images/from-qml-24.png</file>
- <file>images/pause-24.png</file>
- <file>images/play-24.png</file>
- <file>images/to-qml-24.png</file>
- <file>images/zoom-24.png</file>
- <file>images/select-24.png</file>
- <file>images/select-marquee-24.png</file>
- <file>images/observermode.png</file>
- <file>images/observermode-24.png</file>
- </qresource>
-</RCC>
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp b/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp
deleted file mode 100644
index 73cc5a0ff4..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "livelayeritem_p.h"
-
-#include "../qmlobserverconstants_p.h"
-
-#include <QGraphicsScene>
-
-QT_BEGIN_NAMESPACE
-
-LiveLayerItem::LiveLayerItem(QGraphicsScene* scene)
- : QGraphicsObject()
-{
- scene->addItem(this);
- setZValue(1);
- setFlag(QGraphicsItem::ItemIsMovable, false);
-}
-
-LiveLayerItem::~LiveLayerItem()
-{
-}
-
-void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/,
- QWidget * /*widget*/)
-{
-}
-
-int LiveLayerItem::type() const
-{
- return Constants::EditorItemType;
-}
-
-QRectF LiveLayerItem::boundingRect() const
-{
- return childrenBoundingRect();
-}
-
-QList<QGraphicsItem*> LiveLayerItem::findAllChildItems() const
-{
- return findAllChildItems(this);
-}
-
-QList<QGraphicsItem*> LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const
-{
- QList<QGraphicsItem*> itemList(item->childItems());
-
- foreach (QGraphicsItem *childItem, item->childItems())
- itemList += findAllChildItems(childItem);
-
- return itemList;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp
deleted file mode 100644
index 18341de0c8..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "liverubberbandselectionmanipulator_p.h"
-
-#include "../qdeclarativeviewobserver_p_p.h"
-
-#include <QtGui/QGraphicsItem>
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
- QDeclarativeViewObserver *editorView)
- : m_selectionRectangleElement(layerItem),
- m_editorView(editorView),
- m_beginFormEditorItem(0),
- m_isActive(false)
-{
- m_selectionRectangleElement.hide();
-}
-
-void LiveRubberBandSelectionManipulator::clear()
-{
- m_selectionRectangleElement.clear();
- m_isActive = false;
- m_beginPoint = QPointF();
- m_itemList.clear();
- m_oldSelectionList.clear();
-}
-
-QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList<QGraphicsItem*>
- &itemList)
-{
- if (itemList.isEmpty())
- return 0;
-
- return itemList.first();
-}
-
-void LiveRubberBandSelectionManipulator::begin(const QPointF &beginPoint)
-{
- m_beginPoint = beginPoint;
- m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint);
- m_selectionRectangleElement.show();
- m_isActive = true;
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(m_editorView);
- m_beginFormEditorItem = topFormEditorItem(observerPrivate->selectableItems(beginPoint));
- m_oldSelectionList = m_editorView->selectedItems();
-}
-
-void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint)
-{
- m_selectionRectangleElement.setRect(m_beginPoint, updatePoint);
-}
-
-void LiveRubberBandSelectionManipulator::end()
-{
- m_oldSelectionList.clear();
- m_selectionRectangleElement.hide();
- m_isActive = false;
-}
-
-void LiveRubberBandSelectionManipulator::select(SelectionType selectionType)
-{
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(m_editorView);
- QList<QGraphicsItem*> itemList
- = observerPrivate->selectableItems(m_selectionRectangleElement.rect(),
- Qt::IntersectsItemShape);
- QList<QGraphicsItem*> newSelectionList;
-
- foreach (QGraphicsItem* item, itemList) {
- if (item
- && item->parentItem()
- && !newSelectionList.contains(item)
- //&& m_beginFormEditorItem->childItems().contains(item) // TODO activate this test
- )
- {
- newSelectionList.append(item);
- }
- }
-
- if (newSelectionList.isEmpty() && m_beginFormEditorItem)
- newSelectionList.append(m_beginFormEditorItem);
-
- QList<QGraphicsItem*> resultList;
-
- switch (selectionType) {
- case AddToSelection: {
- resultList.append(m_oldSelectionList);
- resultList.append(newSelectionList);
- }
- break;
- case ReplaceSelection: {
- resultList.append(newSelectionList);
- }
- break;
- case RemoveFromSelection: {
- QSet<QGraphicsItem*> oldSelectionSet(m_oldSelectionList.toSet());
- QSet<QGraphicsItem*> newSelectionSet(newSelectionList.toSet());
- resultList.append(oldSelectionSet.subtract(newSelectionSet).toList());
- }
- }
-
- m_editorView->setSelectedItems(resultList);
-}
-
-
-void LiveRubberBandSelectionManipulator::setItems(const QList<QGraphicsItem*> &itemList)
-{
- m_itemList = itemList;
-}
-
-QPointF LiveRubberBandSelectionManipulator::beginPoint() const
-{
- return m_beginPoint;
-}
-
-bool LiveRubberBandSelectionManipulator::isActive() const
-{
- return m_isActive;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h
deleted file mode 100644
index a71caa219f..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RUBBERBANDSELECTIONMANIPULATOR_H
-#define RUBBERBANDSELECTIONMANIPULATOR_H
-
-#include "liveselectionrectangle_p.h"
-
-#include <QtCore/QPointF>
-
-QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-
-class LiveRubberBandSelectionManipulator
-{
-public:
- enum SelectionType {
- ReplaceSelection,
- AddToSelection,
- RemoveFromSelection
- };
-
- LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
- QDeclarativeViewObserver *editorView);
-
- void setItems(const QList<QGraphicsItem*> &itemList);
-
- void begin(const QPointF& beginPoint);
- void update(const QPointF& updatePoint);
- void end();
-
- void clear();
-
- void select(SelectionType selectionType);
-
- QPointF beginPoint() const;
-
- bool isActive() const;
-
-protected:
- QGraphicsItem *topFormEditorItem(const QList<QGraphicsItem*> &itemList);
-
-private:
- QList<QGraphicsItem*> m_itemList;
- QList<QGraphicsItem*> m_oldSelectionList;
- LiveSelectionRectangle m_selectionRectangleElement;
- QPointF m_beginPoint;
- QDeclarativeViewObserver *m_editorView;
- QGraphicsItem *m_beginFormEditorItem;
- bool m_isActive;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // RUBBERBANDSELECTIONMANIPULATOR_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp
deleted file mode 100644
index 2752957314..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "liveselectionindicator_p.h"
-
-#include "../qdeclarativeviewobserver_p_p.h"
-#include "../qmlobserverconstants_p.h"
-
-#include <QtGui/QGraphicsRectItem>
-#include <QtGui/QGraphicsObject>
-#include <QtGui/QGraphicsScene>
-#include <QtGui/QPen>
-
-QT_BEGIN_NAMESPACE
-
-LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewObserver *viewObserver,
- QGraphicsObject *layerItem)
- : m_layerItem(layerItem)
- , m_view(viewObserver)
-{
-}
-
-LiveSelectionIndicator::~LiveSelectionIndicator()
-{
- clear();
-}
-
-void LiveSelectionIndicator::show()
-{
- foreach (QGraphicsRectItem *item, m_indicatorShapeHash)
- item->show();
-}
-
-void LiveSelectionIndicator::hide()
-{
- foreach (QGraphicsRectItem *item, m_indicatorShapeHash)
- item->hide();
-}
-
-void LiveSelectionIndicator::clear()
-{
- if (!m_layerItem.isNull()) {
- QGraphicsScene *scene = m_layerItem.data()->scene();
- foreach (QGraphicsRectItem *item, m_indicatorShapeHash) {
- scene->removeItem(item);
- delete item;
- }
- }
-
- m_indicatorShapeHash.clear();
-
-}
-
-void LiveSelectionIndicator::setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList)
-{
- clear();
-
- foreach (const QWeakPointer<QGraphicsObject> &object, itemList) {
- if (object.isNull())
- continue;
-
- QGraphicsItem *item = object.data();
-
- if (!m_indicatorShapeHash.contains(item)) {
- QGraphicsRectItem *selectionIndicator = new QGraphicsRectItem(m_layerItem.data());
- m_indicatorShapeHash.insert(item, selectionIndicator);
-
- const QRectF boundingRect = m_view->adjustToScreenBoundaries(item->mapRectToScene(item->boundingRect()));
- const QRectF boundingRectInLayerItemSpace = m_layerItem.data()->mapRectFromScene(boundingRect);
-
- selectionIndicator->setData(Constants::EditorItemDataKey, true);
- selectionIndicator->setFlag(QGraphicsItem::ItemIsSelectable, false);
- selectionIndicator->setRect(boundingRectInLayerItemSpace);
- selectionIndicator->setPen(QColor(108, 141, 221));
- }
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h
deleted file mode 100644
index efd2c5f488..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LIVESELECTIONINDICATOR_H
-#define LIVESELECTIONINDICATOR_H
-
-#include <QtCore/QWeakPointer>
-#include <QtCore/QHash>
-
-QT_BEGIN_NAMESPACE
-class QGraphicsObject;
-class QGraphicsRectItem;
-class QGraphicsItem;
-class QPolygonF;
-QT_END_NAMESPACE
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-
-class LiveSelectionIndicator
-{
-public:
- LiveSelectionIndicator(QDeclarativeViewObserver *viewObserver, QGraphicsObject *layerItem);
- ~LiveSelectionIndicator();
-
- void show();
- void hide();
-
- void clear();
-
- void setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList);
-
-private:
- QHash<QGraphicsItem*, QGraphicsRectItem *> m_indicatorShapeHash;
- QWeakPointer<QGraphicsObject> m_layerItem;
- QDeclarativeViewObserver *m_view;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // LIVESELECTIONINDICATOR_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp
deleted file mode 100644
index 6da1d6f026..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "liveselectionrectangle_p.h"
-
-#include "../qmlobserverconstants_p.h"
-
-#include <QtGui/QPen>
-#include <QtGui/QGraphicsRectItem>
-#include <QtGui/QGraphicsObject>
-#include <QtGui/QGraphicsScene>
-
-#include <QtCore/QtDebug>
-
-#include <cmath>
-
-QT_BEGIN_NAMESPACE
-
-class SelectionRectShape : public QGraphicsRectItem
-{
-public:
- SelectionRectShape(QGraphicsItem *parent = 0) : QGraphicsRectItem(parent) {}
- int type() const { return Constants::EditorItemType; }
-};
-
-LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem)
- : m_controlShape(new SelectionRectShape(layerItem)),
- m_layerItem(layerItem)
-{
- m_controlShape->setPen(QPen(Qt::black));
- m_controlShape->setBrush(QColor(128, 128, 128, 50));
-}
-
-LiveSelectionRectangle::~LiveSelectionRectangle()
-{
- if (m_layerItem)
- m_layerItem.data()->scene()->removeItem(m_controlShape);
-}
-
-void LiveSelectionRectangle::clear()
-{
- hide();
-}
-void LiveSelectionRectangle::show()
-{
- m_controlShape->show();
-}
-
-void LiveSelectionRectangle::hide()
-{
- m_controlShape->hide();
-}
-
-QRectF LiveSelectionRectangle::rect() const
-{
- return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect();
-}
-
-void LiveSelectionRectangle::setRect(const QPointF &firstPoint,
- const QPointF &secondPoint)
-{
- double firstX = std::floor(firstPoint.x()) + 0.5;
- double firstY = std::floor(firstPoint.y()) + 0.5;
- double secondX = std::floor(secondPoint.x()) + 0.5;
- double secondY = std::floor(secondPoint.y()) + 0.5;
- QPointF topLeftPoint(firstX < secondX ? firstX : secondX,
- firstY < secondY ? firstY : secondY);
- QPointF bottomRightPoint(firstX > secondX ? firstX : secondX,
- firstY > secondY ? firstY : secondY);
-
- QRectF rect(topLeftPoint, bottomRightPoint);
- m_controlShape->setRect(rect);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp
deleted file mode 100644
index 872832c387..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp
+++ /dev/null
@@ -1,438 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "liveselectiontool_p.h"
-#include "livelayeritem_p.h"
-
-#include "../qdeclarativeviewobserver_p_p.h"
-
-#include <QtGui/QApplication>
-#include <QtGui/QWheelEvent>
-#include <QtGui/QMouseEvent>
-#include <QtGui/QClipboard>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QGraphicsObject>
-
-#include <QtDeclarative/QDeclarativeItem>
-#include <QtDeclarative/QDeclarativeEngine>
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-LiveSelectionTool::LiveSelectionTool(QDeclarativeViewObserver *editorView) :
- AbstractLiveEditTool(editorView),
- m_rubberbandSelectionMode(false),
- m_rubberbandSelectionManipulator(
- QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer, editorView),
- m_singleSelectionManipulator(editorView),
- m_selectionIndicator(editorView,
- QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer),
- //m_resizeIndicator(editorView->manipulatorLayer()),
- m_selectOnlyContentItems(true)
-{
-
-}
-
-LiveSelectionTool::~LiveSelectionTool()
-{
-}
-
-void LiveSelectionTool::setRubberbandSelectionMode(bool value)
-{
- m_rubberbandSelectionMode = value;
-}
-
-LiveSingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers
- modifiers)
-{
- LiveSingleSelectionManipulator::SelectionType selectionType
- = LiveSingleSelectionManipulator::ReplaceSelection;
- if (modifiers.testFlag(Qt::ControlModifier)) {
- selectionType = LiveSingleSelectionManipulator::RemoveFromSelection;
- } else if (modifiers.testFlag(Qt::ShiftModifier)) {
- selectionType = LiveSingleSelectionManipulator::AddToSelection;
- }
- return selectionType;
-}
-
-bool LiveSelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const
-{
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
- const QList<QGraphicsItem*> selectedItems = observerPrivate->selectedItems();
-
- if (selectedItems.isEmpty())
- return false;
-
- foreach (QGraphicsItem *item, itemList)
- if (selectedItems.contains(item))
- return true;
-
- return false;
-}
-
-void LiveSelectionTool::mousePressEvent(QMouseEvent *event)
-{
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
- QList<QGraphicsItem*> itemList = observerPrivate->selectableItems(event->pos());
- LiveSingleSelectionManipulator::SelectionType selectionType = getSelectionType(event->modifiers());
-
- if (event->buttons() & Qt::LeftButton) {
- m_mousePressTimer.start();
-
- if (m_rubberbandSelectionMode) {
- m_rubberbandSelectionManipulator.begin(event->pos());
- } else {
- m_singleSelectionManipulator.begin(event->pos());
- m_singleSelectionManipulator.select(selectionType, m_selectOnlyContentItems);
- }
- } else if (event->buttons() & Qt::RightButton) {
- createContextMenu(itemList, event->globalPos());
- }
-}
-
-void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos)
-{
- QMenu contextMenu;
- connect(&contextMenu, SIGNAL(hovered(QAction*)),
- this, SLOT(contextMenuElementHovered(QAction*)));
-
- m_contextMenuItemList = itemList;
-
- contextMenu.addAction(tr("Items"));
- contextMenu.addSeparator();
- int shortcutKey = Qt::Key_1;
- bool addKeySequence = true;
- int i = 0;
-
- foreach (QGraphicsItem * const item, itemList) {
- QString itemTitle = titleForItem(item);
- QAction *elementAction = contextMenu.addAction(itemTitle, this,
- SLOT(contextMenuElementSelected()));
-
- if (observer()->selectedItems().contains(item)) {
- QFont boldFont = elementAction->font();
- boldFont.setBold(true);
- elementAction->setFont(boldFont);
- }
-
- elementAction->setData(i);
- if (addKeySequence)
- elementAction->setShortcut(QKeySequence(shortcutKey));
-
- shortcutKey++;
- if (shortcutKey > Qt::Key_9)
- addKeySequence = false;
-
- ++i;
- }
- // add root item separately
- // QString itemTitle = QString(tr("%1")).arg(titleForItem(view()->currentRootItem()));
- // contextMenu.addAction(itemTitle, this, SLOT(contextMenuElementSelected()));
- // m_contextMenuItemList.append(view()->currentRootItem());
-
- contextMenu.exec(globalPos);
- m_contextMenuItemList.clear();
-}
-
-void LiveSelectionTool::contextMenuElementSelected()
-{
- QAction *senderAction = static_cast<QAction*>(sender());
- int itemListIndex = senderAction->data().toInt();
- if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
-
- QPointF updatePt(0, 0);
- QGraphicsItem *item = m_contextMenuItemList.at(itemListIndex);
- m_singleSelectionManipulator.begin(updatePt);
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
- QList<QGraphicsItem*>() << item,
- false);
- m_singleSelectionManipulator.end(updatePt);
- }
-}
-
-void LiveSelectionTool::contextMenuElementHovered(QAction *action)
-{
- int itemListIndex = action->data().toInt();
- if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
- QGraphicsObject *item = m_contextMenuItemList.at(itemListIndex)->toGraphicsObject();
- QDeclarativeViewObserverPrivate::get(observer())->highlight(item);
- }
-}
-
-void LiveSelectionTool::mouseMoveEvent(QMouseEvent *event)
-{
- if (m_singleSelectionManipulator.isActive()) {
- QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos();
-
- if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance)
- && (m_mousePressTimer.elapsed() > Constants::DragStartTime))
- {
- m_singleSelectionManipulator.end(event->pos());
- //view()->changeToMoveTool(m_singleSelectionManipulator.beginPoint());
- return;
- }
- } else if (m_rubberbandSelectionManipulator.isActive()) {
- QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
-
- if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance)
- && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) {
- m_rubberbandSelectionManipulator.update(event->pos());
-
- if (event->modifiers().testFlag(Qt::ControlModifier))
- m_rubberbandSelectionManipulator.select(
- LiveRubberBandSelectionManipulator::RemoveFromSelection);
- else if (event->modifiers().testFlag(Qt::ShiftModifier))
- m_rubberbandSelectionManipulator.select(
- LiveRubberBandSelectionManipulator::AddToSelection);
- else
- m_rubberbandSelectionManipulator.select(
- LiveRubberBandSelectionManipulator::ReplaceSelection);
- }
- }
-}
-
-void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event)
-{
-// ### commented out until move tool is re-enabled
-// QList<QGraphicsItem*> itemList = view()->items(event->pos());
-// if (!itemList.isEmpty() && !m_rubberbandSelectionMode) {
-//
-// foreach (QGraphicsItem *item, itemList) {
-// if (item->type() == Constants::ResizeHandleItemType) {
-// ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(item);
-// if (resizeHandle)
-// view()->changeTool(Constants::ResizeToolMode);
-// return;
-// }
-// }
-// if (topSelectedItemIsMovable(itemList))
-// view()->changeTool(Constants::MoveToolMode);
-// }
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
-
- QList<QGraphicsItem*> selectableItemList = observerPrivate->selectableItems(event->pos());
- if (!selectableItemList.isEmpty()) {
- QGraphicsObject *item = selectableItemList.first()->toGraphicsObject();
- if (item)
- QDeclarativeViewObserverPrivate::get(observer())->highlight(item);
-
- return;
- }
-
- QDeclarativeViewObserverPrivate::get(observer())->clearHighlight();
-}
-
-void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
-{
- if (m_singleSelectionManipulator.isActive()) {
- m_singleSelectionManipulator.end(event->pos());
- }
- else if (m_rubberbandSelectionManipulator.isActive()) {
-
- QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
- if (mouseMovementVector.toPoint().manhattanLength() < Constants::DragStartDistance) {
- m_singleSelectionManipulator.begin(event->pos());
-
- if (event->modifiers().testFlag(Qt::ControlModifier))
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection,
- m_selectOnlyContentItems);
- else if (event->modifiers().testFlag(Qt::ShiftModifier))
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection,
- m_selectOnlyContentItems);
- else
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
- m_selectOnlyContentItems);
-
- m_singleSelectionManipulator.end(event->pos());
- } else {
- m_rubberbandSelectionManipulator.update(event->pos());
-
- if (event->modifiers().testFlag(Qt::ControlModifier))
- m_rubberbandSelectionManipulator.select(
- LiveRubberBandSelectionManipulator::RemoveFromSelection);
- else if (event->modifiers().testFlag(Qt::ShiftModifier))
- m_rubberbandSelectionManipulator.select(
- LiveRubberBandSelectionManipulator::AddToSelection);
- else
- m_rubberbandSelectionManipulator.select(
- LiveRubberBandSelectionManipulator::ReplaceSelection);
-
- m_rubberbandSelectionManipulator.end();
- }
- }
-}
-
-void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/)
-{
-}
-
-void LiveSelectionTool::keyPressEvent(QKeyEvent *event)
-{
- switch (event->key()) {
- case Qt::Key_Left:
- case Qt::Key_Right:
- case Qt::Key_Up:
- case Qt::Key_Down:
- // disabled for now, cannot move stuff yet.
- //view()->changeTool(Constants::MoveToolMode);
- //view()->currentTool()->keyPressEvent(event);
- break;
- }
-}
-
-void LiveSelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/)
-{
-
-}
-
-void LiveSelectionTool::wheelEvent(QWheelEvent *event)
-{
- if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode)
- return;
-
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
- QList<QGraphicsItem*> itemList = observerPrivate->selectableItems(event->pos());
-
- if (itemList.isEmpty())
- return;
-
- int selectedIdx = 0;
- if (!observer()->selectedItems().isEmpty()) {
- selectedIdx = itemList.indexOf(observer()->selectedItems().first());
- if (selectedIdx >= 0) {
- if (event->delta() > 0) {
- selectedIdx++;
- if (selectedIdx == itemList.length())
- selectedIdx = 0;
- } else if (event->delta() < 0) {
- selectedIdx--;
- if (selectedIdx == -1)
- selectedIdx = itemList.length() - 1;
- }
- } else {
- selectedIdx = 0;
- }
- }
-
- QPointF updatePt(0, 0);
- m_singleSelectionManipulator.begin(updatePt);
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::ReplaceSelection,
- QList<QGraphicsItem*>() << itemList.at(selectedIdx),
- false);
- m_singleSelectionManipulator.end(updatePt);
-
-}
-
-void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
-{
- m_selectOnlyContentItems = selectOnlyContentItems;
-}
-
-void LiveSelectionTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
-{
-}
-
-void LiveSelectionTool::clear()
-{
- view()->setCursor(Qt::ArrowCursor);
- m_rubberbandSelectionManipulator.clear(),
- m_singleSelectionManipulator.clear();
- m_selectionIndicator.clear();
- //m_resizeIndicator.clear();
-}
-
-void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
-{
- foreach (const QWeakPointer<QGraphicsObject> &obj, m_selectedItemList) {
- if (!obj.isNull()) {
- disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
- disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
- disconnect(obj.data(), SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects()));
- disconnect(obj.data(), SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects()));
- disconnect(obj.data(), SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects()));
- }
- }
-
- QList<QGraphicsObject*> objects = toGraphicsObjectList(itemList);
- m_selectedItemList.clear();
-
- foreach (QGraphicsObject *obj, objects) {
- m_selectedItemList.append(obj);
- connect(obj, SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
- connect(obj, SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
- connect(obj, SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects()));
- connect(obj, SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects()));
- connect(obj, SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects()));
- }
-
- m_selectionIndicator.setItems(m_selectedItemList);
- //m_resizeIndicator.setItems(toGraphicsObjectList(itemList));
-}
-
-void LiveSelectionTool::repaintBoundingRects()
-{
- m_selectionIndicator.setItems(m_selectedItemList);
-}
-
-void LiveSelectionTool::selectUnderPoint(QMouseEvent *event)
-{
- m_singleSelectionManipulator.begin(event->pos());
-
- if (event->modifiers().testFlag(Qt::ControlModifier))
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection,
- m_selectOnlyContentItems);
- else if (event->modifiers().testFlag(Qt::ShiftModifier))
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection,
- m_selectOnlyContentItems);
- else
- m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
- m_selectOnlyContentItems);
-
- m_singleSelectionManipulator.end(event->pos());
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h
deleted file mode 100644
index 4ecf9f6dcd..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LIVESELECTIONTOOL_H
-#define LIVESELECTIONTOOL_H
-
-#include "abstractliveedittool_p.h"
-#include "liverubberbandselectionmanipulator_p.h"
-#include "livesingleselectionmanipulator_p.h"
-#include "liveselectionindicator_p.h"
-
-#include <QtCore/QList>
-#include <QtCore/QTime>
-
-QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
-QT_FORWARD_DECLARE_CLASS(QMouseEvent)
-QT_FORWARD_DECLARE_CLASS(QKeyEvent)
-QT_FORWARD_DECLARE_CLASS(QAction)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class LiveSelectionTool : public AbstractLiveEditTool
-{
- Q_OBJECT
-
-public:
- LiveSelectionTool(QDeclarativeViewObserver* editorView);
- ~LiveSelectionTool();
-
- void mousePressEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void mouseDoubleClickEvent(QMouseEvent *event);
- void hoverMoveEvent(QMouseEvent *event);
- void keyPressEvent(QKeyEvent *event);
- void keyReleaseEvent(QKeyEvent *keyEvent);
- void wheelEvent(QWheelEvent *event);
-
- void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList);
-// QVariant itemChange(const QList<QGraphicsItem*> &itemList,
-// QGraphicsItem::GraphicsItemChange change,
-// const QVariant &value );
-
-// void update();
-
- void clear();
-
- void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
-
- void selectUnderPoint(QMouseEvent *event);
-
- void setSelectOnlyContentItems(bool selectOnlyContentItems);
-
- void setRubberbandSelectionMode(bool value);
-
-private slots:
- void contextMenuElementSelected();
- void contextMenuElementHovered(QAction *action);
- void repaintBoundingRects();
-
-private:
- void createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos);
- LiveSingleSelectionManipulator::SelectionType getSelectionType(Qt::KeyboardModifiers modifiers);
- bool alreadySelected(const QList<QGraphicsItem*> &itemList) const;
-
-private:
- bool m_rubberbandSelectionMode;
- LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator;
- LiveSingleSelectionManipulator m_singleSelectionManipulator;
- LiveSelectionIndicator m_selectionIndicator;
- //ResizeIndicator m_resizeIndicator;
- QTime m_mousePressTimer;
- bool m_selectOnlyContentItems;
-
- QList<QWeakPointer<QGraphicsObject> > m_selectedItemList;
-
- QList<QGraphicsItem*> m_contextMenuItemList;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // LIVESELECTIONTOOL_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp b/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp
deleted file mode 100644
index 1ffd7a94e7..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "livesingleselectionmanipulator_p.h"
-
-#include "../qdeclarativeviewobserver_p_p.h"
-
-#include <QtDebug>
-
-QT_BEGIN_NAMESPACE
-
-LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView)
- : m_editorView(editorView),
- m_isActive(false)
-{
-}
-
-
-void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint)
-{
- m_beginPoint = beginPoint;
- m_isActive = true;
- m_oldSelectionList = QDeclarativeViewObserverPrivate::get(m_editorView)->selectedItems();
-}
-
-void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/)
-{
- m_oldSelectionList.clear();
-}
-
-void LiveSingleSelectionManipulator::clear()
-{
- m_beginPoint = QPointF();
- m_oldSelectionList.clear();
-}
-
-
-void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/)
-{
- m_oldSelectionList.clear();
- m_isActive = false;
-}
-
-void LiveSingleSelectionManipulator::select(SelectionType selectionType,
- const QList<QGraphicsItem*> &items,
- bool /*selectOnlyContentItems*/)
-{
- QGraphicsItem *selectedItem = 0;
-
- foreach (QGraphicsItem* item, items)
- {
- //FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
- if (item
- /*&& !formEditorItem->qmlItemNode().isRootNode()
- && (formEditorItem->qmlItemNode().hasShowContent() || !selectOnlyContentItems)*/)
- {
- selectedItem = item;
- break;
- }
- }
-
- QList<QGraphicsItem*> resultList;
-
- switch (selectionType) {
- case AddToSelection: {
- resultList.append(m_oldSelectionList);
- if (selectedItem && !m_oldSelectionList.contains(selectedItem))
- resultList.append(selectedItem);
- }
- break;
- case ReplaceSelection: {
- if (selectedItem)
- resultList.append(selectedItem);
- }
- break;
- case RemoveFromSelection: {
- resultList.append(m_oldSelectionList);
- if (selectedItem)
- resultList.removeAll(selectedItem);
- }
- break;
- case InvertSelection: {
- if (selectedItem
- && !m_oldSelectionList.contains(selectedItem))
- {
- resultList.append(selectedItem);
- }
- }
- }
-
- m_editorView->setSelectedItems(resultList);
-}
-
-void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems)
-{
- QDeclarativeViewObserverPrivate *observerPrivate =
- QDeclarativeViewObserverPrivate::get(m_editorView);
- QList<QGraphicsItem*> itemList = observerPrivate->selectableItems(m_beginPoint);
- select(selectionType, itemList, selectOnlyContentItems);
-}
-
-
-bool LiveSingleSelectionManipulator::isActive() const
-{
- return m_isActive;
-}
-
-QPointF LiveSingleSelectionManipulator::beginPoint() const
-{
- return m_beginPoint;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h b/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h
deleted file mode 100644
index ea0406b2a8..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LIVESINGLESELECTIONMANIPULATOR_H
-#define LIVESINGLESELECTIONMANIPULATOR_H
-
-#include <QtCore/QPointF>
-#include <QtCore/QList>
-
-QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-
-class LiveSingleSelectionManipulator
-{
-public:
- LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView);
-
- enum SelectionType {
- ReplaceSelection,
- AddToSelection,
- RemoveFromSelection,
- InvertSelection
- };
-
- void begin(const QPointF& beginPoint);
- void update(const QPointF& updatePoint);
- void end(const QPointF& updatePoint);
-
- void select(SelectionType selectionType, const QList<QGraphicsItem*> &items,
- bool selectOnlyContentItems);
- void select(SelectionType selectionType, bool selectOnlyContentItems);
-
- void clear();
-
- QPointF beginPoint() const;
-
- bool isActive() const;
-
-private:
- QList<QGraphicsItem*> m_oldSelectionList;
- QPointF m_beginPoint;
- QDeclarativeViewObserver *m_editorView;
- bool m_isActive;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // LIVESINGLESELECTIONMANIPULATOR_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp b/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp
deleted file mode 100644
index 9ad5b24ea9..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmltoolbar_p.h"
-#include "toolbarcolorbox_p.h"
-
-#include <QtGui/QLabel>
-#include <QtGui/QIcon>
-#include <QtGui/QAction>
-#include <QtGui/QMenu>
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-QmlToolBar::QmlToolBar(QWidget *parent)
- : QToolBar(parent)
- , m_emitSignals(true)
- , m_paused(false)
- , m_animationSpeed(1.0f)
- , ui(new Ui)
-{
- ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png"));
- ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png"));
-
- ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/observermode-24.png")),
- tr("Observer Mode"), this);
- ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this);
- ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this);
- ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")),
- tr("Select (Marquee)"), this);
- ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this);
- ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-24.png")),
- tr("Color Picker"), this);
- ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-24.png")),
- tr("Apply Changes to QML Viewer"), this);
- ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-24.png")),
- tr("Apply Changes to Document"), this);
- ui->designmode->setCheckable(true);
- ui->designmode->setChecked(false);
-
- ui->play->setCheckable(false);
- ui->select->setCheckable(true);
- ui->selectMarquee->setCheckable(true);
- ui->zoom->setCheckable(true);
- ui->colorPicker->setCheckable(true);
-
- setWindowTitle(tr("Tools"));
-
- addAction(ui->designmode);
- addAction(ui->play);
- addSeparator();
-
- addAction(ui->select);
- // disabled because multi selection does not do anything useful without design mode
- //addAction(ui->selectMarquee);
- addSeparator();
- addAction(ui->zoom);
- addAction(ui->colorPicker);
- //addAction(ui->fromQml);
-
- ui->colorBox = new ToolBarColorBox(this);
- ui->colorBox->setMinimumSize(24, 24);
- ui->colorBox->setMaximumSize(28, 28);
- ui->colorBox->setColor(Qt::black);
- addWidget(ui->colorBox);
-
- setWindowFlags(Qt::Tool);
-
- QMenu *playSpeedMenu = new QMenu(this);
- ui->playSpeedMenuActions = new QActionGroup(this);
- ui->playSpeedMenuActions->setExclusive(true);
-
- QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed()));
- speedAction->setCheckable(true);
- speedAction->setChecked(true);
- speedAction->setData(1.0f);
- ui->playSpeedMenuActions->addAction(speedAction);
-
- speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed()));
- speedAction->setCheckable(true);
- speedAction->setData(2.0f);
- ui->playSpeedMenuActions->addAction(speedAction);
-
- speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed()));
- speedAction->setCheckable(true);
- speedAction->setData(4.0f);
- ui->playSpeedMenuActions->addAction(speedAction);
-
- speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed()));
- speedAction->setCheckable(true);
- speedAction->setData(8.0f);
- ui->playSpeedMenuActions->addAction(speedAction);
-
- speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed()));
- speedAction->setCheckable(true);
- speedAction->setData(10.0f);
- ui->playSpeedMenuActions->addAction(speedAction);
-
- ui->play->setMenu(playSpeedMenu);
-
- connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool)));
-
- connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
-
- connect(ui->play, SIGNAL(triggered()), SLOT(activatePlayOnClick()));
-
- connect(ui->zoom, SIGNAL(triggered()), SLOT(activateZoomOnClick()));
- connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
- connect(ui->select, SIGNAL(triggered()), SLOT(activateSelectToolOnClick()));
- connect(ui->selectMarquee, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick()));
-
- connect(ui->toQml, SIGNAL(triggered()), SLOT(activateToQml()));
- connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml()));
-}
-
-QmlToolBar::~QmlToolBar()
-{
- delete ui;
-}
-
-void QmlToolBar::activateColorPicker()
-{
- m_emitSignals = false;
- activateColorPickerOnClick();
- m_emitSignals = true;
-}
-
-void QmlToolBar::activateSelectTool()
-{
- m_emitSignals = false;
- activateSelectToolOnClick();
- m_emitSignals = true;
-}
-
-void QmlToolBar::activateMarqueeSelectTool()
-{
- m_emitSignals = false;
- activateMarqueeSelectToolOnClick();
- m_emitSignals = true;
-}
-
-void QmlToolBar::activateZoom()
-{
- m_emitSignals = false;
- activateZoomOnClick();
- m_emitSignals = true;
-}
-
-void QmlToolBar::setAnimationSpeed(qreal slowDownFactor)
-{
- if (m_animationSpeed == slowDownFactor)
- return;
-
- m_emitSignals = false;
- m_animationSpeed = slowDownFactor;
-
- foreach (QAction *action, ui->playSpeedMenuActions->actions()) {
- if (action->data().toReal() == slowDownFactor) {
- action->setChecked(true);
- break;
- }
- }
-
- m_emitSignals = true;
-}
-
-void QmlToolBar::setAnimationPaused(bool paused)
-{
- if (m_paused == paused)
- return;
-
- m_paused = paused;
- updatePlayAction();
-}
-
-void QmlToolBar::changeAnimationSpeed()
-{
- QAction *action = qobject_cast<QAction*>(sender());
- m_animationSpeed = action->data().toReal();
- emit animationSpeedChanged(m_animationSpeed);
-}
-
-void QmlToolBar::setDesignModeBehavior(bool inDesignMode)
-{
- m_emitSignals = false;
- ui->designmode->setChecked(inDesignMode);
- setDesignModeBehaviorOnClick(inDesignMode);
- m_emitSignals = true;
-}
-
-void QmlToolBar::setDesignModeBehaviorOnClick(bool checked)
-{
- ui->select->setEnabled(checked);
- ui->selectMarquee->setEnabled(checked);
- ui->zoom->setEnabled(checked);
- ui->colorPicker->setEnabled(checked);
- ui->toQml->setEnabled(checked);
- ui->fromQml->setEnabled(checked);
-
- if (m_emitSignals)
- emit designModeBehaviorChanged(checked);
-}
-
-void QmlToolBar::setColorBoxColor(const QColor &color)
-{
- ui->colorBox->setColor(color);
-}
-
-void QmlToolBar::activatePlayOnClick()
-{
- m_paused = !m_paused;
- emit animationPausedChanged(m_paused);
- updatePlayAction();
-}
-
-void QmlToolBar::updatePlayAction()
-{
- ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon);
-}
-
-void QmlToolBar::activateColorPickerOnClick()
-{
- ui->zoom->setChecked(false);
- ui->select->setChecked(false);
- ui->selectMarquee->setChecked(false);
-
- ui->colorPicker->setChecked(true);
- if (m_activeTool != Constants::ColorPickerMode) {
- m_activeTool = Constants::ColorPickerMode;
- if (m_emitSignals)
- emit colorPickerSelected();
- }
-}
-
-void QmlToolBar::activateSelectToolOnClick()
-{
- ui->zoom->setChecked(false);
- ui->selectMarquee->setChecked(false);
- ui->colorPicker->setChecked(false);
-
- ui->select->setChecked(true);
- if (m_activeTool != Constants::SelectionToolMode) {
- m_activeTool = Constants::SelectionToolMode;
- if (m_emitSignals)
- emit selectToolSelected();
- }
-}
-
-void QmlToolBar::activateMarqueeSelectToolOnClick()
-{
- ui->zoom->setChecked(false);
- ui->select->setChecked(false);
- ui->colorPicker->setChecked(false);
-
- ui->selectMarquee->setChecked(true);
- if (m_activeTool != Constants::MarqueeSelectionToolMode) {
- m_activeTool = Constants::MarqueeSelectionToolMode;
- if (m_emitSignals)
- emit marqueeSelectToolSelected();
- }
-}
-
-void QmlToolBar::activateZoomOnClick()
-{
- ui->select->setChecked(false);
- ui->selectMarquee->setChecked(false);
- ui->colorPicker->setChecked(false);
-
- ui->zoom->setChecked(true);
- if (m_activeTool != Constants::ZoomMode) {
- m_activeTool = Constants::ZoomMode;
- if (m_emitSignals)
- emit zoomToolSelected();
- }
-}
-
-void QmlToolBar::activateFromQml()
-{
- if (m_emitSignals)
- emit applyChangesFromQmlFileSelected();
-}
-
-void QmlToolBar::activateToQml()
-{
- if (m_emitSignals)
- emit applyChangesToQmlFileSelected();
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h b/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h
deleted file mode 100644
index a3da1f73bd..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLTOOLBAR_H
-#define QMLTOOLBAR_H
-
-#include <QtGui/QToolBar>
-#include <QtGui/QIcon>
-
-#include "../qmlobserverconstants_p.h"
-
-QT_FORWARD_DECLARE_CLASS(QActionGroup)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class ToolBarColorBox;
-
-class QmlToolBar : public QToolBar
-{
- Q_OBJECT
-
-public:
- explicit QmlToolBar(QWidget *parent = 0);
- ~QmlToolBar();
-
-public slots:
- void setDesignModeBehavior(bool inDesignMode);
- void setColorBoxColor(const QColor &color);
- void activateColorPicker();
- void activateSelectTool();
- void activateMarqueeSelectTool();
- void activateZoom();
-
- void setAnimationSpeed(qreal slowDownFactor);
- void setAnimationPaused(bool paused);
-
-signals:
- void animationSpeedChanged(qreal factor);
- void animationPausedChanged(bool paused);
-
- void designModeBehaviorChanged(bool inDesignMode);
- void colorPickerSelected();
- void selectToolSelected();
- void marqueeSelectToolSelected();
- void zoomToolSelected();
-
- void applyChangesToQmlFileSelected();
- void applyChangesFromQmlFileSelected();
-
-private slots:
- void setDesignModeBehaviorOnClick(bool inDesignMode);
- void activatePlayOnClick();
- void activateColorPickerOnClick();
- void activateSelectToolOnClick();
- void activateMarqueeSelectToolOnClick();
- void activateZoomOnClick();
-
- void activateFromQml();
- void activateToQml();
-
- void changeAnimationSpeed();
-
- void updatePlayAction();
-
-private:
- class Ui {
- public:
- QAction *designmode;
- QAction *play;
- QAction *select;
- QAction *selectMarquee;
- QAction *zoom;
- QAction *colorPicker;
- QAction *toQml;
- QAction *fromQml;
- QIcon playIcon;
- QIcon pauseIcon;
- ToolBarColorBox *colorBox;
-
- QActionGroup *playSpeedMenuActions;
- };
-
- bool m_emitSignals;
- bool m_paused;
- qreal m_animationSpeed;
-
- Constants::DesignTool m_activeTool;
-
- Ui *ui;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QMLTOOLBAR_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp b/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp
deleted file mode 100644
index 27e20791d6..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "subcomponentmasklayeritem_p.h"
-
-#include "../qmlobserverconstants_p.h"
-#include "../qdeclarativeviewobserver_p.h"
-
-#include <QtGui/QPolygonF>
-
-QT_BEGIN_NAMESPACE
-
-SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewObserver *observer,
- QGraphicsItem *parentItem) :
- QGraphicsPolygonItem(parentItem),
- m_observer(observer),
- m_currentItem(0),
- m_borderRect(new QGraphicsRectItem(this))
-{
- m_borderRect->setRect(0,0,0,0);
- m_borderRect->setPen(QPen(QColor(60, 60, 60), 1));
- m_borderRect->setData(Constants::EditorItemDataKey, QVariant(true));
-
- setBrush(QBrush(QColor(160,160,160)));
- setPen(Qt::NoPen);
-}
-
-int SubcomponentMaskLayerItem::type() const
-{
- return Constants::EditorItemType;
-}
-
-static QRectF resizeRect(const QRectF &newRect, const QRectF &oldRect)
-{
- QRectF result = newRect;
- if (oldRect.left() < newRect.left())
- result.setLeft(oldRect.left());
-
- if (oldRect.top() < newRect.top())
- result.setTop(oldRect.top());
-
- if (oldRect.right() > newRect.right())
- result.setRight(oldRect.right());
-
- if (oldRect.bottom() > newRect.bottom())
- result.setBottom(oldRect.bottom());
-
- return result;
-}
-
-static QPolygonF regionToPolygon(const QRegion &region)
-{
- QPainterPath path;
- foreach (const QRect &rect, region.rects())
- path.addRect(rect);
- return path.toFillPolygon();
-}
-
-void SubcomponentMaskLayerItem::setCurrentItem(QGraphicsItem *item)
-{
- QGraphicsItem *prevItem = m_currentItem;
- m_currentItem = item;
-
- if (!m_currentItem)
- return;
-
- QRect viewRect = m_observer->declarativeView()->rect();
- viewRect = m_observer->declarativeView()->mapToScene(viewRect).boundingRect().toRect();
-
- QRectF itemRect = item->boundingRect() | item->childrenBoundingRect();
- itemRect = item->mapRectToScene(itemRect);
-
- // if updating the same item as before, resize the rectangle only bigger, not smaller.
- if (prevItem == item && prevItem != 0) {
- m_itemPolyRect = resizeRect(itemRect, m_itemPolyRect);
- } else {
- m_itemPolyRect = itemRect;
- }
- QRectF borderRect = m_itemPolyRect;
- borderRect.adjust(-1, -1, 1, 1);
- m_borderRect->setRect(borderRect);
-
- const QRegion externalRegion = QRegion(viewRect).subtracted(m_itemPolyRect.toRect());
- setPolygon(regionToPolygon(externalRegion));
-}
-
-QGraphicsItem *SubcomponentMaskLayerItem::currentItem() const
-{
- return m_currentItem;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h b/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h
deleted file mode 100644
index 7a772533e1..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SUBCOMPONENTMASKLAYERITEM_H
-#define SUBCOMPONENTMASKLAYERITEM_H
-
-#include <QtGui/QGraphicsPolygonItem>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-
-class SubcomponentMaskLayerItem : public QGraphicsPolygonItem
-{
-public:
- explicit SubcomponentMaskLayerItem(QDeclarativeViewObserver *observer,
- QGraphicsItem *parentItem = 0);
- int type() const;
- void setCurrentItem(QGraphicsItem *item);
- void setBoundingBox(const QRectF &boundingBox);
- QGraphicsItem *currentItem() const;
- QRectF itemRect() const;
-
-private:
- QDeclarativeViewObserver *m_observer;
- QGraphicsItem *m_currentItem;
- QGraphicsRectItem *m_borderRect;
- QRectF m_itemPolyRect;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // SUBCOMPONENTMASKLAYERITEM_H
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp b/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp
deleted file mode 100644
index d3a5a37b54..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "toolbarcolorbox_p.h"
-
-#include "../qmlobserverconstants_p.h"
-
-#include <QtGui/QPixmap>
-#include <QtGui/QPainter>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QContextMenuEvent>
-#include <QtGui/QClipboard>
-#include <QtGui/QApplication>
-#include <QtGui/QColorDialog>
-#include <QtGui/QDrag>
-
-#include <QtCore/QMimeData>
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
- QLabel(parent)
-{
- m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")),
- tr("Copy Color"), this);
- connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard()));
- setScaledContents(false);
-}
-
-void ToolBarColorBox::setColor(const QColor &color)
-{
- m_color = color;
-
- QPixmap pix = createDragPixmap(width());
- setPixmap(pix);
- update();
-}
-
-void ToolBarColorBox::mousePressEvent(QMouseEvent *event)
-{
- m_dragBeginPoint = event->pos();
- m_dragStarted = false;
-}
-
-void ToolBarColorBox::mouseMoveEvent(QMouseEvent *event)
-{
-
- if (event->buttons() & Qt::LeftButton
- && (QPoint(event->pos() - m_dragBeginPoint).manhattanLength()
- > Constants::DragStartDistance)
- && !m_dragStarted)
- {
- m_dragStarted = true;
- QDrag *drag = new QDrag(this);
- QMimeData *mimeData = new QMimeData;
-
- mimeData->setText(m_color.name());
- drag->setMimeData(mimeData);
- drag->setPixmap(createDragPixmap());
-
- drag->exec();
- }
-}
-
-QPixmap ToolBarColorBox::createDragPixmap(int size) const
-{
- QPixmap pix(size, size);
- QPainter p(&pix);
-
- QColor borderColor1 = QColor(143, 143 ,143);
- QColor borderColor2 = QColor(43, 43, 43);
-
- p.setBrush(QBrush(m_color));
- p.setPen(QPen(QBrush(borderColor2),1));
-
- p.fillRect(0, 0, size, size, borderColor1);
- p.drawRect(1,1, size - 3, size - 3);
- return pix;
-}
-
-void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev)
-{
- QMenu contextMenu;
- contextMenu.addAction(m_copyHexColor);
- contextMenu.exec(ev->globalPos());
-}
-
-void ToolBarColorBox::copyColorToClipboard()
-{
- QClipboard *clipboard = QApplication::clipboard();
- clipboard->setText(m_color.name());
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp
deleted file mode 100644
index 68d67ccb1e..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "zoomtool_p.h"
-
-#include "../qdeclarativeviewobserver_p_p.h"
-
-#include <QtGui/QMouseEvent>
-#include <QtGui/QWheelEvent>
-#include <QtGui/QKeyEvent>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-
-#include <QtCore/QRectF>
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-ZoomTool::ZoomTool(QDeclarativeViewObserver *view) :
- AbstractLiveEditTool(view),
- m_rubberbandManipulator(),
- m_smoothZoomMultiplier(0.05f),
- m_currentScale(1.0f)
-{
- m_zoomTo100Action = new QAction(tr("Zoom to &100%"), this);
- m_zoomInAction = new QAction(tr("Zoom In"), this);
- m_zoomOutAction = new QAction(tr("Zoom Out"), this);
- m_zoomInAction->setShortcut(QKeySequence(Qt::Key_Plus));
- m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus));
-
-
- LiveLayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer;
- QGraphicsObject *layerObject = reinterpret_cast<QGraphicsObject *>(layerItem);
- m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view);
-
-
- connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100()));
- connect(m_zoomInAction, SIGNAL(triggered()), SLOT(zoomIn()));
- connect(m_zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut()));
-}
-
-ZoomTool::~ZoomTool()
-{
- delete m_rubberbandManipulator;
-}
-
-void ZoomTool::mousePressEvent(QMouseEvent *event)
-{
- m_mousePos = event->pos();
-
- QPointF scenePos = view()->mapToScene(event->pos());
-
- if (event->buttons() & Qt::RightButton) {
- QMenu contextMenu;
- contextMenu.addAction(m_zoomTo100Action);
- contextMenu.addSeparator();
- contextMenu.addAction(m_zoomInAction);
- contextMenu.addAction(m_zoomOutAction);
- contextMenu.exec(event->globalPos());
- } else if (event->buttons() & Qt::LeftButton) {
- m_dragBeginPos = scenePos;
- m_dragStarted = false;
- }
-}
-
-void ZoomTool::mouseMoveEvent(QMouseEvent *event)
-{
- m_mousePos = event->pos();
-
- QPointF scenePos = view()->mapToScene(event->pos());
-
- if (event->buttons() & Qt::LeftButton
- && (QPointF(scenePos - m_dragBeginPos).manhattanLength()
- > Constants::DragStartDistance / 3)
- && !m_dragStarted)
- {
- m_dragStarted = true;
- m_rubberbandManipulator->begin(m_dragBeginPos);
- return;
- }
-
- if (m_dragStarted)
- m_rubberbandManipulator->update(scenePos);
-
-}
-
-void ZoomTool::mouseReleaseEvent(QMouseEvent *event)
-{
- m_mousePos = event->pos();
- QPointF scenePos = view()->mapToScene(event->pos());
-
- if (m_dragStarted) {
- m_rubberbandManipulator->end();
-
- int x1 = qMin(scenePos.x(), m_rubberbandManipulator->beginPoint().x());
- int x2 = qMax(scenePos.x(), m_rubberbandManipulator->beginPoint().x());
- int y1 = qMin(scenePos.y(), m_rubberbandManipulator->beginPoint().y());
- int y2 = qMax(scenePos.y(), m_rubberbandManipulator->beginPoint().y());
-
- QPointF scenePosTopLeft = QPoint(x1, y1);
- QPointF scenePosBottomRight = QPoint(x2, y2);
-
- QRectF sceneArea(scenePosTopLeft, scenePosBottomRight);
-
- m_currentScale = qMin(view()->rect().width() / sceneArea.width(),
- view()->rect().height() / sceneArea.height());
-
-
- QTransform transform;
- transform.scale(m_currentScale, m_currentScale);
-
- view()->setTransform(transform);
- view()->setSceneRect(sceneArea);
- } else {
- Qt::KeyboardModifier modifierKey = Qt::ControlModifier;
-#ifdef Q_WS_MAC
- modifierKey = Qt::AltModifier;
-#endif
- if (event->modifiers() & modifierKey) {
- zoomOut();
- } else {
- zoomIn();
- }
- }
-}
-
-void ZoomTool::zoomIn()
-{
- m_currentScale = nextZoomScale(ZoomIn);
- scaleView(view()->mapToScene(m_mousePos));
-}
-
-void ZoomTool::zoomOut()
-{
- m_currentScale = nextZoomScale(ZoomOut);
- scaleView(view()->mapToScene(m_mousePos));
-}
-
-void ZoomTool::mouseDoubleClickEvent(QMouseEvent *event)
-{
- m_mousePos = event->pos();
-}
-
-
-void ZoomTool::hoverMoveEvent(QMouseEvent *event)
-{
- m_mousePos = event->pos();
-}
-
-
-void ZoomTool::keyPressEvent(QKeyEvent * /*event*/)
-{
-}
-
-void ZoomTool::wheelEvent(QWheelEvent *event)
-{
- if (event->orientation() != Qt::Vertical)
- return;
-
- Qt::KeyboardModifier smoothZoomModifier = Qt::ControlModifier;
- if (event->modifiers() & smoothZoomModifier) {
- int numDegrees = event->delta() / 8;
- m_currentScale += m_smoothZoomMultiplier * (numDegrees / 15.0f);
-
- scaleView(view()->mapToScene(m_mousePos));
-
- } else if (!event->modifiers()) {
- if (event->delta() > 0) {
- m_currentScale = nextZoomScale(ZoomIn);
- } else if (event->delta() < 0) {
- m_currentScale = nextZoomScale(ZoomOut);
- }
- scaleView(view()->mapToScene(m_mousePos));
- }
-}
-
-void ZoomTool::keyReleaseEvent(QKeyEvent *event)
-{
- switch (event->key()) {
- case Qt::Key_Plus:
- zoomIn();
- break;
- case Qt::Key_Minus:
- zoomOut();
- break;
- case Qt::Key_1:
- case Qt::Key_2:
- case Qt::Key_3:
- case Qt::Key_4:
- case Qt::Key_5:
- case Qt::Key_6:
- case Qt::Key_7:
- case Qt::Key_8:
- case Qt::Key_9:
- {
- m_currentScale = ((event->key() - Qt::Key_0) * 1.0f);
- scaleView(view()->mapToScene(m_mousePos)); // view()->mapToScene(view()->rect().center())
- break;
- }
-
- default:
- break;
- }
-
-}
-
-void ZoomTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
-{
-}
-
-void ZoomTool::clear()
-{
- view()->setCursor(Qt::ArrowCursor);
-}
-
-void ZoomTool::selectedItemsChanged(const QList<QGraphicsItem*> &/*itemList*/)
-{
-}
-
-void ZoomTool::scaleView(const QPointF &centerPos)
-{
-
- QTransform transform;
- transform.scale(m_currentScale, m_currentScale);
- view()->setTransform(transform);
-
- QPointF adjustedCenterPos = centerPos;
- QSize rectSize(view()->rect().width() / m_currentScale,
- view()->rect().height() / m_currentScale);
-
- QRectF sceneRect;
- if (qAbs(m_currentScale - 1.0f) < Constants::ZoomSnapDelta) {
- adjustedCenterPos.rx() = rectSize.width() / 2;
- adjustedCenterPos.ry() = rectSize.height() / 2;
- }
-
- if (m_currentScale < 1.0f) {
- adjustedCenterPos.rx() = rectSize.width() / 2;
- adjustedCenterPos.ry() = rectSize.height() / 2;
- sceneRect.setRect(view()->rect().width() / 2 -rectSize.width() / 2,
- view()->rect().height() / 2 -rectSize.height() / 2,
- rectSize.width(),
- rectSize.height());
- } else {
- sceneRect.setRect(adjustedCenterPos.x() - rectSize.width() / 2,
- adjustedCenterPos.y() - rectSize.height() / 2,
- rectSize.width(),
- rectSize.height());
- }
-
- view()->setSceneRect(sceneRect);
-}
-
-void ZoomTool::zoomTo100()
-{
- m_currentScale = 1.0f;
- scaleView(view()->mapToScene(view()->rect().center()));
-}
-
-qreal ZoomTool::nextZoomScale(ZoomDirection direction) const
-{
- static QList<qreal> zoomScales =
- QList<qreal>()
- << 0.125f
- << 1.0f / 6.0f
- << 0.25f
- << 1.0f / 3.0f
- << 0.5f
- << 2.0f / 3.0f
- << 1.0f
- << 2.0f
- << 3.0f
- << 4.0f
- << 5.0f
- << 6.0f
- << 7.0f
- << 8.0f
- << 12.0f
- << 16.0f
- << 32.0f
- << 48.0f;
-
- if (direction == ZoomIn) {
- for (int i = 0; i < zoomScales.length(); ++i) {
- if (zoomScales[i] > m_currentScale || i == zoomScales.length() - 1)
- return zoomScales[i];
- }
- } else {
- for (int i = zoomScales.length() - 1; i >= 0; --i) {
- if (zoomScales[i] < m_currentScale || i == 0)
- return zoomScales[i];
- }
- }
-
- return 1.0f;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h
deleted file mode 100644
index ef5c2e6373..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef ZOOMTOOL_H
-#define ZOOMTOOL_H
-
-#include "abstractliveedittool_p.h"
-#include "liverubberbandselectionmanipulator_p.h"
-
-QT_FORWARD_DECLARE_CLASS(QAction)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class ZoomTool : public AbstractLiveEditTool
-{
- Q_OBJECT
-
-public:
- enum ZoomDirection {
- ZoomIn,
- ZoomOut
- };
-
- explicit ZoomTool(QDeclarativeViewObserver *view);
-
- virtual ~ZoomTool();
-
- void mousePressEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void mouseDoubleClickEvent(QMouseEvent *event);
-
- void hoverMoveEvent(QMouseEvent *event);
- void wheelEvent(QWheelEvent *event);
-
- void keyPressEvent(QKeyEvent *event);
- void keyReleaseEvent(QKeyEvent *keyEvent);
- void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList);
-
- void clear();
-
-protected:
- void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
-
-private slots:
- void zoomTo100();
- void zoomIn();
- void zoomOut();
-
-private:
- qreal nextZoomScale(ZoomDirection direction) const;
- void scaleView(const QPointF &centerPos);
-
-private:
- bool m_dragStarted;
- QPoint m_mousePos; // in view coords
- QPointF m_dragBeginPos;
- QAction *m_zoomTo100Action;
- QAction *m_zoomInAction;
- QAction *m_zoomOutAction;
- LiveRubberBandSelectionManipulator *m_rubberbandManipulator;
-
- qreal m_smoothZoomMultiplier;
- qreal m_currentScale;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // ZOOMTOOL_H
diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp b/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp
deleted file mode 100644
index a00bc6f017..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativeobserverplugin.h"
-
-#include "qdeclarativeviewobserver_p.h"
-
-#include <QtCore/qplugin.h>
-#include <QtDeclarative/private/qdeclarativeobserverservice_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QDeclarativeObserverPlugin::QDeclarativeObserverPlugin() :
- m_observer(0)
-{
-}
-
-QDeclarativeObserverPlugin::~QDeclarativeObserverPlugin()
-{
- delete m_observer;
-}
-
-void QDeclarativeObserverPlugin::activate()
-{
- QDeclarativeObserverService *service = QDeclarativeObserverService::instance();
- QList<QDeclarativeView*> views = service->views();
- if (views.isEmpty())
- return;
-
- // TODO: Support multiple views
- QDeclarativeView *view = service->views().at(0);
- m_observer = new QDeclarativeViewObserver(view, view);
-}
-
-void QDeclarativeObserverPlugin::deactivate()
-{
- delete m_observer;
-}
-
-Q_EXPORT_PLUGIN2(declarativeobserver, QDeclarativeObserverPlugin)
-
-QT_END_NAMESPACE
-
diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h
deleted file mode 100644
index 7bc76263d3..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEOBSERVERPLUGIN_H
-#define QDECLARATIVEOBSERVERPLUGIN_H
-
-#include <QtCore/QPointer>
-#include <QtDeclarative/private/qdeclarativeobserverinterface_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeViewObserver;
-
-class QDeclarativeObserverPlugin : public QObject, public QDeclarativeObserverInterface
-{
- Q_OBJECT
- Q_DISABLE_COPY(QDeclarativeObserverPlugin)
- Q_INTERFACES(QDeclarativeObserverInterface)
-
-public:
- QDeclarativeObserverPlugin();
- ~QDeclarativeObserverPlugin();
-
- void activate();
- void deactivate();
-
-private:
- QPointer<QDeclarativeViewObserver> m_observer;
-};
-
-QT_END_NAMESPACE
-
-#endif // QDECLARATIVEOBSERVERPLUGIN_H
diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h
deleted file mode 100644
index 62722acce7..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEOBSERVERPROTOCOL_H
-#define QDECLARATIVEOBSERVERPROTOCOL_H
-
-#include <QtCore/QDebug>
-#include <QtCore/QMetaType>
-#include <QtCore/QMetaEnum>
-#include <QtCore/QObject>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class ObserverProtocol : public QObject
-{
- Q_OBJECT
- Q_ENUMS(Message Tool)
-
-public:
- enum Message {
- AnimationSpeedChanged = 0,
- AnimationPausedChanged = 19, // highest value
- ChangeTool = 1,
- ClearComponentCache = 2,
- ColorChanged = 3,
- CreateObject = 5,
- CurrentObjectsChanged = 6,
- DestroyObject = 7,
- MoveObject = 8,
- ObjectIdList = 9,
- Reload = 10,
- Reloaded = 11,
- SetAnimationSpeed = 12,
- SetAnimationPaused = 18,
- SetCurrentObjects = 14,
- SetDesignMode = 15,
- ShowAppOnTop = 16,
- ToolChanged = 17
- };
-
- enum Tool {
- ColorPickerTool,
- SelectMarqueeTool,
- SelectTool,
- ZoomTool
- };
-
- static inline QString toString(Message message)
- {
- return QLatin1String(staticMetaObject.enumerator(0).valueToKey(message));
- }
-
- static inline QString toString(Tool tool)
- {
- return QLatin1String(staticMetaObject.enumerator(1).valueToKey(tool));
- }
-};
-
-inline QDataStream & operator<< (QDataStream &stream, ObserverProtocol::Message message)
-{
- return stream << static_cast<quint32>(message);
-}
-
-inline QDataStream & operator>> (QDataStream &stream, ObserverProtocol::Message &message)
-{
- quint32 i;
- stream >> i;
- message = static_cast<ObserverProtocol::Message>(i);
- return stream;
-}
-
-inline QDebug operator<< (QDebug dbg, ObserverProtocol::Message message)
-{
- dbg << ObserverProtocol::toString(message);
- return dbg;
-}
-
-inline QDataStream & operator<< (QDataStream &stream, ObserverProtocol::Tool tool)
-{
- return stream << static_cast<quint32>(tool);
-}
-
-inline QDataStream & operator>> (QDataStream &stream, ObserverProtocol::Tool &tool)
-{
- quint32 i;
- stream >> i;
- tool = static_cast<ObserverProtocol::Tool>(i);
- return stream;
-}
-
-inline QDebug operator<< (QDebug dbg, ObserverProtocol::Tool tool)
-{
- dbg << ObserverProtocol::toString(tool);
- return dbg;
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEOBSERVERPROTOCOL_H
diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp
deleted file mode 100644
index a49a75868a..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp
+++ /dev/null
@@ -1,1021 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "QtDeclarative/private/qdeclarativeobserverservice_p.h"
-#include "QtDeclarative/private/qdeclarativedebughelper_p.h"
-
-#include "qdeclarativeviewobserver_p.h"
-#include "qdeclarativeviewobserver_p_p.h"
-#include "qdeclarativeobserverprotocol.h"
-
-#include "editor/liveselectiontool_p.h"
-#include "editor/zoomtool_p.h"
-#include "editor/colorpickertool_p.h"
-#include "editor/livelayeritem_p.h"
-#include "editor/boundingrecthighlighter_p.h"
-#include "editor/qmltoolbar_p.h"
-
-#include <QtDeclarative/QDeclarativeItem>
-#include <QtDeclarative/QDeclarativeEngine>
-#include <QtDeclarative/QDeclarativeContext>
-#include <QtDeclarative/QDeclarativeExpression>
-#include <QtGui/QWidget>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QMouseEvent>
-#include <QtGui/QGraphicsObject>
-#include <QtGui/QApplication>
-#include <QtCore/QSettings>
-
-static inline void initEditorResource() { Q_INIT_RESOURCE(editor); }
-
-QT_BEGIN_NAMESPACE
-
-const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry";
-
-const int SceneChangeUpdateInterval = 5000;
-
-
-class ToolBox : public QWidget
-{
- Q_OBJECT
-
-public:
- ToolBox(QWidget *parent = 0);
- ~ToolBox();
-
- QmlToolBar *toolBar() const { return m_toolBar; }
-
-private:
- QSettings m_settings;
- QmlToolBar *m_toolBar;
-};
-
-ToolBox::ToolBox(QWidget *parent)
- : QWidget(parent, Qt::Tool)
- , m_settings(QLatin1String("Nokia"), QLatin1String("QmlObserver"), this)
- , m_toolBar(new QmlToolBar)
-{
- setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint);
- setWindowTitle(tr("Qt Quick Toolbox"));
-
- QVBoxLayout *verticalLayout = new QVBoxLayout;
- verticalLayout->setMargin(0);
- verticalLayout->addWidget(m_toolBar);
- setLayout(verticalLayout);
-
- restoreGeometry(m_settings.value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray());
-}
-
-ToolBox::~ToolBox()
-{
- m_settings.setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY), saveGeometry());
-}
-
-
-QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *q) :
- q(q),
- designModeBehavior(false),
- showAppOnTop(false),
- animationPaused(false),
- slowDownFactor(1.0f),
- toolBox(0)
-{
-}
-
-QDeclarativeViewObserverPrivate::~QDeclarativeViewObserverPrivate()
-{
-}
-
-QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view,
- QObject *parent) :
- QObject(parent),
- data(new QDeclarativeViewObserverPrivate(this))
-{
- initEditorResource();
-
- data->view = view;
- data->manipulatorLayer = new LiveLayerItem(view->scene());
- data->selectionTool = new LiveSelectionTool(this);
- data->zoomTool = new ZoomTool(this);
- data->colorPickerTool = new ColorPickerTool(this);
- data->boundingRectHighlighter = new BoundingRectHighlighter(this);
- data->currentTool = data->selectionTool;
-
- // to capture ChildRemoved event when viewport changes
- data->view->installEventFilter(this);
-
- data->setViewport(data->view->viewport());
-
- data->debugService = QDeclarativeObserverService::instance();
- connect(data->debugService, SIGNAL(gotMessage(QByteArray)),
- this, SLOT(handleMessage(QByteArray)));
-
- connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)),
- data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status)));
-
- connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
- SIGNAL(selectedColorChanged(QColor)));
- connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
- this, SLOT(sendColorChanged(QColor)));
-
- data->_q_changeToSingleSelectTool();
-}
-
-QDeclarativeViewObserver::~QDeclarativeViewObserver()
-{
-}
-
-void QDeclarativeViewObserverPrivate::_q_setToolBoxVisible(bool visible)
-{
-#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
- if (!toolBox && visible)
- createToolBox();
- if (toolBox)
- toolBox->setVisible(visible);
-#else
- Q_UNUSED(visible)
-#endif
-}
-
-void QDeclarativeViewObserverPrivate::_q_reloadView()
-{
- clearHighlight();
- emit q->reloadRequested();
-}
-
-void QDeclarativeViewObserverPrivate::setViewport(QWidget *widget)
-{
- if (viewport.data() == widget)
- return;
-
- if (viewport)
- viewport.data()->removeEventFilter(q);
-
- viewport = widget;
- if (viewport) {
- // make sure we get mouse move events
- viewport.data()->setMouseTracking(true);
- viewport.data()->installEventFilter(q);
- }
-}
-
-void QDeclarativeViewObserverPrivate::clearEditorItems()
-{
- clearHighlight();
- setSelectedItems(QList<QGraphicsItem*>());
-}
-
-bool QDeclarativeViewObserver::eventFilter(QObject *obj, QEvent *event)
-{
- if (obj == data->view) {
- // Event from view
- if (event->type() == QEvent::ChildRemoved) {
- // Might mean that viewport has changed
- if (data->view->viewport() != data->viewport.data())
- data->setViewport(data->view->viewport());
- }
- return QObject::eventFilter(obj, event);
- }
-
- // Event from viewport
- switch (event->type()) {
- case QEvent::Leave: {
- if (leaveEvent(event))
- return true;
- break;
- }
- case QEvent::MouseButtonPress: {
- if (mousePressEvent(static_cast<QMouseEvent*>(event)))
- return true;
- break;
- }
- case QEvent::MouseMove: {
- if (mouseMoveEvent(static_cast<QMouseEvent*>(event)))
- return true;
- break;
- }
- case QEvent::MouseButtonRelease: {
- if (mouseReleaseEvent(static_cast<QMouseEvent*>(event)))
- return true;
- break;
- }
- case QEvent::KeyPress: {
- if (keyPressEvent(static_cast<QKeyEvent*>(event)))
- return true;
- break;
- }
- case QEvent::KeyRelease: {
- if (keyReleaseEvent(static_cast<QKeyEvent*>(event)))
- return true;
- break;
- }
- case QEvent::MouseButtonDblClick: {
- if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
- return true;
- break;
- }
- case QEvent::Wheel: {
- if (wheelEvent(static_cast<QWheelEvent*>(event)))
- return true;
- break;
- }
- default: {
- break;
- }
- } //switch
-
- // standard event processing
- return QObject::eventFilter(obj, event);
-}
-
-bool QDeclarativeViewObserver::leaveEvent(QEvent * /*event*/)
-{
- if (!data->designModeBehavior)
- return false;
- data->clearHighlight();
- return true;
-}
-
-bool QDeclarativeViewObserver::mousePressEvent(QMouseEvent *event)
-{
- if (!data->designModeBehavior)
- return false;
- data->cursorPos = event->pos();
- data->currentTool->mousePressEvent(event);
- return true;
-}
-
-bool QDeclarativeViewObserver::mouseMoveEvent(QMouseEvent *event)
-{
- if (!data->designModeBehavior) {
- data->clearEditorItems();
- return false;
- }
- data->cursorPos = event->pos();
-
- QList<QGraphicsItem*> selItems = data->selectableItems(event->pos());
- if (!selItems.isEmpty()) {
- declarativeView()->setToolTip(data->currentTool->titleForItem(selItems.first()));
- } else {
- declarativeView()->setToolTip(QString());
- }
- if (event->buttons()) {
- data->currentTool->mouseMoveEvent(event);
- } else {
- data->currentTool->hoverMoveEvent(event);
- }
- return true;
-}
-
-bool QDeclarativeViewObserver::mouseReleaseEvent(QMouseEvent *event)
-{
- if (!data->designModeBehavior)
- return false;
-
- data->cursorPos = event->pos();
- data->currentTool->mouseReleaseEvent(event);
- return true;
-}
-
-bool QDeclarativeViewObserver::keyPressEvent(QKeyEvent *event)
-{
- if (!data->designModeBehavior)
- return false;
-
- data->currentTool->keyPressEvent(event);
- return true;
-}
-
-bool QDeclarativeViewObserver::keyReleaseEvent(QKeyEvent *event)
-{
- if (!data->designModeBehavior)
- return false;
-
- switch (event->key()) {
- case Qt::Key_V:
- data->_q_changeToSingleSelectTool();
- break;
-// disabled because multiselection does not do anything useful without design mode
-// case Qt::Key_M:
-// data->_q_changeToMarqueeSelectTool();
-// break;
- case Qt::Key_I:
- data->_q_changeToColorPickerTool();
- break;
- case Qt::Key_Z:
- data->_q_changeToZoomTool();
- break;
- case Qt::Key_Space:
- setAnimationPaused(!data->animationPaused);
- break;
- default:
- break;
- }
-
- data->currentTool->keyReleaseEvent(event);
- return true;
-}
-
-void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QObject *parent,
- const QStringList &importList,
- const QString &filename)
-{
- if (!parent)
- return;
-
- QString imports;
- foreach (const QString &s, importList) {
- imports += s;
- imports += QLatin1Char('\n');
- }
-
- QDeclarativeContext *parentContext = view->engine()->contextForObject(parent);
- QDeclarativeComponent component(view->engine(), q);
- QByteArray constructedQml = QString(imports + qml).toLatin1();
-
- component.setData(constructedQml, QUrl::fromLocalFile(filename));
- QObject *newObject = component.create(parentContext);
- if (newObject) {
- newObject->setParent(parent);
- QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent);
- QDeclarativeItem *newItem = qobject_cast<QDeclarativeItem*>(newObject);
- if (parentItem && newItem)
- newItem->setParentItem(parentItem);
- }
-}
-
-void QDeclarativeViewObserverPrivate::_q_reparentQmlObject(QObject *object, QObject *newParent)
-{
- if (!newParent)
- return;
-
- object->setParent(newParent);
- QDeclarativeItem *newParentItem = qobject_cast<QDeclarativeItem*>(newParent);
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(object);
- if (newParentItem && item)
- item->setParentItem(newParentItem);
-}
-
-void QDeclarativeViewObserverPrivate::_q_clearComponentCache()
-{
- view->engine()->clearComponentCache();
-}
-
-void QDeclarativeViewObserverPrivate::_q_removeFromSelection(QObject *obj)
-{
- QList<QGraphicsItem*> items = selectedItems();
- if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
- items.removeOne(item);
- setSelectedItems(items);
-}
-
-bool QDeclarativeViewObserver::mouseDoubleClickEvent(QMouseEvent * /*event*/)
-{
- if (!data->designModeBehavior)
- return false;
-
- return true;
-}
-
-bool QDeclarativeViewObserver::wheelEvent(QWheelEvent *event)
-{
- if (!data->designModeBehavior)
- return false;
- data->currentTool->wheelEvent(event);
- return true;
-}
-
-void QDeclarativeViewObserver::setDesignModeBehavior(bool value)
-{
- emit designModeBehaviorChanged(value);
-
- if (data->toolBox)
- data->toolBox->toolBar()->setDesignModeBehavior(value);
- sendDesignModeBehavior(value);
-
- data->designModeBehavior = value;
-
- if (!data->designModeBehavior)
- data->clearEditorItems();
-}
-
-bool QDeclarativeViewObserver::designModeBehavior()
-{
- return data->designModeBehavior;
-}
-
-bool QDeclarativeViewObserver::showAppOnTop() const
-{
- return data->showAppOnTop;
-}
-
-void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop)
-{
- if (data->view) {
- QWidget *window = data->view->window();
- Qt::WindowFlags flags = window->windowFlags();
- if (appOnTop)
- flags |= Qt::WindowStaysOnTopHint;
- else
- flags &= ~Qt::WindowStaysOnTopHint;
-
- window->setWindowFlags(flags);
- window->show();
- }
-
- data->showAppOnTop = appOnTop;
- sendShowAppOnTop(appOnTop);
-
- emit showAppOnTopChanged(appOnTop);
-}
-
-void QDeclarativeViewObserverPrivate::changeTool(Constants::DesignTool tool,
- Constants::ToolFlags /*flags*/)
-{
- switch (tool) {
- case Constants::SelectionToolMode:
- _q_changeToSingleSelectTool();
- break;
- case Constants::NoTool:
- default:
- currentTool = 0;
- break;
- }
-}
-
-void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(const QList<QGraphicsItem *> &items)
-{
- foreach (const QWeakPointer<QGraphicsObject> &obj, currentSelection) {
- if (QGraphicsItem *item = obj.data()) {
- if (!items.contains(item)) {
- QObject::disconnect(obj.data(), SIGNAL(destroyed(QObject*)),
- this, SLOT(_q_removeFromSelection(QObject*)));
- currentSelection.removeOne(obj);
- }
- }
- }
-
- foreach (QGraphicsItem *item, items) {
- if (item) {
- if (QGraphicsObject *obj = item->toGraphicsObject()) {
- QObject::connect(obj, SIGNAL(destroyed(QObject*)),
- this, SLOT(_q_removeFromSelection(QObject*)));
- currentSelection.append(obj);
- }
- }
- }
-
- currentTool->updateSelectedItems();
-}
-
-void QDeclarativeViewObserverPrivate::setSelectedItems(const QList<QGraphicsItem *> &items)
-{
- QList<QWeakPointer<QGraphicsObject> > oldList = currentSelection;
- setSelectedItemsForTools(items);
- if (oldList != currentSelection) {
- QList<QObject*> objectList;
- foreach (const QWeakPointer<QGraphicsObject> &graphicsObject, currentSelection) {
- if (graphicsObject)
- objectList << graphicsObject.data();
- }
-
- q->sendCurrentObjects(objectList);
- }
-}
-
-QList<QGraphicsItem *> QDeclarativeViewObserverPrivate::selectedItems() const
-{
- QList<QGraphicsItem *> selection;
- foreach (const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
- if (selectedObject.data())
- selection << selectedObject.data();
- }
-
- return selection;
-}
-
-void QDeclarativeViewObserver::setSelectedItems(QList<QGraphicsItem *> items)
-{
- data->setSelectedItems(items);
-}
-
-QList<QGraphicsItem *> QDeclarativeViewObserver::selectedItems() const
-{
- return data->selectedItems();
-}
-
-QDeclarativeView *QDeclarativeViewObserver::declarativeView()
-{
- return data->view;
-}
-
-void QDeclarativeViewObserverPrivate::clearHighlight()
-{
- boundingRectHighlighter->clear();
-}
-
-void QDeclarativeViewObserverPrivate::highlight(const QList<QGraphicsObject *> &items)
-{
- if (items.isEmpty())
- return;
-
- QList<QGraphicsObject*> objectList;
- foreach (QGraphicsItem *item, items) {
- QGraphicsItem *child = item;
-
- if (child) {
- QGraphicsObject *childObject = child->toGraphicsObject();
- if (childObject)
- objectList << childObject;
- }
- }
-
- boundingRectHighlighter->highlight(objectList);
-}
-
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::selectableItems(
- const QPointF &scenePos) const
-{
- QList<QGraphicsItem*> itemlist = view->scene()->items(scenePos);
- return filterForSelection(itemlist);
-}
-
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::selectableItems(const QPoint &pos) const
-{
- QList<QGraphicsItem*> itemlist = view->items(pos);
- return filterForSelection(itemlist);
-}
-
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::selectableItems(
- const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const
-{
- QList<QGraphicsItem*> itemlist = view->scene()->items(sceneRect, selectionMode);
- return filterForSelection(itemlist);
-}
-
-void QDeclarativeViewObserverPrivate::_q_changeToSingleSelectTool()
-{
- currentToolMode = Constants::SelectionToolMode;
- selectionTool->setRubberbandSelectionMode(false);
-
- changeToSelectTool();
-
- emit q->selectToolActivated();
- q->sendCurrentTool(Constants::SelectionToolMode);
-}
-
-void QDeclarativeViewObserverPrivate::changeToSelectTool()
-{
- if (currentTool == selectionTool)
- return;
-
- currentTool->clear();
- currentTool = selectionTool;
- currentTool->clear();
- currentTool->updateSelectedItems();
-}
-
-void QDeclarativeViewObserverPrivate::_q_changeToMarqueeSelectTool()
-{
- changeToSelectTool();
- currentToolMode = Constants::MarqueeSelectionToolMode;
- selectionTool->setRubberbandSelectionMode(true);
-
- emit q->marqueeSelectToolActivated();
- q->sendCurrentTool(Constants::MarqueeSelectionToolMode);
-}
-
-void QDeclarativeViewObserverPrivate::_q_changeToZoomTool()
-{
- currentToolMode = Constants::ZoomMode;
- currentTool->clear();
- currentTool = zoomTool;
- currentTool->clear();
-
- emit q->zoomToolActivated();
- q->sendCurrentTool(Constants::ZoomMode);
-}
-
-void QDeclarativeViewObserverPrivate::_q_changeToColorPickerTool()
-{
- if (currentTool == colorPickerTool)
- return;
-
- currentToolMode = Constants::ColorPickerMode;
- currentTool->clear();
- currentTool = colorPickerTool;
- currentTool->clear();
-
- emit q->colorPickerActivated();
- q->sendCurrentTool(Constants::ColorPickerMode);
-}
-
-void QDeclarativeViewObserver::setAnimationSpeed(qreal slowDownFactor)
-{
- Q_ASSERT(slowDownFactor > 0);
- if (data->slowDownFactor == slowDownFactor)
- return;
-
- animationSpeedChangeRequested(slowDownFactor);
- sendAnimationSpeed(slowDownFactor);
-}
-
-void QDeclarativeViewObserver::setAnimationPaused(bool paused)
-{
- if (data->animationPaused == paused)
- return;
-
- animationPausedChangeRequested(paused);
- sendAnimationPaused(paused);
-}
-
-void QDeclarativeViewObserver::animationSpeedChangeRequested(qreal factor)
-{
- if (data->slowDownFactor != factor) {
- data->slowDownFactor = factor;
- emit animationSpeedChanged(factor);
- }
-
- const float effectiveFactor = data->animationPaused ? 0 : factor;
- QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
-}
-
-void QDeclarativeViewObserver::animationPausedChangeRequested(bool paused)
-{
- if (data->animationPaused != paused) {
- data->animationPaused = paused;
- emit animationPausedChanged(paused);
- }
-
- const float effectiveFactor = paused ? 0 : data->slowDownFactor;
- QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
-}
-
-
-void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient()
-{
-}
-
-
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::filterForSelection(
- QList<QGraphicsItem*> &itemlist) const
-{
- foreach (QGraphicsItem *item, itemlist) {
- if (isEditorItem(item))
- itemlist.removeOne(item);
- }
-
- return itemlist;
-}
-
-bool QDeclarativeViewObserverPrivate::isEditorItem(QGraphicsItem *item) const
-{
- return (item->type() == Constants::EditorItemType
- || item->type() == Constants::ResizeHandleItemType
- || item->data(Constants::EditorItemDataKey).toBool());
-}
-
-void QDeclarativeViewObserverPrivate::_q_onStatusChanged(QDeclarativeView::Status status)
-{
- if (status == QDeclarativeView::Ready)
- q->sendReloaded();
-}
-
-void QDeclarativeViewObserverPrivate::_q_onCurrentObjectsChanged(QList<QObject*> objects)
-{
- QList<QGraphicsItem*> items;
- QList<QGraphicsObject*> gfxObjects;
- foreach (QObject *obj, objects) {
- if (QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(obj)) {
- items << declarativeItem;
- gfxObjects << declarativeItem;
- }
- }
- if (designModeBehavior) {
- setSelectedItemsForTools(items);
- clearHighlight();
- highlight(gfxObjects);
- }
-}
-
-// adjusts bounding boxes on edges of screen to be visible
-QRectF QDeclarativeViewObserver::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace)
-{
- int marginFromEdge = 1;
- QRectF boundingRect(boundingRectInSceneSpace);
- if (qAbs(boundingRect.left()) - 1 < 2)
- boundingRect.setLeft(marginFromEdge);
-
- QRect rect = data->view->rect();
-
- if (boundingRect.right() >= rect.right())
- boundingRect.setRight(rect.right() - marginFromEdge);
-
- if (qAbs(boundingRect.top()) - 1 < 2)
- boundingRect.setTop(marginFromEdge);
-
- if (boundingRect.bottom() >= rect.bottom())
- boundingRect.setBottom(rect.bottom() - marginFromEdge);
-
- return boundingRect;
-}
-
-void QDeclarativeViewObserverPrivate::createToolBox()
-{
- toolBox = new ToolBox(q->declarativeView());
-
- QmlToolBar *toolBar = toolBox->toolBar();
-
- QObject::connect(q, SIGNAL(selectedColorChanged(QColor)),
- toolBar, SLOT(setColorBoxColor(QColor)));
-
- QObject::connect(q, SIGNAL(designModeBehaviorChanged(bool)),
- toolBar, SLOT(setDesignModeBehavior(bool)));
-
- QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)),
- q, SLOT(setDesignModeBehavior(bool)));
- QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), q, SLOT(setAnimationSpeed(qreal)));
- QObject::connect(toolBar, SIGNAL(animationPausedChanged(bool)), q, SLOT(setAnimationPaused(bool)));
- QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool()));
- QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool()));
- QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool()));
- QObject::connect(toolBar, SIGNAL(marqueeSelectToolSelected()),
- this, SLOT(_q_changeToMarqueeSelectTool()));
-
- QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()),
- this, SLOT(_q_applyChangesFromClient()));
-
- QObject::connect(q, SIGNAL(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal)));
- QObject::connect(q, SIGNAL(animationPausedChanged(bool)), toolBar, SLOT(setAnimationPaused(bool)));
-
- QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool()));
-
- // disabled features
- //connect(d->m_toolBar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient()));
- //connect(q, SIGNAL(resizeToolActivated()), d->m_toolBar, SLOT(activateSelectTool()));
- //connect(q, SIGNAL(moveToolActivated()), d->m_toolBar, SLOT(activateSelectTool()));
-
- QObject::connect(q, SIGNAL(colorPickerActivated()), toolBar, SLOT(activateColorPicker()));
- QObject::connect(q, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom()));
- QObject::connect(q, SIGNAL(marqueeSelectToolActivated()),
- toolBar, SLOT(activateMarqueeSelectTool()));
-}
-
-void QDeclarativeViewObserver::handleMessage(const QByteArray &message)
-{
- QDataStream ds(message);
-
- ObserverProtocol::Message type;
- ds >> type;
-
- switch (type) {
- case ObserverProtocol::SetCurrentObjects: {
- int itemCount = 0;
- ds >> itemCount;
-
- QList<QObject*> selectedObjects;
- for (int i = 0; i < itemCount; ++i) {
- int debugId = -1;
- ds >> debugId;
- if (QObject *obj = QDeclarativeDebugService::objectForId(debugId))
- selectedObjects << obj;
- }
-
- data->_q_onCurrentObjectsChanged(selectedObjects);
- break;
- }
- case ObserverProtocol::Reload: {
- data->_q_reloadView();
- break;
- }
- case ObserverProtocol::SetAnimationSpeed: {
- qreal speed;
- ds >> speed;
- animationSpeedChangeRequested(speed);
- break;
- }
- case ObserverProtocol::SetAnimationPaused: {
- bool paused;
- ds >> paused;
- animationPausedChangeRequested(paused);
- break;
- }
- case ObserverProtocol::ChangeTool: {
- ObserverProtocol::Tool tool;
- ds >> tool;
- switch (tool) {
- case ObserverProtocol::ColorPickerTool:
- data->_q_changeToColorPickerTool();
- break;
- case ObserverProtocol::SelectTool:
- data->_q_changeToSingleSelectTool();
- break;
- case ObserverProtocol::SelectMarqueeTool:
- data->_q_changeToMarqueeSelectTool();
- break;
- case ObserverProtocol::ZoomTool:
- data->_q_changeToZoomTool();
- break;
- default:
- qWarning() << "Warning: Unhandled tool:" << tool;
- }
- break;
- }
- case ObserverProtocol::SetDesignMode: {
- bool inDesignMode;
- ds >> inDesignMode;
- setDesignModeBehavior(inDesignMode);
- break;
- }
- case ObserverProtocol::ShowAppOnTop: {
- bool showOnTop;
- ds >> showOnTop;
- setShowAppOnTop(showOnTop);
- break;
- }
- case ObserverProtocol::CreateObject: {
- QString qml;
- int parentId;
- QString filename;
- QStringList imports;
- ds >> qml >> parentId >> imports >> filename;
- data->_q_createQmlObject(qml, QDeclarativeDebugService::objectForId(parentId),
- imports, filename);
- break;
- }
- case ObserverProtocol::DestroyObject: {
- int debugId;
- ds >> debugId;
- if (QObject* obj = QDeclarativeDebugService::objectForId(debugId))
- obj->deleteLater();
- break;
- }
- case ObserverProtocol::MoveObject: {
- int debugId, newParent;
- ds >> debugId >> newParent;
- data->_q_reparentQmlObject(QDeclarativeDebugService::objectForId(debugId),
- QDeclarativeDebugService::objectForId(newParent));
- break;
- }
- case ObserverProtocol::ObjectIdList: {
- int itemCount;
- ds >> itemCount;
- data->stringIdForObjectId.clear();
- for (int i = 0; i < itemCount; ++i) {
- int itemDebugId;
- QString itemIdString;
- ds >> itemDebugId
- >> itemIdString;
-
- data->stringIdForObjectId.insert(itemDebugId, itemIdString);
- }
- break;
- }
- case ObserverProtocol::ClearComponentCache: {
- data->_q_clearComponentCache();
- break;
- }
- default:
- qWarning() << "Warning: Not handling message:" << type;
- }
-}
-
-void QDeclarativeViewObserver::sendDesignModeBehavior(bool inDesignMode)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::SetDesignMode
- << inDesignMode;
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendCurrentObjects(const QList<QObject*> &objects)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::CurrentObjectsChanged
- << objects.length();
-
- foreach (QObject *object, objects) {
- int id = QDeclarativeDebugService::idForObject(object);
- ds << id;
- }
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendCurrentTool(Constants::DesignTool toolId)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::ToolChanged
- << toolId;
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendAnimationSpeed(qreal slowDownFactor)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::AnimationSpeedChanged
- << slowDownFactor;
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendAnimationPaused(bool paused)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::AnimationPausedChanged
- << paused;
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendReloaded()
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::Reloaded;
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendShowAppOnTop(bool showAppOnTop)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::ShowAppOnTop << showAppOnTop;
-
- data->debugService->sendMessage(message);
-}
-
-void QDeclarativeViewObserver::sendColorChanged(const QColor &color)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << ObserverProtocol::ColorChanged
- << color;
-
- data->debugService->sendMessage(message);
-}
-
-QString QDeclarativeViewObserver::idStringForObject(QObject *obj) const
-{
- int id = QDeclarativeDebugService::idForObject(obj);
- QString idString = data->stringIdForObjectId.value(id, QString());
- return idString;
-}
-
-QT_END_NAMESPACE
-
-#include "qdeclarativeviewobserver.moc"
diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h
deleted file mode 100644
index 5c70c98d9f..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEVIEWOBSERVER_P_H
-#define QDECLARATIVEVIEWOBSERVER_P_H
-
-#include <private/qdeclarativeglobal_p.h>
-#include "qmlobserverconstants_p.h"
-
-#include <QtCore/QScopedPointer>
-#include <QtDeclarative/QDeclarativeView>
-
-QT_FORWARD_DECLARE_CLASS(QDeclarativeItem)
-QT_FORWARD_DECLARE_CLASS(QMouseEvent)
-QT_FORWARD_DECLARE_CLASS(QToolBar)
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserverPrivate;
-
-class QDeclarativeViewObserver : public QObject
-{
- Q_OBJECT
-
-public:
- explicit QDeclarativeViewObserver(QDeclarativeView *view, QObject *parent = 0);
- ~QDeclarativeViewObserver();
-
- void setSelectedItems(QList<QGraphicsItem *> items);
- QList<QGraphicsItem *> selectedItems() const;
-
- QDeclarativeView *declarativeView();
-
- QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
-
- bool showAppOnTop() const;
-
- void sendDesignModeBehavior(bool inDesignMode);
- void sendCurrentObjects(const QList<QObject*> &);
- void sendAnimationSpeed(qreal slowDownFactor);
- void sendAnimationPaused(bool paused);
- void sendCurrentTool(Constants::DesignTool toolId);
- void sendReloaded();
- void sendShowAppOnTop(bool showAppOnTop);
-
- QString idStringForObject(QObject *obj) const;
-
-public Q_SLOTS:
- void sendColorChanged(const QColor &color);
-
- void setDesignModeBehavior(bool value);
- bool designModeBehavior();
-
- void setShowAppOnTop(bool appOnTop);
-
- void setAnimationSpeed(qreal factor);
- void setAnimationPaused(bool paused);
-
-Q_SIGNALS:
- void designModeBehaviorChanged(bool inDesignMode);
- void showAppOnTopChanged(bool showAppOnTop);
- void reloadRequested();
- void marqueeSelectToolActivated();
- void selectToolActivated();
- void zoomToolActivated();
- void colorPickerActivated();
- void selectedColorChanged(const QColor &color);
-
- void animationSpeedChanged(qreal factor);
- void animationPausedChanged(bool paused);
-
-protected:
- bool eventFilter(QObject *obj, QEvent *event);
-
- bool leaveEvent(QEvent *);
- bool mousePressEvent(QMouseEvent *event);
- bool mouseMoveEvent(QMouseEvent *event);
- bool mouseReleaseEvent(QMouseEvent *event);
- bool keyPressEvent(QKeyEvent *event);
- bool keyReleaseEvent(QKeyEvent *keyEvent);
- bool mouseDoubleClickEvent(QMouseEvent *event);
- bool wheelEvent(QWheelEvent *event);
-
- void setSelectedItemsForTools(QList<QGraphicsItem *> items);
-
-private slots:
- void handleMessage(const QByteArray &message);
-
- void animationSpeedChangeRequested(qreal factor);
- void animationPausedChangeRequested(bool paused);
-
-private:
- Q_DISABLE_COPY(QDeclarativeViewObserver)
-
- inline QDeclarativeViewObserverPrivate *d_func() { return data.data(); }
- QScopedPointer<QDeclarativeViewObserverPrivate> data;
- friend class QDeclarativeViewObserverPrivate;
- friend class AbstractLiveEditTool;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEVIEWOBSERVER_P_H
diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h
deleted file mode 100644
index 19e48984f4..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEVIEWOBSERVER_P_P_H
-#define QDECLARATIVEVIEWOBSERVER_P_P_H
-
-#include "qdeclarativeviewobserver_p.h"
-
-#include <QtCore/QWeakPointer>
-#include <QtCore/QPointF>
-
-#include "QtDeclarative/private/qdeclarativeobserverservice_p.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewObserver;
-class LiveSelectionTool;
-class ZoomTool;
-class ColorPickerTool;
-class LiveLayerItem;
-class BoundingRectHighlighter;
-class ToolBox;
-class AbstractLiveEditTool;
-
-class QDeclarativeViewObserverPrivate : public QObject
-{
- Q_OBJECT
-public:
- QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *);
- ~QDeclarativeViewObserverPrivate();
-
- QDeclarativeView *view;
- QDeclarativeViewObserver *q;
- QDeclarativeObserverService *debugService;
- QWeakPointer<QWidget> viewport;
- QHash<int, QString> stringIdForObjectId;
-
- QPointF cursorPos;
- QList<QWeakPointer<QGraphicsObject> > currentSelection;
-
- Constants::DesignTool currentToolMode;
- AbstractLiveEditTool *currentTool;
-
- LiveSelectionTool *selectionTool;
- ZoomTool *zoomTool;
- ColorPickerTool *colorPickerTool;
- LiveLayerItem *manipulatorLayer;
-
- BoundingRectHighlighter *boundingRectHighlighter;
-
- bool designModeBehavior;
- bool showAppOnTop;
-
- bool animationPaused;
- qreal slowDownFactor;
-
- ToolBox *toolBox;
-
- void setViewport(QWidget *widget);
-
- void clearEditorItems();
- void createToolBox();
- void changeToSelectTool();
- QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const;
-
- QList<QGraphicsItem*> selectableItems(const QPoint &pos) const;
- QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
- QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
-
- void setSelectedItemsForTools(const QList<QGraphicsItem *> &items);
- void setSelectedItems(const QList<QGraphicsItem *> &items);
- QList<QGraphicsItem *> selectedItems() const;
-
- void changeTool(Constants::DesignTool tool,
- Constants::ToolFlags flags = Constants::NoToolFlags);
-
- void clearHighlight();
- void highlight(const QList<QGraphicsObject *> &item);
- inline void highlight(QGraphicsObject *item)
- { highlight(QList<QGraphicsObject*>() << item); }
-
- bool isEditorItem(QGraphicsItem *item) const;
-
-public slots:
- void _q_setToolBoxVisible(bool visible);
-
- void _q_reloadView();
- void _q_onStatusChanged(QDeclarativeView::Status status);
- void _q_onCurrentObjectsChanged(QList<QObject*> objects);
- void _q_applyChangesFromClient();
- void _q_createQmlObject(const QString &qml, QObject *parent,
- const QStringList &imports, const QString &filename = QString());
- void _q_reparentQmlObject(QObject *, QObject *);
-
- void _q_changeToSingleSelectTool();
- void _q_changeToMarqueeSelectTool();
- void _q_changeToZoomTool();
- void _q_changeToColorPickerTool();
- void _q_clearComponentCache();
- void _q_removeFromSelection(QObject *);
-
-public:
- static QDeclarativeViewObserverPrivate *get(QDeclarativeViewObserver *v) { return v->d_func(); }
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEVIEWOBSERVER_P_P_H
diff --git a/src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h b/src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h
deleted file mode 100644
index 6d0a2634c3..0000000000
--- a/src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLOBSERVERCONSTANTS_H
-#define QMLOBSERVERCONSTANTS_H
-
-#include <QtDeclarative/private/qdeclarativeglobal_p.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-namespace Constants {
-
-enum DesignTool {
- NoTool = 0,
- SelectionToolMode = 1,
- MarqueeSelectionToolMode = 2,
- MoveToolMode = 3,
- ResizeToolMode = 4,
- ColorPickerMode = 5,
- ZoomMode = 6
-};
-
-enum ToolFlags {
- NoToolFlags = 0,
- UseCursorPos = 1
-};
-
-static const int DragStartTime = 50;
-
-static const int DragStartDistance = 20;
-
-static const double ZoomSnapDelta = 0.04;
-
-static const int EditorItemDataKey = 1000;
-
-enum GraphicsItemTypes {
- EditorItemType = 0xEAAA,
- ResizeHandleItemType = 0xEAEA
-};
-
-
-} // namespace Constants
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QMLOBSERVERCONSTANTS_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp
new file mode 100644
index 0000000000..36e6ba0ad7
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "abstractliveedittool_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
+
+#include <QDeclarativeEngine>
+
+#include <QtDebug>
+#include <QGraphicsItem>
+#include <QDeclarativeItem>
+
+QT_BEGIN_NAMESPACE
+
+AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewInspector *editorView)
+ : QObject(editorView), m_inspector(editorView)
+{
+}
+
+
+AbstractLiveEditTool::~AbstractLiveEditTool()
+{
+}
+
+QDeclarativeViewInspector *AbstractLiveEditTool::inspector() const
+{
+ return m_inspector;
+}
+
+QDeclarativeView *AbstractLiveEditTool::view() const
+{
+ return m_inspector->declarativeView();
+}
+
+QGraphicsScene* AbstractLiveEditTool::scene() const
+{
+ return view()->scene();
+}
+
+void AbstractLiveEditTool::updateSelectedItems()
+{
+ selectedItemsChanged(items());
+}
+
+QList<QGraphicsItem*> AbstractLiveEditTool::items() const
+{
+ return inspector()->selectedItems();
+}
+
+bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList)
+{
+ QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
+ if (firstSelectableItem == 0)
+ return false;
+ if (toQDeclarativeItem(firstSelectableItem) != 0)
+ return true;
+
+ return false;
+
+}
+
+bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList)
+{
+ QList<QGraphicsItem*> selectedItems = inspector()->selectedItems();
+
+ foreach (QGraphicsItem *item, itemList) {
+ QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
+ if (declarativeItem
+ && selectedItems.contains(declarativeItem)
+ /*&& (declarativeItem->qmlItemNode().hasShowContent() || selectNonContentItems)*/)
+ return true;
+ }
+
+ return false;
+
+}
+
+bool AbstractLiveEditTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/)
+{
+ return false;
+}
+
+QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
+{
+ return qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
+}
+
+QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)
+{
+ foreach (QGraphicsItem *item, itemList) {
+ if (item->flags().testFlag(QGraphicsItem::ItemIsMovable))
+ return item;
+ }
+ return 0;
+}
+
+QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList<QGraphicsItem*>
+ &itemList)
+{
+ foreach (QGraphicsItem *item, itemList) {
+ QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
+ if (declarativeItem /*&& (declarativeItem->qmlItemNode().hasShowContent())*/)
+ return declarativeItem;
+ }
+
+ return 0;
+}
+
+QList<QGraphicsObject*> AbstractLiveEditTool::toGraphicsObjectList(const QList<QGraphicsItem*>
+ &itemList)
+{
+ QList<QGraphicsObject*> gfxObjects;
+ foreach (QGraphicsItem *item, itemList) {
+ QGraphicsObject *obj = item->toGraphicsObject();
+ if (obj)
+ gfxObjects << obj;
+ }
+
+ return gfxObjects;
+}
+
+QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item)
+{
+ QString className(QLatin1String("QGraphicsItem"));
+ QString objectStringId;
+
+ QString constructedName;
+
+ QGraphicsObject *gfxObject = item->toGraphicsObject();
+ if (gfxObject) {
+ className = QLatin1String(gfxObject->metaObject()->className());
+
+ className.remove(QRegExp(QLatin1String("_QMLTYPE_\\d+")));
+ className.remove(QRegExp(QLatin1String("_QML_\\d+")));
+ if (className.startsWith(QLatin1String("QDeclarative")))
+ className = className.remove(QLatin1String("QDeclarative"));
+
+ QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(gfxObject);
+ if (declarativeItem) {
+ objectStringId = m_inspector->idStringForObject(declarativeItem);
+ }
+
+ if (!objectStringId.isEmpty()) {
+ constructedName = objectStringId + QLatin1String(" (") + className + QLatin1Char(')');
+ } else {
+ if (!gfxObject->objectName().isEmpty()) {
+ constructedName = gfxObject->objectName() + QLatin1String(" (") + className + QLatin1Char(')');
+ } else {
+ constructedName = className;
+ }
+ }
+ }
+
+ return constructedName;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h
new file mode 100644
index 0000000000..17eb6ea6ce
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTLIVEEDITTOOL_H
+#define ABSTRACTLIVEEDITTOOL_H
+
+#include <QtCore/QList>
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+class QMouseEvent;
+class QGraphicsItem;
+class QDeclarativeItem;
+class QKeyEvent;
+class QGraphicsScene;
+class QGraphicsObject;
+class QWheelEvent;
+class QDeclarativeView;
+QT_END_NAMESPACE
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+
+class AbstractLiveEditTool : public QObject
+{
+ Q_OBJECT
+public:
+ AbstractLiveEditTool(QDeclarativeViewInspector *inspector);
+
+ virtual ~AbstractLiveEditTool();
+
+ virtual void mousePressEvent(QMouseEvent *event) = 0;
+ virtual void mouseMoveEvent(QMouseEvent *event) = 0;
+ virtual void mouseReleaseEvent(QMouseEvent *event) = 0;
+ virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0;
+
+ virtual void hoverMoveEvent(QMouseEvent *event) = 0;
+ virtual void wheelEvent(QWheelEvent *event) = 0;
+
+ virtual void keyPressEvent(QKeyEvent *event) = 0;
+ virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
+ virtual void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList) = 0;
+
+ virtual void clear() = 0;
+
+ void updateSelectedItems();
+ QList<QGraphicsItem*> items() const;
+
+ bool topItemIsMovable(const QList<QGraphicsItem*> &itemList);
+ bool topItemIsResizeHandle(const QList<QGraphicsItem*> &itemList);
+ bool topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList);
+
+ QString titleForItem(QGraphicsItem *item);
+
+ static QList<QGraphicsObject*> toGraphicsObjectList(const QList<QGraphicsItem*> &itemList);
+ static QGraphicsItem* topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList);
+ static QDeclarativeItem* topMovableDeclarativeItem(const QList<QGraphicsItem*> &itemList);
+ static QDeclarativeItem *toQDeclarativeItem(QGraphicsItem *item);
+
+protected:
+ virtual void selectedItemsChanged(const QList<QGraphicsItem*> &objectList) = 0;
+
+ QDeclarativeViewInspector *inspector() const;
+ QDeclarativeView *view() const;
+ QGraphicsScene *scene() const;
+
+private:
+ QDeclarativeViewInspector *m_inspector;
+ QList<QGraphicsItem*> m_itemList;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // ABSTRACTLIVEEDITTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp
new file mode 100644
index 0000000000..3f95005f45
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp
@@ -0,0 +1,239 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "boundingrecthighlighter_p.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+#include "../qmlinspectorconstants_p.h"
+
+#include <QtGui/QGraphicsPolygonItem>
+
+#include <QtCore/QTimer>
+#include <QtCore/QObject>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
+ QObject *parent)
+ : QObject(parent),
+ highlightedObject(itemToHighlight),
+ highlightPolygon(0),
+ highlightPolygonEdge(0)
+{
+ highlightPolygon = new BoundingBoxPolygonItem(parentItem);
+ highlightPolygonEdge = new BoundingBoxPolygonItem(parentItem);
+
+ highlightPolygon->setPen(QPen(QColor(0, 22, 159)));
+ highlightPolygonEdge->setPen(QPen(QColor(158, 199, 255)));
+
+ highlightPolygon->setFlag(QGraphicsItem::ItemIsSelectable, false);
+ highlightPolygonEdge->setFlag(QGraphicsItem::ItemIsSelectable, false);
+}
+
+BoundingBox::~BoundingBox()
+{
+ highlightedObject.clear();
+}
+
+BoundingBoxPolygonItem::BoundingBoxPolygonItem(QGraphicsItem *item) : QGraphicsPolygonItem(item)
+{
+ QPen pen;
+ pen.setColor(QColor(108, 141, 221));
+ pen.setWidth(1);
+ setPen(pen);
+}
+
+int BoundingBoxPolygonItem::type() const
+{
+ return Constants::EditorItemType;
+}
+
+BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewInspector *view) :
+ LiveLayerItem(view->declarativeView()->scene()),
+ m_view(view)
+{
+}
+
+BoundingRectHighlighter::~BoundingRectHighlighter()
+{
+
+}
+
+void BoundingRectHighlighter::clear()
+{
+ foreach (BoundingBox *box, m_boxes)
+ freeBoundingBox(box);
+}
+
+BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const
+{
+ foreach (BoundingBox *box, m_boxes) {
+ if (box->highlightedObject.data() == item)
+ return box;
+ }
+ return 0;
+}
+
+void BoundingRectHighlighter::highlight(QList<QGraphicsObject*> items)
+{
+ if (items.isEmpty())
+ return;
+
+ QList<BoundingBox *> newBoxes;
+ foreach (QGraphicsObject *itemToHighlight, items) {
+ BoundingBox *box = boxFor(itemToHighlight);
+ if (!box)
+ box = createBoundingBox(itemToHighlight);
+
+ newBoxes << box;
+ }
+ qSort(newBoxes);
+
+ if (newBoxes != m_boxes) {
+ clear();
+ m_boxes << newBoxes;
+ }
+
+ highlightAll();
+}
+
+void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight)
+{
+ if (!itemToHighlight)
+ return;
+
+ BoundingBox *box = boxFor(itemToHighlight);
+ if (!box) {
+ box = createBoundingBox(itemToHighlight);
+ m_boxes << box;
+ qSort(m_boxes);
+ }
+
+ highlightAll();
+}
+
+BoundingBox *BoundingRectHighlighter::createBoundingBox(QGraphicsObject *itemToHighlight)
+{
+ if (!m_freeBoxes.isEmpty()) {
+ BoundingBox *box = m_freeBoxes.last();
+ if (box->highlightedObject.isNull()) {
+ box->highlightedObject = itemToHighlight;
+ box->highlightPolygon->show();
+ box->highlightPolygonEdge->show();
+ m_freeBoxes.removeLast();
+ return box;
+ }
+ }
+
+ BoundingBox *box = new BoundingBox(itemToHighlight, this, this);
+
+ connect(itemToHighlight, SIGNAL(xChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(yChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(widthChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(heightChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(rotationChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*)));
+
+ return box;
+}
+
+void BoundingRectHighlighter::removeBoundingBox(BoundingBox *box)
+{
+ delete box;
+ box = 0;
+}
+
+void BoundingRectHighlighter::freeBoundingBox(BoundingBox *box)
+{
+ if (!box->highlightedObject.isNull()) {
+ disconnect(box->highlightedObject.data(), SIGNAL(xChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(yChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(widthChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(heightChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(rotationChanged()), this, SLOT(refresh()));
+ }
+
+ box->highlightedObject.clear();
+ box->highlightPolygon->hide();
+ box->highlightPolygonEdge->hide();
+ m_boxes.removeOne(box);
+ m_freeBoxes << box;
+}
+
+void BoundingRectHighlighter::itemDestroyed(QObject *obj)
+{
+ foreach (BoundingBox *box, m_boxes) {
+ if (box->highlightedObject.data() == obj) {
+ freeBoundingBox(box);
+ break;
+ }
+ }
+}
+
+void BoundingRectHighlighter::highlightAll()
+{
+ foreach (BoundingBox *box, m_boxes) {
+ if (box && box->highlightedObject.isNull()) {
+ // clear all highlights
+ clear();
+ return;
+ }
+ QGraphicsObject *item = box->highlightedObject.data();
+
+ QRectF boundingRectInSceneSpace(item->mapToScene(item->boundingRect()).boundingRect());
+ QRectF boundingRectInLayerItemSpace = mapRectFromScene(boundingRectInSceneSpace);
+ QRectF bboxRect = m_view->adjustToScreenBoundaries(boundingRectInLayerItemSpace);
+ QRectF edgeRect = bboxRect;
+ edgeRect.adjust(-1, -1, 1, 1);
+
+ box->highlightPolygon->setPolygon(QPolygonF(bboxRect));
+ box->highlightPolygonEdge->setPolygon(QPolygonF(edgeRect));
+ }
+}
+
+void BoundingRectHighlighter::refresh()
+{
+ if (!m_boxes.isEmpty())
+ highlightAll();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h
new file mode 100644
index 0000000000..e2928f7f72
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BOUNDINGRECTHIGHLIGHTER_H
+#define BOUNDINGRECTHIGHLIGHTER_H
+
+#include "livelayeritem_p.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QWeakPointer>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+QT_FORWARD_DECLARE_CLASS(QPainter)
+QT_FORWARD_DECLARE_CLASS(QWidget)
+QT_FORWARD_DECLARE_CLASS(QStyleOptionGraphicsItem)
+QT_FORWARD_DECLARE_CLASS(QTimer)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+class BoundingBox;
+
+class BoundingRectHighlighter : public LiveLayerItem
+{
+ Q_OBJECT
+public:
+ explicit BoundingRectHighlighter(QDeclarativeViewInspector *view);
+ ~BoundingRectHighlighter();
+ void clear();
+ void highlight(QList<QGraphicsObject*> items);
+ void highlight(QGraphicsObject* item);
+
+private slots:
+ void refresh();
+ void itemDestroyed(QObject *);
+
+private:
+ BoundingBox *boxFor(QGraphicsObject *item) const;
+ void highlightAll();
+ BoundingBox *createBoundingBox(QGraphicsObject *itemToHighlight);
+ void removeBoundingBox(BoundingBox *box);
+ void freeBoundingBox(BoundingBox *box);
+
+private:
+ Q_DISABLE_COPY(BoundingRectHighlighter)
+
+ QDeclarativeViewInspector *m_view;
+ QList<BoundingBox* > m_boxes;
+ QList<BoundingBox* > m_freeBoxes;
+};
+
+class BoundingBox : public QObject
+{
+ Q_OBJECT
+public:
+ explicit BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
+ QObject *parent = 0);
+ ~BoundingBox();
+ QWeakPointer<QGraphicsObject> highlightedObject;
+ QGraphicsPolygonItem *highlightPolygon;
+ QGraphicsPolygonItem *highlightPolygonEdge;
+
+private:
+ Q_DISABLE_COPY(BoundingBox)
+
+};
+
+class BoundingBoxPolygonItem : public QGraphicsPolygonItem
+{
+public:
+ explicit BoundingBoxPolygonItem(QGraphicsItem *item);
+ int type() const;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // BOUNDINGRECTHIGHLIGHTER_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp
new file mode 100644
index 0000000000..bdae3d8298
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "colorpickertool_p.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QtGui/QMouseEvent>
+#include <QtGui/QKeyEvent>
+#include <QtCore/QRectF>
+#include <QtGui/QRgb>
+#include <QtGui/QImage>
+#include <QtGui/QApplication>
+#include <QtGui/QPalette>
+
+QT_BEGIN_NAMESPACE
+
+ColorPickerTool::ColorPickerTool(QDeclarativeViewInspector *view) :
+ AbstractLiveEditTool(view)
+{
+ m_selectedColor.setRgb(0,0,0);
+}
+
+ColorPickerTool::~ColorPickerTool()
+{
+
+}
+
+void ColorPickerTool::mousePressEvent(QMouseEvent * /*event*/)
+{
+}
+
+void ColorPickerTool::mouseMoveEvent(QMouseEvent *event)
+{
+ pickColor(event->pos());
+}
+
+void ColorPickerTool::mouseReleaseEvent(QMouseEvent *event)
+{
+ pickColor(event->pos());
+}
+
+void ColorPickerTool::mouseDoubleClickEvent(QMouseEvent * /*event*/)
+{
+}
+
+
+void ColorPickerTool::hoverMoveEvent(QMouseEvent * /*event*/)
+{
+}
+
+void ColorPickerTool::keyPressEvent(QKeyEvent * /*event*/)
+{
+}
+
+void ColorPickerTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/)
+{
+}
+void ColorPickerTool::wheelEvent(QWheelEvent * /*event*/)
+{
+}
+
+void ColorPickerTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
+{
+}
+
+void ColorPickerTool::clear()
+{
+ view()->setCursor(Qt::CrossCursor);
+}
+
+void ColorPickerTool::selectedItemsChanged(const QList<QGraphicsItem*> &/*itemList*/)
+{
+}
+
+void ColorPickerTool::pickColor(const QPoint &pos)
+{
+ QRgb fillColor = view()->backgroundBrush().color().rgb();
+ if (view()->backgroundBrush().style() == Qt::NoBrush)
+ fillColor = view()->palette().color(QPalette::Base).rgb();
+
+ QRectF target(0,0, 1, 1);
+ QRect source(pos.x(), pos.y(), 1, 1);
+ QImage img(1, 1, QImage::Format_ARGB32);
+ img.fill(fillColor);
+ QPainter painter(&img);
+ view()->render(&painter, target, source);
+ m_selectedColor = QColor::fromRgb(img.pixel(0, 0));
+
+ emit selectedColorChanged(m_selectedColor);
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h
new file mode 100644
index 0000000000..580c175c5b
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COLORPICKERTOOL_H
+#define COLORPICKERTOOL_H
+
+#include "abstractliveedittool_p.h"
+
+#include <QtGui/QColor>
+
+QT_FORWARD_DECLARE_CLASS(QPoint)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class ColorPickerTool : public AbstractLiveEditTool
+{
+ Q_OBJECT
+public:
+ explicit ColorPickerTool(QDeclarativeViewInspector *view);
+
+ virtual ~ColorPickerTool();
+
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
+
+ void hoverMoveEvent(QMouseEvent *event);
+
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *keyEvent);
+
+ void wheelEvent(QWheelEvent *event);
+
+ void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList);
+
+ void clear();
+
+signals:
+ void selectedColorChanged(const QColor &color);
+
+protected:
+
+ void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
+
+private:
+ void pickColor(const QPoint &pos);
+
+private:
+ QColor m_selectedColor;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // COLORPICKERTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc b/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc
new file mode 100644
index 0000000000..fb2393caa1
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc
@@ -0,0 +1,24 @@
+<RCC>
+ <qresource prefix="/qml">
+ <file>images/resize_handle.png</file>
+ <file>images/select.png</file>
+ <file>images/select-marquee.png</file>
+ <file>images/color-picker.png</file>
+ <file>images/play.png</file>
+ <file>images/pause.png</file>
+ <file>images/from-qml.png</file>
+ <file>images/to-qml.png</file>
+ <file>images/color-picker-hicontrast.png</file>
+ <file>images/zoom.png</file>
+ <file>images/color-picker-24.png</file>
+ <file>images/from-qml-24.png</file>
+ <file>images/pause-24.png</file>
+ <file>images/play-24.png</file>
+ <file>images/to-qml-24.png</file>
+ <file>images/zoom-24.png</file>
+ <file>images/select-24.png</file>
+ <file>images/select-marquee-24.png</file>
+ <file>images/inspectormode.png</file>
+ <file>images/inspectormode-24.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png
index cff47212a4..cff47212a4 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png
index b953d08a68..b953d08a68 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png
index 026c31b3e1..026c31b3e1 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png
index 0ad21f3dbb..0ad21f3dbb 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png
index 666382c06d..666382c06d 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png
index 5e74d867c0..5e74d867c0 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png
index daed21c944..daed21c944 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png
index d9a2f6f814..d9a2f6f814 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/pause.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png
index 114d89b12b..114d89b12b 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/pause.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png
index e2b9fbcf51..e2b9fbcf51 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/play.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png
index 011598a746..011598a746 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/play.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/reload.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png
index 7042bec9ae..7042bec9ae 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/reload.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png
index 2934f25b74..2934f25b74 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png
index 5388a9d16a..5388a9d16a 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png
index 0111ddae45..0111ddae45 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png
index 92fe40d1ad..92fe40d1ad 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png
index 672285582b..672285582b 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/select.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png
index b72450ddd4..b72450ddd4 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png
index 2ab951fd08..2ab951fd08 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png
index 03462001ec..03462001ec 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png
Binary files differ
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png
index 17f0da6d64..17f0da6d64 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png
Binary files differ
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp
new file mode 100644
index 0000000000..c28893ef6a
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "livelayeritem_p.h"
+
+#include "../qmlinspectorconstants_p.h"
+
+#include <QGraphicsScene>
+
+QT_BEGIN_NAMESPACE
+
+LiveLayerItem::LiveLayerItem(QGraphicsScene* scene)
+ : QGraphicsObject()
+{
+ scene->addItem(this);
+ setZValue(1);
+ setFlag(QGraphicsItem::ItemIsMovable, false);
+}
+
+LiveLayerItem::~LiveLayerItem()
+{
+}
+
+void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/,
+ QWidget * /*widget*/)
+{
+}
+
+int LiveLayerItem::type() const
+{
+ return Constants::EditorItemType;
+}
+
+QRectF LiveLayerItem::boundingRect() const
+{
+ return childrenBoundingRect();
+}
+
+QList<QGraphicsItem*> LiveLayerItem::findAllChildItems() const
+{
+ return findAllChildItems(this);
+}
+
+QList<QGraphicsItem*> LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const
+{
+ QList<QGraphicsItem*> itemList(item->childItems());
+
+ foreach (QGraphicsItem *childItem, item->childItems())
+ itemList += findAllChildItems(childItem);
+
+ return itemList;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h
index da622e18a0..da622e18a0 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp
new file mode 100644
index 0000000000..d32847d5bd
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liverubberbandselectionmanipulator_p.h"
+
+#include "../qdeclarativeviewinspector_p_p.h"
+
+#include <QtGui/QGraphicsItem>
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
+ QDeclarativeViewInspector *editorView)
+ : m_selectionRectangleElement(layerItem),
+ m_editorView(editorView),
+ m_beginFormEditorItem(0),
+ m_isActive(false)
+{
+ m_selectionRectangleElement.hide();
+}
+
+void LiveRubberBandSelectionManipulator::clear()
+{
+ m_selectionRectangleElement.clear();
+ m_isActive = false;
+ m_beginPoint = QPointF();
+ m_itemList.clear();
+ m_oldSelectionList.clear();
+}
+
+QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList<QGraphicsItem*>
+ &itemList)
+{
+ if (itemList.isEmpty())
+ return 0;
+
+ return itemList.first();
+}
+
+void LiveRubberBandSelectionManipulator::begin(const QPointF &beginPoint)
+{
+ m_beginPoint = beginPoint;
+ m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint);
+ m_selectionRectangleElement.show();
+ m_isActive = true;
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(m_editorView);
+ m_beginFormEditorItem = topFormEditorItem(inspectorPrivate->selectableItems(beginPoint));
+ m_oldSelectionList = m_editorView->selectedItems();
+}
+
+void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint)
+{
+ m_selectionRectangleElement.setRect(m_beginPoint, updatePoint);
+}
+
+void LiveRubberBandSelectionManipulator::end()
+{
+ m_oldSelectionList.clear();
+ m_selectionRectangleElement.hide();
+ m_isActive = false;
+}
+
+void LiveRubberBandSelectionManipulator::select(SelectionType selectionType)
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(m_editorView);
+ QList<QGraphicsItem*> itemList
+ = inspectorPrivate->selectableItems(m_selectionRectangleElement.rect(),
+ Qt::IntersectsItemShape);
+ QList<QGraphicsItem*> newSelectionList;
+
+ foreach (QGraphicsItem* item, itemList) {
+ if (item
+ && item->parentItem()
+ && !newSelectionList.contains(item)
+ //&& m_beginFormEditorItem->childItems().contains(item) // TODO activate this test
+ )
+ {
+ newSelectionList.append(item);
+ }
+ }
+
+ if (newSelectionList.isEmpty() && m_beginFormEditorItem)
+ newSelectionList.append(m_beginFormEditorItem);
+
+ QList<QGraphicsItem*> resultList;
+
+ switch (selectionType) {
+ case AddToSelection: {
+ resultList.append(m_oldSelectionList);
+ resultList.append(newSelectionList);
+ }
+ break;
+ case ReplaceSelection: {
+ resultList.append(newSelectionList);
+ }
+ break;
+ case RemoveFromSelection: {
+ QSet<QGraphicsItem*> oldSelectionSet(m_oldSelectionList.toSet());
+ QSet<QGraphicsItem*> newSelectionSet(newSelectionList.toSet());
+ resultList.append(oldSelectionSet.subtract(newSelectionSet).toList());
+ }
+ }
+
+ m_editorView->setSelectedItems(resultList);
+}
+
+
+void LiveRubberBandSelectionManipulator::setItems(const QList<QGraphicsItem*> &itemList)
+{
+ m_itemList = itemList;
+}
+
+QPointF LiveRubberBandSelectionManipulator::beginPoint() const
+{
+ return m_beginPoint;
+}
+
+bool LiveRubberBandSelectionManipulator::isActive() const
+{
+ return m_isActive;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h
new file mode 100644
index 0000000000..9abcb2b70c
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef RUBBERBANDSELECTIONMANIPULATOR_H
+#define RUBBERBANDSELECTIONMANIPULATOR_H
+
+#include "liveselectionrectangle_p.h"
+
+#include <QtCore/QPointF>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+
+class LiveRubberBandSelectionManipulator
+{
+public:
+ enum SelectionType {
+ ReplaceSelection,
+ AddToSelection,
+ RemoveFromSelection
+ };
+
+ LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
+ QDeclarativeViewInspector *editorView);
+
+ void setItems(const QList<QGraphicsItem*> &itemList);
+
+ void begin(const QPointF& beginPoint);
+ void update(const QPointF& updatePoint);
+ void end();
+
+ void clear();
+
+ void select(SelectionType selectionType);
+
+ QPointF beginPoint() const;
+
+ bool isActive() const;
+
+protected:
+ QGraphicsItem *topFormEditorItem(const QList<QGraphicsItem*> &itemList);
+
+private:
+ QList<QGraphicsItem*> m_itemList;
+ QList<QGraphicsItem*> m_oldSelectionList;
+ LiveSelectionRectangle m_selectionRectangleElement;
+ QPointF m_beginPoint;
+ QDeclarativeViewInspector *m_editorView;
+ QGraphicsItem *m_beginFormEditorItem;
+ bool m_isActive;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // RUBBERBANDSELECTIONMANIPULATOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
new file mode 100644
index 0000000000..4450fc5110
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liveselectionindicator_p.h"
+
+#include "../qdeclarativeviewinspector_p_p.h"
+#include "../qmlinspectorconstants_p.h"
+
+#include <QtGui/QGraphicsRectItem>
+#include <QtGui/QGraphicsObject>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QPen>
+
+QT_BEGIN_NAMESPACE
+
+LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector,
+ QGraphicsObject *layerItem)
+ : m_layerItem(layerItem)
+ , m_view(viewInspector)
+{
+}
+
+LiveSelectionIndicator::~LiveSelectionIndicator()
+{
+ clear();
+}
+
+void LiveSelectionIndicator::show()
+{
+ foreach (QGraphicsRectItem *item, m_indicatorShapeHash)
+ item->show();
+}
+
+void LiveSelectionIndicator::hide()
+{
+ foreach (QGraphicsRectItem *item, m_indicatorShapeHash)
+ item->hide();
+}
+
+void LiveSelectionIndicator::clear()
+{
+ if (!m_layerItem.isNull()) {
+ QGraphicsScene *scene = m_layerItem.data()->scene();
+ foreach (QGraphicsRectItem *item, m_indicatorShapeHash) {
+ scene->removeItem(item);
+ delete item;
+ }
+ }
+
+ m_indicatorShapeHash.clear();
+
+}
+
+void LiveSelectionIndicator::setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList)
+{
+ clear();
+
+ foreach (const QWeakPointer<QGraphicsObject> &object, itemList) {
+ if (object.isNull())
+ continue;
+
+ QGraphicsItem *item = object.data();
+
+ if (!m_indicatorShapeHash.contains(item)) {
+ QGraphicsRectItem *selectionIndicator = new QGraphicsRectItem(m_layerItem.data());
+ m_indicatorShapeHash.insert(item, selectionIndicator);
+
+ const QRectF boundingRect = m_view->adjustToScreenBoundaries(item->mapRectToScene(item->boundingRect()));
+ const QRectF boundingRectInLayerItemSpace = m_layerItem.data()->mapRectFromScene(boundingRect);
+
+ selectionIndicator->setData(Constants::EditorItemDataKey, true);
+ selectionIndicator->setFlag(QGraphicsItem::ItemIsSelectable, false);
+ selectionIndicator->setRect(boundingRectInLayerItemSpace);
+ selectionIndicator->setPen(QColor(108, 141, 221));
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h
new file mode 100644
index 0000000000..fa6eb306b9
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESELECTIONINDICATOR_H
+#define LIVESELECTIONINDICATOR_H
+
+#include <QtCore/QWeakPointer>
+#include <QtCore/QHash>
+
+QT_BEGIN_NAMESPACE
+class QGraphicsObject;
+class QGraphicsRectItem;
+class QGraphicsItem;
+class QPolygonF;
+QT_END_NAMESPACE
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+
+class LiveSelectionIndicator
+{
+public:
+ LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector, QGraphicsObject *layerItem);
+ ~LiveSelectionIndicator();
+
+ void show();
+ void hide();
+
+ void clear();
+
+ void setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList);
+
+private:
+ QHash<QGraphicsItem*, QGraphicsRectItem *> m_indicatorShapeHash;
+ QWeakPointer<QGraphicsObject> m_layerItem;
+ QDeclarativeViewInspector *m_view;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // LIVESELECTIONINDICATOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp
new file mode 100644
index 0000000000..267079a2a1
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liveselectionrectangle_p.h"
+
+#include "../qmlinspectorconstants_p.h"
+
+#include <QtGui/QPen>
+#include <QtGui/QGraphicsRectItem>
+#include <QtGui/QGraphicsObject>
+#include <QtGui/QGraphicsScene>
+
+#include <QtCore/QtDebug>
+
+#include <cmath>
+
+QT_BEGIN_NAMESPACE
+
+class SelectionRectShape : public QGraphicsRectItem
+{
+public:
+ SelectionRectShape(QGraphicsItem *parent = 0) : QGraphicsRectItem(parent) {}
+ int type() const { return Constants::EditorItemType; }
+};
+
+LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem)
+ : m_controlShape(new SelectionRectShape(layerItem)),
+ m_layerItem(layerItem)
+{
+ m_controlShape->setPen(QPen(Qt::black));
+ m_controlShape->setBrush(QColor(128, 128, 128, 50));
+}
+
+LiveSelectionRectangle::~LiveSelectionRectangle()
+{
+ if (m_layerItem)
+ m_layerItem.data()->scene()->removeItem(m_controlShape);
+}
+
+void LiveSelectionRectangle::clear()
+{
+ hide();
+}
+void LiveSelectionRectangle::show()
+{
+ m_controlShape->show();
+}
+
+void LiveSelectionRectangle::hide()
+{
+ m_controlShape->hide();
+}
+
+QRectF LiveSelectionRectangle::rect() const
+{
+ return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect();
+}
+
+void LiveSelectionRectangle::setRect(const QPointF &firstPoint,
+ const QPointF &secondPoint)
+{
+ double firstX = std::floor(firstPoint.x()) + 0.5;
+ double firstY = std::floor(firstPoint.y()) + 0.5;
+ double secondX = std::floor(secondPoint.x()) + 0.5;
+ double secondY = std::floor(secondPoint.y()) + 0.5;
+ QPointF topLeftPoint(firstX < secondX ? firstX : secondX,
+ firstY < secondY ? firstY : secondY);
+ QPointF bottomRightPoint(firstX > secondX ? firstX : secondX,
+ firstY > secondY ? firstY : secondY);
+
+ QRectF rect(topLeftPoint, bottomRightPoint);
+ m_controlShape->setRect(rect);
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h
index 5da9fb884d..5da9fb884d 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
new file mode 100644
index 0000000000..c55cba3966
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
@@ -0,0 +1,438 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liveselectiontool_p.h"
+#include "livelayeritem_p.h"
+
+#include "../qdeclarativeviewinspector_p_p.h"
+
+#include <QtGui/QApplication>
+#include <QtGui/QWheelEvent>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QClipboard>
+#include <QtGui/QMenu>
+#include <QtGui/QAction>
+#include <QtGui/QGraphicsObject>
+
+#include <QtDeclarative/QDeclarativeItem>
+#include <QtDeclarative/QDeclarativeEngine>
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+LiveSelectionTool::LiveSelectionTool(QDeclarativeViewInspector *editorView) :
+ AbstractLiveEditTool(editorView),
+ m_rubberbandSelectionMode(false),
+ m_rubberbandSelectionManipulator(
+ QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer, editorView),
+ m_singleSelectionManipulator(editorView),
+ m_selectionIndicator(editorView,
+ QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer),
+ //m_resizeIndicator(editorView->manipulatorLayer()),
+ m_selectOnlyContentItems(true)
+{
+
+}
+
+LiveSelectionTool::~LiveSelectionTool()
+{
+}
+
+void LiveSelectionTool::setRubberbandSelectionMode(bool value)
+{
+ m_rubberbandSelectionMode = value;
+}
+
+LiveSingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers
+ modifiers)
+{
+ LiveSingleSelectionManipulator::SelectionType selectionType
+ = LiveSingleSelectionManipulator::ReplaceSelection;
+ if (modifiers.testFlag(Qt::ControlModifier)) {
+ selectionType = LiveSingleSelectionManipulator::RemoveFromSelection;
+ } else if (modifiers.testFlag(Qt::ShiftModifier)) {
+ selectionType = LiveSingleSelectionManipulator::AddToSelection;
+ }
+ return selectionType;
+}
+
+bool LiveSelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ const QList<QGraphicsItem*> selectedItems = inspectorPrivate->selectedItems();
+
+ if (selectedItems.isEmpty())
+ return false;
+
+ foreach (QGraphicsItem *item, itemList)
+ if (selectedItems.contains(item))
+ return true;
+
+ return false;
+}
+
+void LiveSelectionTool::mousePressEvent(QMouseEvent *event)
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(event->pos());
+ LiveSingleSelectionManipulator::SelectionType selectionType = getSelectionType(event->modifiers());
+
+ if (event->buttons() & Qt::LeftButton) {
+ m_mousePressTimer.start();
+
+ if (m_rubberbandSelectionMode) {
+ m_rubberbandSelectionManipulator.begin(event->pos());
+ } else {
+ m_singleSelectionManipulator.begin(event->pos());
+ m_singleSelectionManipulator.select(selectionType, m_selectOnlyContentItems);
+ }
+ } else if (event->buttons() & Qt::RightButton) {
+ createContextMenu(itemList, event->globalPos());
+ }
+}
+
+void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos)
+{
+ QMenu contextMenu;
+ connect(&contextMenu, SIGNAL(hovered(QAction*)),
+ this, SLOT(contextMenuElementHovered(QAction*)));
+
+ m_contextMenuItemList = itemList;
+
+ contextMenu.addAction(tr("Items"));
+ contextMenu.addSeparator();
+ int shortcutKey = Qt::Key_1;
+ bool addKeySequence = true;
+ int i = 0;
+
+ foreach (QGraphicsItem * const item, itemList) {
+ QString itemTitle = titleForItem(item);
+ QAction *elementAction = contextMenu.addAction(itemTitle, this,
+ SLOT(contextMenuElementSelected()));
+
+ if (inspector()->selectedItems().contains(item)) {
+ QFont boldFont = elementAction->font();
+ boldFont.setBold(true);
+ elementAction->setFont(boldFont);
+ }
+
+ elementAction->setData(i);
+ if (addKeySequence)
+ elementAction->setShortcut(QKeySequence(shortcutKey));
+
+ shortcutKey++;
+ if (shortcutKey > Qt::Key_9)
+ addKeySequence = false;
+
+ ++i;
+ }
+ // add root item separately
+ // QString itemTitle = QString(tr("%1")).arg(titleForItem(view()->currentRootItem()));
+ // contextMenu.addAction(itemTitle, this, SLOT(contextMenuElementSelected()));
+ // m_contextMenuItemList.append(view()->currentRootItem());
+
+ contextMenu.exec(globalPos);
+ m_contextMenuItemList.clear();
+}
+
+void LiveSelectionTool::contextMenuElementSelected()
+{
+ QAction *senderAction = static_cast<QAction*>(sender());
+ int itemListIndex = senderAction->data().toInt();
+ if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
+
+ QPointF updatePt(0, 0);
+ QGraphicsItem *item = m_contextMenuItemList.at(itemListIndex);
+ m_singleSelectionManipulator.begin(updatePt);
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
+ QList<QGraphicsItem*>() << item,
+ false);
+ m_singleSelectionManipulator.end(updatePt);
+ }
+}
+
+void LiveSelectionTool::contextMenuElementHovered(QAction *action)
+{
+ int itemListIndex = action->data().toInt();
+ if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
+ QGraphicsObject *item = m_contextMenuItemList.at(itemListIndex)->toGraphicsObject();
+ QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item);
+ }
+}
+
+void LiveSelectionTool::mouseMoveEvent(QMouseEvent *event)
+{
+ if (m_singleSelectionManipulator.isActive()) {
+ QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos();
+
+ if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance)
+ && (m_mousePressTimer.elapsed() > Constants::DragStartTime))
+ {
+ m_singleSelectionManipulator.end(event->pos());
+ //view()->changeToMoveTool(m_singleSelectionManipulator.beginPoint());
+ return;
+ }
+ } else if (m_rubberbandSelectionManipulator.isActive()) {
+ QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
+
+ if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance)
+ && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) {
+ m_rubberbandSelectionManipulator.update(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::RemoveFromSelection);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::AddToSelection);
+ else
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::ReplaceSelection);
+ }
+ }
+}
+
+void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event)
+{
+// ### commented out until move tool is re-enabled
+// QList<QGraphicsItem*> itemList = view()->items(event->pos());
+// if (!itemList.isEmpty() && !m_rubberbandSelectionMode) {
+//
+// foreach (QGraphicsItem *item, itemList) {
+// if (item->type() == Constants::ResizeHandleItemType) {
+// ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(item);
+// if (resizeHandle)
+// view()->changeTool(Constants::ResizeToolMode);
+// return;
+// }
+// }
+// if (topSelectedItemIsMovable(itemList))
+// view()->changeTool(Constants::MoveToolMode);
+// }
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+
+ QList<QGraphicsItem*> selectableItemList = inspectorPrivate->selectableItems(event->pos());
+ if (!selectableItemList.isEmpty()) {
+ QGraphicsObject *item = selectableItemList.first()->toGraphicsObject();
+ if (item)
+ QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item);
+
+ return;
+ }
+
+ QDeclarativeViewInspectorPrivate::get(inspector())->clearHighlight();
+}
+
+void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (m_singleSelectionManipulator.isActive()) {
+ m_singleSelectionManipulator.end(event->pos());
+ }
+ else if (m_rubberbandSelectionManipulator.isActive()) {
+
+ QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
+ if (mouseMovementVector.toPoint().manhattanLength() < Constants::DragStartDistance) {
+ m_singleSelectionManipulator.begin(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection,
+ m_selectOnlyContentItems);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection,
+ m_selectOnlyContentItems);
+ else
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
+ m_selectOnlyContentItems);
+
+ m_singleSelectionManipulator.end(event->pos());
+ } else {
+ m_rubberbandSelectionManipulator.update(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::RemoveFromSelection);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::AddToSelection);
+ else
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::ReplaceSelection);
+
+ m_rubberbandSelectionManipulator.end();
+ }
+ }
+}
+
+void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/)
+{
+}
+
+void LiveSelectionTool::keyPressEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Left:
+ case Qt::Key_Right:
+ case Qt::Key_Up:
+ case Qt::Key_Down:
+ // disabled for now, cannot move stuff yet.
+ //view()->changeTool(Constants::MoveToolMode);
+ //view()->currentTool()->keyPressEvent(event);
+ break;
+ }
+}
+
+void LiveSelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/)
+{
+
+}
+
+void LiveSelectionTool::wheelEvent(QWheelEvent *event)
+{
+ if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode)
+ return;
+
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(event->pos());
+
+ if (itemList.isEmpty())
+ return;
+
+ int selectedIdx = 0;
+ if (!inspector()->selectedItems().isEmpty()) {
+ selectedIdx = itemList.indexOf(inspector()->selectedItems().first());
+ if (selectedIdx >= 0) {
+ if (event->delta() > 0) {
+ selectedIdx++;
+ if (selectedIdx == itemList.length())
+ selectedIdx = 0;
+ } else if (event->delta() < 0) {
+ selectedIdx--;
+ if (selectedIdx == -1)
+ selectedIdx = itemList.length() - 1;
+ }
+ } else {
+ selectedIdx = 0;
+ }
+ }
+
+ QPointF updatePt(0, 0);
+ m_singleSelectionManipulator.begin(updatePt);
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::ReplaceSelection,
+ QList<QGraphicsItem*>() << itemList.at(selectedIdx),
+ false);
+ m_singleSelectionManipulator.end(updatePt);
+
+}
+
+void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
+{
+ m_selectOnlyContentItems = selectOnlyContentItems;
+}
+
+void LiveSelectionTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
+{
+}
+
+void LiveSelectionTool::clear()
+{
+ view()->setCursor(Qt::ArrowCursor);
+ m_rubberbandSelectionManipulator.clear(),
+ m_singleSelectionManipulator.clear();
+ m_selectionIndicator.clear();
+ //m_resizeIndicator.clear();
+}
+
+void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
+{
+ foreach (const QWeakPointer<QGraphicsObject> &obj, m_selectedItemList) {
+ if (!obj.isNull()) {
+ disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects()));
+ }
+ }
+
+ QList<QGraphicsObject*> objects = toGraphicsObjectList(itemList);
+ m_selectedItemList.clear();
+
+ foreach (QGraphicsObject *obj, objects) {
+ m_selectedItemList.append(obj);
+ connect(obj, SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects()));
+ }
+
+ m_selectionIndicator.setItems(m_selectedItemList);
+ //m_resizeIndicator.setItems(toGraphicsObjectList(itemList));
+}
+
+void LiveSelectionTool::repaintBoundingRects()
+{
+ m_selectionIndicator.setItems(m_selectedItemList);
+}
+
+void LiveSelectionTool::selectUnderPoint(QMouseEvent *event)
+{
+ m_singleSelectionManipulator.begin(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection,
+ m_selectOnlyContentItems);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection,
+ m_selectOnlyContentItems);
+ else
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
+ m_selectOnlyContentItems);
+
+ m_singleSelectionManipulator.end(event->pos());
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h
new file mode 100644
index 0000000000..7562f3e854
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESELECTIONTOOL_H
+#define LIVESELECTIONTOOL_H
+
+#include "abstractliveedittool_p.h"
+#include "liverubberbandselectionmanipulator_p.h"
+#include "livesingleselectionmanipulator_p.h"
+#include "liveselectionindicator_p.h"
+
+#include <QtCore/QList>
+#include <QtCore/QTime>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+QT_FORWARD_DECLARE_CLASS(QMouseEvent)
+QT_FORWARD_DECLARE_CLASS(QKeyEvent)
+QT_FORWARD_DECLARE_CLASS(QAction)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class LiveSelectionTool : public AbstractLiveEditTool
+{
+ Q_OBJECT
+
+public:
+ LiveSelectionTool(QDeclarativeViewInspector* editorView);
+ ~LiveSelectionTool();
+
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
+ void hoverMoveEvent(QMouseEvent *event);
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *keyEvent);
+ void wheelEvent(QWheelEvent *event);
+
+ void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList);
+// QVariant itemChange(const QList<QGraphicsItem*> &itemList,
+// QGraphicsItem::GraphicsItemChange change,
+// const QVariant &value );
+
+// void update();
+
+ void clear();
+
+ void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
+
+ void selectUnderPoint(QMouseEvent *event);
+
+ void setSelectOnlyContentItems(bool selectOnlyContentItems);
+
+ void setRubberbandSelectionMode(bool value);
+
+private slots:
+ void contextMenuElementSelected();
+ void contextMenuElementHovered(QAction *action);
+ void repaintBoundingRects();
+
+private:
+ void createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos);
+ LiveSingleSelectionManipulator::SelectionType getSelectionType(Qt::KeyboardModifiers modifiers);
+ bool alreadySelected(const QList<QGraphicsItem*> &itemList) const;
+
+private:
+ bool m_rubberbandSelectionMode;
+ LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator;
+ LiveSingleSelectionManipulator m_singleSelectionManipulator;
+ LiveSelectionIndicator m_selectionIndicator;
+ //ResizeIndicator m_resizeIndicator;
+ QTime m_mousePressTimer;
+ bool m_selectOnlyContentItems;
+
+ QList<QWeakPointer<QGraphicsObject> > m_selectedItemList;
+
+ QList<QGraphicsItem*> m_contextMenuItemList;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // LIVESELECTIONTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp
new file mode 100644
index 0000000000..ee9843bedc
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "livesingleselectionmanipulator_p.h"
+
+#include "../qdeclarativeviewinspector_p_p.h"
+
+#include <QtDebug>
+
+QT_BEGIN_NAMESPACE
+
+LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView)
+ : m_editorView(editorView),
+ m_isActive(false)
+{
+}
+
+
+void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint)
+{
+ m_beginPoint = beginPoint;
+ m_isActive = true;
+ m_oldSelectionList = QDeclarativeViewInspectorPrivate::get(m_editorView)->selectedItems();
+}
+
+void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/)
+{
+ m_oldSelectionList.clear();
+}
+
+void LiveSingleSelectionManipulator::clear()
+{
+ m_beginPoint = QPointF();
+ m_oldSelectionList.clear();
+}
+
+
+void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/)
+{
+ m_oldSelectionList.clear();
+ m_isActive = false;
+}
+
+void LiveSingleSelectionManipulator::select(SelectionType selectionType,
+ const QList<QGraphicsItem*> &items,
+ bool /*selectOnlyContentItems*/)
+{
+ QGraphicsItem *selectedItem = 0;
+
+ foreach (QGraphicsItem* item, items)
+ {
+ //FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
+ if (item
+ /*&& !formEditorItem->qmlItemNode().isRootNode()
+ && (formEditorItem->qmlItemNode().hasShowContent() || !selectOnlyContentItems)*/)
+ {
+ selectedItem = item;
+ break;
+ }
+ }
+
+ QList<QGraphicsItem*> resultList;
+
+ switch (selectionType) {
+ case AddToSelection: {
+ resultList.append(m_oldSelectionList);
+ if (selectedItem && !m_oldSelectionList.contains(selectedItem))
+ resultList.append(selectedItem);
+ }
+ break;
+ case ReplaceSelection: {
+ if (selectedItem)
+ resultList.append(selectedItem);
+ }
+ break;
+ case RemoveFromSelection: {
+ resultList.append(m_oldSelectionList);
+ if (selectedItem)
+ resultList.removeAll(selectedItem);
+ }
+ break;
+ case InvertSelection: {
+ if (selectedItem
+ && !m_oldSelectionList.contains(selectedItem))
+ {
+ resultList.append(selectedItem);
+ }
+ }
+ }
+
+ m_editorView->setSelectedItems(resultList);
+}
+
+void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems)
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate =
+ QDeclarativeViewInspectorPrivate::get(m_editorView);
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(m_beginPoint);
+ select(selectionType, itemList, selectOnlyContentItems);
+}
+
+
+bool LiveSingleSelectionManipulator::isActive() const
+{
+ return m_isActive;
+}
+
+QPointF LiveSingleSelectionManipulator::beginPoint() const
+{
+ return m_beginPoint;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h
new file mode 100644
index 0000000000..40b5fc0208
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESINGLESELECTIONMANIPULATOR_H
+#define LIVESINGLESELECTIONMANIPULATOR_H
+
+#include <QtCore/QPointF>
+#include <QtCore/QList>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+
+class LiveSingleSelectionManipulator
+{
+public:
+ LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView);
+
+ enum SelectionType {
+ ReplaceSelection,
+ AddToSelection,
+ RemoveFromSelection,
+ InvertSelection
+ };
+
+ void begin(const QPointF& beginPoint);
+ void update(const QPointF& updatePoint);
+ void end(const QPointF& updatePoint);
+
+ void select(SelectionType selectionType, const QList<QGraphicsItem*> &items,
+ bool selectOnlyContentItems);
+ void select(SelectionType selectionType, bool selectOnlyContentItems);
+
+ void clear();
+
+ QPointF beginPoint() const;
+
+ bool isActive() const;
+
+private:
+ QList<QGraphicsItem*> m_oldSelectionList;
+ QPointF m_beginPoint;
+ QDeclarativeViewInspector *m_editorView;
+ bool m_isActive;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // LIVESINGLESELECTIONMANIPULATOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp
new file mode 100644
index 0000000000..0a7267434a
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp
@@ -0,0 +1,328 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmltoolbar_p.h"
+#include "toolbarcolorbox_p.h"
+
+#include <QtGui/QLabel>
+#include <QtGui/QIcon>
+#include <QtGui/QAction>
+#include <QtGui/QMenu>
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+QmlToolBar::QmlToolBar(QWidget *parent)
+ : QToolBar(parent)
+ , m_emitSignals(true)
+ , m_paused(false)
+ , m_animationSpeed(1.0f)
+ , ui(new Ui)
+{
+ ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png"));
+ ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png"));
+
+ ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/inspectormode-24.png")),
+ tr("Inspector Mode"), this);
+ ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this);
+ ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this);
+ ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")),
+ tr("Select (Marquee)"), this);
+ ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this);
+ ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-24.png")),
+ tr("Color Picker"), this);
+ ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-24.png")),
+ tr("Apply Changes to QML Viewer"), this);
+ ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-24.png")),
+ tr("Apply Changes to Document"), this);
+ ui->designmode->setCheckable(true);
+ ui->designmode->setChecked(false);
+
+ ui->play->setCheckable(false);
+ ui->select->setCheckable(true);
+ ui->selectMarquee->setCheckable(true);
+ ui->zoom->setCheckable(true);
+ ui->colorPicker->setCheckable(true);
+
+ setWindowTitle(tr("Tools"));
+
+ addAction(ui->designmode);
+ addAction(ui->play);
+ addSeparator();
+
+ addAction(ui->select);
+ // disabled because multi selection does not do anything useful without design mode
+ //addAction(ui->selectMarquee);
+ addSeparator();
+ addAction(ui->zoom);
+ addAction(ui->colorPicker);
+ //addAction(ui->fromQml);
+
+ ui->colorBox = new ToolBarColorBox(this);
+ ui->colorBox->setMinimumSize(24, 24);
+ ui->colorBox->setMaximumSize(28, 28);
+ ui->colorBox->setColor(Qt::black);
+ addWidget(ui->colorBox);
+
+ setWindowFlags(Qt::Tool);
+
+ QMenu *playSpeedMenu = new QMenu(this);
+ ui->playSpeedMenuActions = new QActionGroup(this);
+ ui->playSpeedMenuActions->setExclusive(true);
+
+ QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setChecked(true);
+ speedAction->setData(1.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(2.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(4.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(8.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(10.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ ui->play->setMenu(playSpeedMenu);
+
+ connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool)));
+
+ connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
+
+ connect(ui->play, SIGNAL(triggered()), SLOT(activatePlayOnClick()));
+
+ connect(ui->zoom, SIGNAL(triggered()), SLOT(activateZoomOnClick()));
+ connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
+ connect(ui->select, SIGNAL(triggered()), SLOT(activateSelectToolOnClick()));
+ connect(ui->selectMarquee, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick()));
+
+ connect(ui->toQml, SIGNAL(triggered()), SLOT(activateToQml()));
+ connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml()));
+}
+
+QmlToolBar::~QmlToolBar()
+{
+ delete ui;
+}
+
+void QmlToolBar::activateColorPicker()
+{
+ m_emitSignals = false;
+ activateColorPickerOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::activateSelectTool()
+{
+ m_emitSignals = false;
+ activateSelectToolOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::activateMarqueeSelectTool()
+{
+ m_emitSignals = false;
+ activateMarqueeSelectToolOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::activateZoom()
+{
+ m_emitSignals = false;
+ activateZoomOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::setAnimationSpeed(qreal slowDownFactor)
+{
+ if (m_animationSpeed == slowDownFactor)
+ return;
+
+ m_emitSignals = false;
+ m_animationSpeed = slowDownFactor;
+
+ foreach (QAction *action, ui->playSpeedMenuActions->actions()) {
+ if (action->data().toReal() == slowDownFactor) {
+ action->setChecked(true);
+ break;
+ }
+ }
+
+ m_emitSignals = true;
+}
+
+void QmlToolBar::setAnimationPaused(bool paused)
+{
+ if (m_paused == paused)
+ return;
+
+ m_paused = paused;
+ updatePlayAction();
+}
+
+void QmlToolBar::changeAnimationSpeed()
+{
+ QAction *action = qobject_cast<QAction*>(sender());
+ m_animationSpeed = action->data().toReal();
+ emit animationSpeedChanged(m_animationSpeed);
+}
+
+void QmlToolBar::setDesignModeBehavior(bool inDesignMode)
+{
+ m_emitSignals = false;
+ ui->designmode->setChecked(inDesignMode);
+ setDesignModeBehaviorOnClick(inDesignMode);
+ m_emitSignals = true;
+}
+
+void QmlToolBar::setDesignModeBehaviorOnClick(bool checked)
+{
+ ui->select->setEnabled(checked);
+ ui->selectMarquee->setEnabled(checked);
+ ui->zoom->setEnabled(checked);
+ ui->colorPicker->setEnabled(checked);
+ ui->toQml->setEnabled(checked);
+ ui->fromQml->setEnabled(checked);
+
+ if (m_emitSignals)
+ emit designModeBehaviorChanged(checked);
+}
+
+void QmlToolBar::setColorBoxColor(const QColor &color)
+{
+ ui->colorBox->setColor(color);
+}
+
+void QmlToolBar::activatePlayOnClick()
+{
+ m_paused = !m_paused;
+ emit animationPausedChanged(m_paused);
+ updatePlayAction();
+}
+
+void QmlToolBar::updatePlayAction()
+{
+ ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon);
+}
+
+void QmlToolBar::activateColorPickerOnClick()
+{
+ ui->zoom->setChecked(false);
+ ui->select->setChecked(false);
+ ui->selectMarquee->setChecked(false);
+
+ ui->colorPicker->setChecked(true);
+ if (m_activeTool != Constants::ColorPickerMode) {
+ m_activeTool = Constants::ColorPickerMode;
+ if (m_emitSignals)
+ emit colorPickerSelected();
+ }
+}
+
+void QmlToolBar::activateSelectToolOnClick()
+{
+ ui->zoom->setChecked(false);
+ ui->selectMarquee->setChecked(false);
+ ui->colorPicker->setChecked(false);
+
+ ui->select->setChecked(true);
+ if (m_activeTool != Constants::SelectionToolMode) {
+ m_activeTool = Constants::SelectionToolMode;
+ if (m_emitSignals)
+ emit selectToolSelected();
+ }
+}
+
+void QmlToolBar::activateMarqueeSelectToolOnClick()
+{
+ ui->zoom->setChecked(false);
+ ui->select->setChecked(false);
+ ui->colorPicker->setChecked(false);
+
+ ui->selectMarquee->setChecked(true);
+ if (m_activeTool != Constants::MarqueeSelectionToolMode) {
+ m_activeTool = Constants::MarqueeSelectionToolMode;
+ if (m_emitSignals)
+ emit marqueeSelectToolSelected();
+ }
+}
+
+void QmlToolBar::activateZoomOnClick()
+{
+ ui->select->setChecked(false);
+ ui->selectMarquee->setChecked(false);
+ ui->colorPicker->setChecked(false);
+
+ ui->zoom->setChecked(true);
+ if (m_activeTool != Constants::ZoomMode) {
+ m_activeTool = Constants::ZoomMode;
+ if (m_emitSignals)
+ emit zoomToolSelected();
+ }
+}
+
+void QmlToolBar::activateFromQml()
+{
+ if (m_emitSignals)
+ emit applyChangesFromQmlFileSelected();
+}
+
+void QmlToolBar::activateToQml()
+{
+ if (m_emitSignals)
+ emit applyChangesToQmlFileSelected();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h
new file mode 100644
index 0000000000..0401804184
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLTOOLBAR_H
+#define QMLTOOLBAR_H
+
+#include <QtGui/QToolBar>
+#include <QtGui/QIcon>
+
+#include "../qmlinspectorconstants_p.h"
+
+QT_FORWARD_DECLARE_CLASS(QActionGroup)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class ToolBarColorBox;
+
+class QmlToolBar : public QToolBar
+{
+ Q_OBJECT
+
+public:
+ explicit QmlToolBar(QWidget *parent = 0);
+ ~QmlToolBar();
+
+public slots:
+ void setDesignModeBehavior(bool inDesignMode);
+ void setColorBoxColor(const QColor &color);
+ void activateColorPicker();
+ void activateSelectTool();
+ void activateMarqueeSelectTool();
+ void activateZoom();
+
+ void setAnimationSpeed(qreal slowDownFactor);
+ void setAnimationPaused(bool paused);
+
+signals:
+ void animationSpeedChanged(qreal factor);
+ void animationPausedChanged(bool paused);
+
+ void designModeBehaviorChanged(bool inDesignMode);
+ void colorPickerSelected();
+ void selectToolSelected();
+ void marqueeSelectToolSelected();
+ void zoomToolSelected();
+
+ void applyChangesToQmlFileSelected();
+ void applyChangesFromQmlFileSelected();
+
+private slots:
+ void setDesignModeBehaviorOnClick(bool inDesignMode);
+ void activatePlayOnClick();
+ void activateColorPickerOnClick();
+ void activateSelectToolOnClick();
+ void activateMarqueeSelectToolOnClick();
+ void activateZoomOnClick();
+
+ void activateFromQml();
+ void activateToQml();
+
+ void changeAnimationSpeed();
+
+ void updatePlayAction();
+
+private:
+ class Ui {
+ public:
+ QAction *designmode;
+ QAction *play;
+ QAction *select;
+ QAction *selectMarquee;
+ QAction *zoom;
+ QAction *colorPicker;
+ QAction *toQml;
+ QAction *fromQml;
+ QIcon playIcon;
+ QIcon pauseIcon;
+ ToolBarColorBox *colorBox;
+
+ QActionGroup *playSpeedMenuActions;
+ };
+
+ bool m_emitSignals;
+ bool m_paused;
+ qreal m_animationSpeed;
+
+ Constants::DesignTool m_activeTool;
+
+ Ui *ui;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QMLTOOLBAR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp
new file mode 100644
index 0000000000..2ed3179856
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "subcomponentmasklayeritem_p.h"
+
+#include "../qmlinspectorconstants_p.h"
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QtGui/QPolygonF>
+
+QT_BEGIN_NAMESPACE
+
+SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
+ QGraphicsItem *parentItem) :
+ QGraphicsPolygonItem(parentItem),
+ m_inspector(inspector),
+ m_currentItem(0),
+ m_borderRect(new QGraphicsRectItem(this))
+{
+ m_borderRect->setRect(0,0,0,0);
+ m_borderRect->setPen(QPen(QColor(60, 60, 60), 1));
+ m_borderRect->setData(Constants::EditorItemDataKey, QVariant(true));
+
+ setBrush(QBrush(QColor(160,160,160)));
+ setPen(Qt::NoPen);
+}
+
+int SubcomponentMaskLayerItem::type() const
+{
+ return Constants::EditorItemType;
+}
+
+static QRectF resizeRect(const QRectF &newRect, const QRectF &oldRect)
+{
+ QRectF result = newRect;
+ if (oldRect.left() < newRect.left())
+ result.setLeft(oldRect.left());
+
+ if (oldRect.top() < newRect.top())
+ result.setTop(oldRect.top());
+
+ if (oldRect.right() > newRect.right())
+ result.setRight(oldRect.right());
+
+ if (oldRect.bottom() > newRect.bottom())
+ result.setBottom(oldRect.bottom());
+
+ return result;
+}
+
+static QPolygonF regionToPolygon(const QRegion &region)
+{
+ QPainterPath path;
+ foreach (const QRect &rect, region.rects())
+ path.addRect(rect);
+ return path.toFillPolygon();
+}
+
+void SubcomponentMaskLayerItem::setCurrentItem(QGraphicsItem *item)
+{
+ QGraphicsItem *prevItem = m_currentItem;
+ m_currentItem = item;
+
+ if (!m_currentItem)
+ return;
+
+ QRect viewRect = m_inspector->declarativeView()->rect();
+ viewRect = m_inspector->declarativeView()->mapToScene(viewRect).boundingRect().toRect();
+
+ QRectF itemRect = item->boundingRect() | item->childrenBoundingRect();
+ itemRect = item->mapRectToScene(itemRect);
+
+ // if updating the same item as before, resize the rectangle only bigger, not smaller.
+ if (prevItem == item && prevItem != 0) {
+ m_itemPolyRect = resizeRect(itemRect, m_itemPolyRect);
+ } else {
+ m_itemPolyRect = itemRect;
+ }
+ QRectF borderRect = m_itemPolyRect;
+ borderRect.adjust(-1, -1, 1, 1);
+ m_borderRect->setRect(borderRect);
+
+ const QRegion externalRegion = QRegion(viewRect).subtracted(m_itemPolyRect.toRect());
+ setPolygon(regionToPolygon(externalRegion));
+}
+
+QGraphicsItem *SubcomponentMaskLayerItem::currentItem() const
+{
+ return m_currentItem;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h
new file mode 100644
index 0000000000..07ce881851
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SUBCOMPONENTMASKLAYERITEM_H
+#define SUBCOMPONENTMASKLAYERITEM_H
+
+#include <QtGui/QGraphicsPolygonItem>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+
+class SubcomponentMaskLayerItem : public QGraphicsPolygonItem
+{
+public:
+ explicit SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
+ QGraphicsItem *parentItem = 0);
+ int type() const;
+ void setCurrentItem(QGraphicsItem *item);
+ void setBoundingBox(const QRectF &boundingBox);
+ QGraphicsItem *currentItem() const;
+ QRectF itemRect() const;
+
+private:
+ QDeclarativeViewInspector *m_inspector;
+ QGraphicsItem *m_currentItem;
+ QGraphicsRectItem *m_borderRect;
+ QRectF m_itemPolyRect;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // SUBCOMPONENTMASKLAYERITEM_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp
new file mode 100644
index 0000000000..154ddf2c6f
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "toolbarcolorbox_p.h"
+
+#include "../qmlinspectorconstants_p.h"
+
+#include <QtGui/QPixmap>
+#include <QtGui/QPainter>
+#include <QtGui/QMenu>
+#include <QtGui/QAction>
+#include <QtGui/QContextMenuEvent>
+#include <QtGui/QClipboard>
+#include <QtGui/QApplication>
+#include <QtGui/QColorDialog>
+#include <QtGui/QDrag>
+
+#include <QtCore/QMimeData>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
+ QLabel(parent)
+{
+ m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")),
+ tr("Copy Color"), this);
+ connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard()));
+ setScaledContents(false);
+}
+
+void ToolBarColorBox::setColor(const QColor &color)
+{
+ m_color = color;
+
+ QPixmap pix = createDragPixmap(width());
+ setPixmap(pix);
+ update();
+}
+
+void ToolBarColorBox::mousePressEvent(QMouseEvent *event)
+{
+ m_dragBeginPoint = event->pos();
+ m_dragStarted = false;
+}
+
+void ToolBarColorBox::mouseMoveEvent(QMouseEvent *event)
+{
+
+ if (event->buttons() & Qt::LeftButton
+ && (QPoint(event->pos() - m_dragBeginPoint).manhattanLength()
+ > Constants::DragStartDistance)
+ && !m_dragStarted)
+ {
+ m_dragStarted = true;
+ QDrag *drag = new QDrag(this);
+ QMimeData *mimeData = new QMimeData;
+
+ mimeData->setText(m_color.name());
+ drag->setMimeData(mimeData);
+ drag->setPixmap(createDragPixmap());
+
+ drag->exec();
+ }
+}
+
+QPixmap ToolBarColorBox::createDragPixmap(int size) const
+{
+ QPixmap pix(size, size);
+ QPainter p(&pix);
+
+ QColor borderColor1 = QColor(143, 143 ,143);
+ QColor borderColor2 = QColor(43, 43, 43);
+
+ p.setBrush(QBrush(m_color));
+ p.setPen(QPen(QBrush(borderColor2),1));
+
+ p.fillRect(0, 0, size, size, borderColor1);
+ p.drawRect(1,1, size - 3, size - 3);
+ return pix;
+}
+
+void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev)
+{
+ QMenu contextMenu;
+ contextMenu.addAction(m_copyHexColor);
+ contextMenu.exec(ev->globalPos());
+}
+
+void ToolBarColorBox::copyColorToClipboard()
+{
+ QClipboard *clipboard = QApplication::clipboard();
+ clipboard->setText(m_color.name());
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h
index c3e064c21e..c3e064c21e 100644
--- a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp
new file mode 100644
index 0000000000..969c9d55d7
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp
@@ -0,0 +1,336 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "zoomtool_p.h"
+
+#include "../qdeclarativeviewinspector_p_p.h"
+
+#include <QtGui/QMouseEvent>
+#include <QtGui/QWheelEvent>
+#include <QtGui/QKeyEvent>
+#include <QtGui/QMenu>
+#include <QtGui/QAction>
+
+#include <QtCore/QRectF>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+ZoomTool::ZoomTool(QDeclarativeViewInspector *view) :
+ AbstractLiveEditTool(view),
+ m_rubberbandManipulator(),
+ m_smoothZoomMultiplier(0.05f),
+ m_currentScale(1.0f)
+{
+ m_zoomTo100Action = new QAction(tr("Zoom to &100%"), this);
+ m_zoomInAction = new QAction(tr("Zoom In"), this);
+ m_zoomOutAction = new QAction(tr("Zoom Out"), this);
+ m_zoomInAction->setShortcut(QKeySequence(Qt::Key_Plus));
+ m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus));
+
+
+ LiveLayerItem *layerItem = QDeclarativeViewInspectorPrivate::get(view)->manipulatorLayer;
+ QGraphicsObject *layerObject = reinterpret_cast<QGraphicsObject *>(layerItem);
+ m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view);
+
+
+ connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100()));
+ connect(m_zoomInAction, SIGNAL(triggered()), SLOT(zoomIn()));
+ connect(m_zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut()));
+}
+
+ZoomTool::~ZoomTool()
+{
+ delete m_rubberbandManipulator;
+}
+
+void ZoomTool::mousePressEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+
+ QPointF scenePos = view()->mapToScene(event->pos());
+
+ if (event->buttons() & Qt::RightButton) {
+ QMenu contextMenu;
+ contextMenu.addAction(m_zoomTo100Action);
+ contextMenu.addSeparator();
+ contextMenu.addAction(m_zoomInAction);
+ contextMenu.addAction(m_zoomOutAction);
+ contextMenu.exec(event->globalPos());
+ } else if (event->buttons() & Qt::LeftButton) {
+ m_dragBeginPos = scenePos;
+ m_dragStarted = false;
+ }
+}
+
+void ZoomTool::mouseMoveEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+
+ QPointF scenePos = view()->mapToScene(event->pos());
+
+ if (event->buttons() & Qt::LeftButton
+ && (QPointF(scenePos - m_dragBeginPos).manhattanLength()
+ > Constants::DragStartDistance / 3)
+ && !m_dragStarted)
+ {
+ m_dragStarted = true;
+ m_rubberbandManipulator->begin(m_dragBeginPos);
+ return;
+ }
+
+ if (m_dragStarted)
+ m_rubberbandManipulator->update(scenePos);
+
+}
+
+void ZoomTool::mouseReleaseEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+ QPointF scenePos = view()->mapToScene(event->pos());
+
+ if (m_dragStarted) {
+ m_rubberbandManipulator->end();
+
+ int x1 = qMin(scenePos.x(), m_rubberbandManipulator->beginPoint().x());
+ int x2 = qMax(scenePos.x(), m_rubberbandManipulator->beginPoint().x());
+ int y1 = qMin(scenePos.y(), m_rubberbandManipulator->beginPoint().y());
+ int y2 = qMax(scenePos.y(), m_rubberbandManipulator->beginPoint().y());
+
+ QPointF scenePosTopLeft = QPoint(x1, y1);
+ QPointF scenePosBottomRight = QPoint(x2, y2);
+
+ QRectF sceneArea(scenePosTopLeft, scenePosBottomRight);
+
+ m_currentScale = qMin(view()->rect().width() / sceneArea.width(),
+ view()->rect().height() / sceneArea.height());
+
+
+ QTransform transform;
+ transform.scale(m_currentScale, m_currentScale);
+
+ view()->setTransform(transform);
+ view()->setSceneRect(sceneArea);
+ } else {
+ Qt::KeyboardModifier modifierKey = Qt::ControlModifier;
+#ifdef Q_WS_MAC
+ modifierKey = Qt::AltModifier;
+#endif
+ if (event->modifiers() & modifierKey) {
+ zoomOut();
+ } else {
+ zoomIn();
+ }
+ }
+}
+
+void ZoomTool::zoomIn()
+{
+ m_currentScale = nextZoomScale(ZoomIn);
+ scaleView(view()->mapToScene(m_mousePos));
+}
+
+void ZoomTool::zoomOut()
+{
+ m_currentScale = nextZoomScale(ZoomOut);
+ scaleView(view()->mapToScene(m_mousePos));
+}
+
+void ZoomTool::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+}
+
+
+void ZoomTool::hoverMoveEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+}
+
+
+void ZoomTool::keyPressEvent(QKeyEvent * /*event*/)
+{
+}
+
+void ZoomTool::wheelEvent(QWheelEvent *event)
+{
+ if (event->orientation() != Qt::Vertical)
+ return;
+
+ Qt::KeyboardModifier smoothZoomModifier = Qt::ControlModifier;
+ if (event->modifiers() & smoothZoomModifier) {
+ int numDegrees = event->delta() / 8;
+ m_currentScale += m_smoothZoomMultiplier * (numDegrees / 15.0f);
+
+ scaleView(view()->mapToScene(m_mousePos));
+
+ } else if (!event->modifiers()) {
+ if (event->delta() > 0) {
+ m_currentScale = nextZoomScale(ZoomIn);
+ } else if (event->delta() < 0) {
+ m_currentScale = nextZoomScale(ZoomOut);
+ }
+ scaleView(view()->mapToScene(m_mousePos));
+ }
+}
+
+void ZoomTool::keyReleaseEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Plus:
+ zoomIn();
+ break;
+ case Qt::Key_Minus:
+ zoomOut();
+ break;
+ case Qt::Key_1:
+ case Qt::Key_2:
+ case Qt::Key_3:
+ case Qt::Key_4:
+ case Qt::Key_5:
+ case Qt::Key_6:
+ case Qt::Key_7:
+ case Qt::Key_8:
+ case Qt::Key_9:
+ {
+ m_currentScale = ((event->key() - Qt::Key_0) * 1.0f);
+ scaleView(view()->mapToScene(m_mousePos)); // view()->mapToScene(view()->rect().center())
+ break;
+ }
+
+ default:
+ break;
+ }
+
+}
+
+void ZoomTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
+{
+}
+
+void ZoomTool::clear()
+{
+ view()->setCursor(Qt::ArrowCursor);
+}
+
+void ZoomTool::selectedItemsChanged(const QList<QGraphicsItem*> &/*itemList*/)
+{
+}
+
+void ZoomTool::scaleView(const QPointF &centerPos)
+{
+
+ QTransform transform;
+ transform.scale(m_currentScale, m_currentScale);
+ view()->setTransform(transform);
+
+ QPointF adjustedCenterPos = centerPos;
+ QSize rectSize(view()->rect().width() / m_currentScale,
+ view()->rect().height() / m_currentScale);
+
+ QRectF sceneRect;
+ if (qAbs(m_currentScale - 1.0f) < Constants::ZoomSnapDelta) {
+ adjustedCenterPos.rx() = rectSize.width() / 2;
+ adjustedCenterPos.ry() = rectSize.height() / 2;
+ }
+
+ if (m_currentScale < 1.0f) {
+ adjustedCenterPos.rx() = rectSize.width() / 2;
+ adjustedCenterPos.ry() = rectSize.height() / 2;
+ sceneRect.setRect(view()->rect().width() / 2 -rectSize.width() / 2,
+ view()->rect().height() / 2 -rectSize.height() / 2,
+ rectSize.width(),
+ rectSize.height());
+ } else {
+ sceneRect.setRect(adjustedCenterPos.x() - rectSize.width() / 2,
+ adjustedCenterPos.y() - rectSize.height() / 2,
+ rectSize.width(),
+ rectSize.height());
+ }
+
+ view()->setSceneRect(sceneRect);
+}
+
+void ZoomTool::zoomTo100()
+{
+ m_currentScale = 1.0f;
+ scaleView(view()->mapToScene(view()->rect().center()));
+}
+
+qreal ZoomTool::nextZoomScale(ZoomDirection direction) const
+{
+ static QList<qreal> zoomScales =
+ QList<qreal>()
+ << 0.125f
+ << 1.0f / 6.0f
+ << 0.25f
+ << 1.0f / 3.0f
+ << 0.5f
+ << 2.0f / 3.0f
+ << 1.0f
+ << 2.0f
+ << 3.0f
+ << 4.0f
+ << 5.0f
+ << 6.0f
+ << 7.0f
+ << 8.0f
+ << 12.0f
+ << 16.0f
+ << 32.0f
+ << 48.0f;
+
+ if (direction == ZoomIn) {
+ for (int i = 0; i < zoomScales.length(); ++i) {
+ if (zoomScales[i] > m_currentScale || i == zoomScales.length() - 1)
+ return zoomScales[i];
+ }
+ } else {
+ for (int i = zoomScales.length() - 1; i >= 0; --i) {
+ if (zoomScales[i] < m_currentScale || i == 0)
+ return zoomScales[i];
+ }
+ }
+
+ return 1.0f;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h
new file mode 100644
index 0000000000..14fa4d5390
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ZOOMTOOL_H
+#define ZOOMTOOL_H
+
+#include "abstractliveedittool_p.h"
+#include "liverubberbandselectionmanipulator_p.h"
+
+QT_FORWARD_DECLARE_CLASS(QAction)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class ZoomTool : public AbstractLiveEditTool
+{
+ Q_OBJECT
+
+public:
+ enum ZoomDirection {
+ ZoomIn,
+ ZoomOut
+ };
+
+ explicit ZoomTool(QDeclarativeViewInspector *view);
+
+ virtual ~ZoomTool();
+
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
+
+ void hoverMoveEvent(QMouseEvent *event);
+ void wheelEvent(QWheelEvent *event);
+
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *keyEvent);
+ void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList);
+
+ void clear();
+
+protected:
+ void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
+
+private slots:
+ void zoomTo100();
+ void zoomIn();
+ void zoomOut();
+
+private:
+ qreal nextZoomScale(ZoomDirection direction) const;
+ void scaleView(const QPointF &centerPos);
+
+private:
+ bool m_dragStarted;
+ QPoint m_mousePos; // in view coords
+ QPointF m_dragBeginPos;
+ QAction *m_zoomTo100Action;
+ QAction *m_zoomInAction;
+ QAction *m_zoomOutAction;
+ LiveRubberBandSelectionManipulator *m_rubberbandManipulator;
+
+ qreal m_smoothZoomMultiplier;
+ qreal m_currentScale;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // ZOOMTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp
new file mode 100644
index 0000000000..a266eb90b5
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeinspectorplugin.h"
+
+#include "qdeclarativeviewinspector_p.h"
+
+#include <QtCore/qplugin.h>
+#include <QtDeclarative/private/qdeclarativeinspectorservice_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeInspectorPlugin::QDeclarativeInspectorPlugin() :
+ m_inspector(0)
+{
+}
+
+QDeclarativeInspectorPlugin::~QDeclarativeInspectorPlugin()
+{
+ delete m_inspector;
+}
+
+void QDeclarativeInspectorPlugin::activate()
+{
+ QDeclarativeInspectorService *service = QDeclarativeInspectorService::instance();
+ QList<QDeclarativeView*> views = service->views();
+ if (views.isEmpty())
+ return;
+
+ // TODO: Support multiple views
+ QDeclarativeView *view = service->views().at(0);
+ m_inspector = new QDeclarativeViewInspector(view, view);
+}
+
+void QDeclarativeInspectorPlugin::deactivate()
+{
+ delete m_inspector;
+}
+
+Q_EXPORT_PLUGIN2(declarativeinspector, QDeclarativeInspectorPlugin)
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h
new file mode 100644
index 0000000000..3e28643eff
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINSPECTORPLUGIN_H
+#define QDECLARATIVEINSPECTORPLUGIN_H
+
+#include <QtCore/QPointer>
+#include <QtDeclarative/private/qdeclarativeinspectorinterface_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeViewInspector;
+
+class QDeclarativeInspectorPlugin : public QObject, public QDeclarativeInspectorInterface
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(QDeclarativeInspectorPlugin)
+ Q_INTERFACES(QDeclarativeInspectorInterface)
+
+public:
+ QDeclarativeInspectorPlugin();
+ ~QDeclarativeInspectorPlugin();
+
+ void activate();
+ void deactivate();
+
+private:
+ QPointer<QDeclarativeViewInspector> m_inspector;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEINSPECTORPLUGIN_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h
new file mode 100644
index 0000000000..2878bc188a
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINSPECTORPROTOCOL_H
+#define QDECLARATIVEINSPECTORPROTOCOL_H
+
+#include <QtCore/QDebug>
+#include <QtCore/QMetaType>
+#include <QtCore/QMetaEnum>
+#include <QtCore/QObject>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class InspectorProtocol : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(Message Tool)
+
+public:
+ enum Message {
+ AnimationSpeedChanged = 0,
+ AnimationPausedChanged = 19, // highest value
+ ChangeTool = 1,
+ ClearComponentCache = 2,
+ ColorChanged = 3,
+ CreateObject = 5,
+ CurrentObjectsChanged = 6,
+ DestroyObject = 7,
+ MoveObject = 8,
+ ObjectIdList = 9,
+ Reload = 10,
+ Reloaded = 11,
+ SetAnimationSpeed = 12,
+ SetAnimationPaused = 18,
+ SetCurrentObjects = 14,
+ SetDesignMode = 15,
+ ShowAppOnTop = 16,
+ ToolChanged = 17
+ };
+
+ enum Tool {
+ ColorPickerTool,
+ SelectMarqueeTool,
+ SelectTool,
+ ZoomTool
+ };
+
+ static inline QString toString(Message message)
+ {
+ return QLatin1String(staticMetaObject.enumerator(0).valueToKey(message));
+ }
+
+ static inline QString toString(Tool tool)
+ {
+ return QLatin1String(staticMetaObject.enumerator(1).valueToKey(tool));
+ }
+};
+
+inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Message message)
+{
+ return stream << static_cast<quint32>(message);
+}
+
+inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Message &message)
+{
+ quint32 i;
+ stream >> i;
+ message = static_cast<InspectorProtocol::Message>(i);
+ return stream;
+}
+
+inline QDebug operator<< (QDebug dbg, InspectorProtocol::Message message)
+{
+ dbg << InspectorProtocol::toString(message);
+ return dbg;
+}
+
+inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Tool tool)
+{
+ return stream << static_cast<quint32>(tool);
+}
+
+inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Tool &tool)
+{
+ quint32 i;
+ stream >> i;
+ tool = static_cast<InspectorProtocol::Tool>(i);
+ return stream;
+}
+
+inline QDebug operator<< (QDebug dbg, InspectorProtocol::Tool tool)
+{
+ dbg << InspectorProtocol::toString(tool);
+ return dbg;
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEINSPECTORPROTOCOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
new file mode 100644
index 0000000000..19bfdaa3b5
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
@@ -0,0 +1,1021 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
+#include "QtDeclarative/private/qdeclarativedebughelper_p.h"
+
+#include "qdeclarativeviewinspector_p.h"
+#include "qdeclarativeviewinspector_p_p.h"
+#include "qdeclarativeinspectorprotocol.h"
+
+#include "editor/liveselectiontool_p.h"
+#include "editor/zoomtool_p.h"
+#include "editor/colorpickertool_p.h"
+#include "editor/livelayeritem_p.h"
+#include "editor/boundingrecthighlighter_p.h"
+#include "editor/qmltoolbar_p.h"
+
+#include <QtDeclarative/QDeclarativeItem>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+#include <QtDeclarative/QDeclarativeExpression>
+#include <QtGui/QWidget>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QGraphicsObject>
+#include <QtGui/QApplication>
+#include <QtCore/QSettings>
+
+static inline void initEditorResource() { Q_INIT_RESOURCE(editor); }
+
+QT_BEGIN_NAMESPACE
+
+const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry";
+
+const int SceneChangeUpdateInterval = 5000;
+
+
+class ToolBox : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ToolBox(QWidget *parent = 0);
+ ~ToolBox();
+
+ QmlToolBar *toolBar() const { return m_toolBar; }
+
+private:
+ QSettings m_settings;
+ QmlToolBar *m_toolBar;
+};
+
+ToolBox::ToolBox(QWidget *parent)
+ : QWidget(parent, Qt::Tool)
+ , m_settings(QLatin1String("Nokia"), QLatin1String("QmlInspector"), this)
+ , m_toolBar(new QmlToolBar)
+{
+ setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint);
+ setWindowTitle(tr("Qt Quick Toolbox"));
+
+ QVBoxLayout *verticalLayout = new QVBoxLayout;
+ verticalLayout->setMargin(0);
+ verticalLayout->addWidget(m_toolBar);
+ setLayout(verticalLayout);
+
+ restoreGeometry(m_settings.value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray());
+}
+
+ToolBox::~ToolBox()
+{
+ m_settings.setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY), saveGeometry());
+}
+
+
+QDeclarativeViewInspectorPrivate::QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *q) :
+ q(q),
+ designModeBehavior(false),
+ showAppOnTop(false),
+ animationPaused(false),
+ slowDownFactor(1.0f),
+ toolBox(0)
+{
+}
+
+QDeclarativeViewInspectorPrivate::~QDeclarativeViewInspectorPrivate()
+{
+}
+
+QDeclarativeViewInspector::QDeclarativeViewInspector(QDeclarativeView *view,
+ QObject *parent) :
+ QObject(parent),
+ data(new QDeclarativeViewInspectorPrivate(this))
+{
+ initEditorResource();
+
+ data->view = view;
+ data->manipulatorLayer = new LiveLayerItem(view->scene());
+ data->selectionTool = new LiveSelectionTool(this);
+ data->zoomTool = new ZoomTool(this);
+ data->colorPickerTool = new ColorPickerTool(this);
+ data->boundingRectHighlighter = new BoundingRectHighlighter(this);
+ data->currentTool = data->selectionTool;
+
+ // to capture ChildRemoved event when viewport changes
+ data->view->installEventFilter(this);
+
+ data->setViewport(data->view->viewport());
+
+ data->debugService = QDeclarativeInspectorService::instance();
+ connect(data->debugService, SIGNAL(gotMessage(QByteArray)),
+ this, SLOT(handleMessage(QByteArray)));
+
+ connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)),
+ data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status)));
+
+ connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
+ SIGNAL(selectedColorChanged(QColor)));
+ connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
+ this, SLOT(sendColorChanged(QColor)));
+
+ data->_q_changeToSingleSelectTool();
+}
+
+QDeclarativeViewInspector::~QDeclarativeViewInspector()
+{
+}
+
+void QDeclarativeViewInspectorPrivate::_q_setToolBoxVisible(bool visible)
+{
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
+ if (!toolBox && visible)
+ createToolBox();
+ if (toolBox)
+ toolBox->setVisible(visible);
+#else
+ Q_UNUSED(visible)
+#endif
+}
+
+void QDeclarativeViewInspectorPrivate::_q_reloadView()
+{
+ clearHighlight();
+ emit q->reloadRequested();
+}
+
+void QDeclarativeViewInspectorPrivate::setViewport(QWidget *widget)
+{
+ if (viewport.data() == widget)
+ return;
+
+ if (viewport)
+ viewport.data()->removeEventFilter(q);
+
+ viewport = widget;
+ if (viewport) {
+ // make sure we get mouse move events
+ viewport.data()->setMouseTracking(true);
+ viewport.data()->installEventFilter(q);
+ }
+}
+
+void QDeclarativeViewInspectorPrivate::clearEditorItems()
+{
+ clearHighlight();
+ setSelectedItems(QList<QGraphicsItem*>());
+}
+
+bool QDeclarativeViewInspector::eventFilter(QObject *obj, QEvent *event)
+{
+ if (obj == data->view) {
+ // Event from view
+ if (event->type() == QEvent::ChildRemoved) {
+ // Might mean that viewport has changed
+ if (data->view->viewport() != data->viewport.data())
+ data->setViewport(data->view->viewport());
+ }
+ return QObject::eventFilter(obj, event);
+ }
+
+ // Event from viewport
+ switch (event->type()) {
+ case QEvent::Leave: {
+ if (leaveEvent(event))
+ return true;
+ break;
+ }
+ case QEvent::MouseButtonPress: {
+ if (mousePressEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ }
+ case QEvent::MouseMove: {
+ if (mouseMoveEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ }
+ case QEvent::MouseButtonRelease: {
+ if (mouseReleaseEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ }
+ case QEvent::KeyPress: {
+ if (keyPressEvent(static_cast<QKeyEvent*>(event)))
+ return true;
+ break;
+ }
+ case QEvent::KeyRelease: {
+ if (keyReleaseEvent(static_cast<QKeyEvent*>(event)))
+ return true;
+ break;
+ }
+ case QEvent::MouseButtonDblClick: {
+ if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ }
+ case QEvent::Wheel: {
+ if (wheelEvent(static_cast<QWheelEvent*>(event)))
+ return true;
+ break;
+ }
+ default: {
+ break;
+ }
+ } //switch
+
+ // standard event processing
+ return QObject::eventFilter(obj, event);
+}
+
+bool QDeclarativeViewInspector::leaveEvent(QEvent * /*event*/)
+{
+ if (!data->designModeBehavior)
+ return false;
+ data->clearHighlight();
+ return true;
+}
+
+bool QDeclarativeViewInspector::mousePressEvent(QMouseEvent *event)
+{
+ if (!data->designModeBehavior)
+ return false;
+ data->cursorPos = event->pos();
+ data->currentTool->mousePressEvent(event);
+ return true;
+}
+
+bool QDeclarativeViewInspector::mouseMoveEvent(QMouseEvent *event)
+{
+ if (!data->designModeBehavior) {
+ data->clearEditorItems();
+ return false;
+ }
+ data->cursorPos = event->pos();
+
+ QList<QGraphicsItem*> selItems = data->selectableItems(event->pos());
+ if (!selItems.isEmpty()) {
+ declarativeView()->setToolTip(data->currentTool->titleForItem(selItems.first()));
+ } else {
+ declarativeView()->setToolTip(QString());
+ }
+ if (event->buttons()) {
+ data->currentTool->mouseMoveEvent(event);
+ } else {
+ data->currentTool->hoverMoveEvent(event);
+ }
+ return true;
+}
+
+bool QDeclarativeViewInspector::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (!data->designModeBehavior)
+ return false;
+
+ data->cursorPos = event->pos();
+ data->currentTool->mouseReleaseEvent(event);
+ return true;
+}
+
+bool QDeclarativeViewInspector::keyPressEvent(QKeyEvent *event)
+{
+ if (!data->designModeBehavior)
+ return false;
+
+ data->currentTool->keyPressEvent(event);
+ return true;
+}
+
+bool QDeclarativeViewInspector::keyReleaseEvent(QKeyEvent *event)
+{
+ if (!data->designModeBehavior)
+ return false;
+
+ switch (event->key()) {
+ case Qt::Key_V:
+ data->_q_changeToSingleSelectTool();
+ break;
+// disabled because multiselection does not do anything useful without design mode
+// case Qt::Key_M:
+// data->_q_changeToMarqueeSelectTool();
+// break;
+ case Qt::Key_I:
+ data->_q_changeToColorPickerTool();
+ break;
+ case Qt::Key_Z:
+ data->_q_changeToZoomTool();
+ break;
+ case Qt::Key_Space:
+ setAnimationPaused(!data->animationPaused);
+ break;
+ default:
+ break;
+ }
+
+ data->currentTool->keyReleaseEvent(event);
+ return true;
+}
+
+void QDeclarativeViewInspectorPrivate::_q_createQmlObject(const QString &qml, QObject *parent,
+ const QStringList &importList,
+ const QString &filename)
+{
+ if (!parent)
+ return;
+
+ QString imports;
+ foreach (const QString &s, importList) {
+ imports += s;
+ imports += QLatin1Char('\n');
+ }
+
+ QDeclarativeContext *parentContext = view->engine()->contextForObject(parent);
+ QDeclarativeComponent component(view->engine(), q);
+ QByteArray constructedQml = QString(imports + qml).toLatin1();
+
+ component.setData(constructedQml, QUrl::fromLocalFile(filename));
+ QObject *newObject = component.create(parentContext);
+ if (newObject) {
+ newObject->setParent(parent);
+ QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent);
+ QDeclarativeItem *newItem = qobject_cast<QDeclarativeItem*>(newObject);
+ if (parentItem && newItem)
+ newItem->setParentItem(parentItem);
+ }
+}
+
+void QDeclarativeViewInspectorPrivate::_q_reparentQmlObject(QObject *object, QObject *newParent)
+{
+ if (!newParent)
+ return;
+
+ object->setParent(newParent);
+ QDeclarativeItem *newParentItem = qobject_cast<QDeclarativeItem*>(newParent);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(object);
+ if (newParentItem && item)
+ item->setParentItem(newParentItem);
+}
+
+void QDeclarativeViewInspectorPrivate::_q_clearComponentCache()
+{
+ view->engine()->clearComponentCache();
+}
+
+void QDeclarativeViewInspectorPrivate::_q_removeFromSelection(QObject *obj)
+{
+ QList<QGraphicsItem*> items = selectedItems();
+ if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
+ items.removeOne(item);
+ setSelectedItems(items);
+}
+
+bool QDeclarativeViewInspector::mouseDoubleClickEvent(QMouseEvent * /*event*/)
+{
+ if (!data->designModeBehavior)
+ return false;
+
+ return true;
+}
+
+bool QDeclarativeViewInspector::wheelEvent(QWheelEvent *event)
+{
+ if (!data->designModeBehavior)
+ return false;
+ data->currentTool->wheelEvent(event);
+ return true;
+}
+
+void QDeclarativeViewInspector::setDesignModeBehavior(bool value)
+{
+ emit designModeBehaviorChanged(value);
+
+ if (data->toolBox)
+ data->toolBox->toolBar()->setDesignModeBehavior(value);
+ sendDesignModeBehavior(value);
+
+ data->designModeBehavior = value;
+
+ if (!data->designModeBehavior)
+ data->clearEditorItems();
+}
+
+bool QDeclarativeViewInspector::designModeBehavior()
+{
+ return data->designModeBehavior;
+}
+
+bool QDeclarativeViewInspector::showAppOnTop() const
+{
+ return data->showAppOnTop;
+}
+
+void QDeclarativeViewInspector::setShowAppOnTop(bool appOnTop)
+{
+ if (data->view) {
+ QWidget *window = data->view->window();
+ Qt::WindowFlags flags = window->windowFlags();
+ if (appOnTop)
+ flags |= Qt::WindowStaysOnTopHint;
+ else
+ flags &= ~Qt::WindowStaysOnTopHint;
+
+ window->setWindowFlags(flags);
+ window->show();
+ }
+
+ data->showAppOnTop = appOnTop;
+ sendShowAppOnTop(appOnTop);
+
+ emit showAppOnTopChanged(appOnTop);
+}
+
+void QDeclarativeViewInspectorPrivate::changeTool(Constants::DesignTool tool,
+ Constants::ToolFlags /*flags*/)
+{
+ switch (tool) {
+ case Constants::SelectionToolMode:
+ _q_changeToSingleSelectTool();
+ break;
+ case Constants::NoTool:
+ default:
+ currentTool = 0;
+ break;
+ }
+}
+
+void QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(const QList<QGraphicsItem *> &items)
+{
+ foreach (const QWeakPointer<QGraphicsObject> &obj, currentSelection) {
+ if (QGraphicsItem *item = obj.data()) {
+ if (!items.contains(item)) {
+ QObject::disconnect(obj.data(), SIGNAL(destroyed(QObject*)),
+ this, SLOT(_q_removeFromSelection(QObject*)));
+ currentSelection.removeOne(obj);
+ }
+ }
+ }
+
+ foreach (QGraphicsItem *item, items) {
+ if (QGraphicsObject *obj = item->toGraphicsObject()) {
+ if (!currentSelection.contains(obj)) {
+ QObject::connect(obj, SIGNAL(destroyed(QObject*)),
+ this, SLOT(_q_removeFromSelection(QObject*)));
+ currentSelection.append(obj);
+ }
+ }
+ }
+
+ currentTool->updateSelectedItems();
+}
+
+void QDeclarativeViewInspectorPrivate::setSelectedItems(const QList<QGraphicsItem *> &items)
+{
+ QList<QWeakPointer<QGraphicsObject> > oldList = currentSelection;
+ setSelectedItemsForTools(items);
+ if (oldList != currentSelection) {
+ QList<QObject*> objectList;
+ foreach (const QWeakPointer<QGraphicsObject> &graphicsObject, currentSelection) {
+ if (graphicsObject)
+ objectList << graphicsObject.data();
+ }
+
+ q->sendCurrentObjects(objectList);
+ }
+}
+
+QList<QGraphicsItem *> QDeclarativeViewInspectorPrivate::selectedItems() const
+{
+ QList<QGraphicsItem *> selection;
+ foreach (const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
+ if (selectedObject.data())
+ selection << selectedObject.data();
+ }
+
+ return selection;
+}
+
+void QDeclarativeViewInspector::setSelectedItems(QList<QGraphicsItem *> items)
+{
+ data->setSelectedItems(items);
+}
+
+QList<QGraphicsItem *> QDeclarativeViewInspector::selectedItems() const
+{
+ return data->selectedItems();
+}
+
+QDeclarativeView *QDeclarativeViewInspector::declarativeView()
+{
+ return data->view;
+}
+
+void QDeclarativeViewInspectorPrivate::clearHighlight()
+{
+ boundingRectHighlighter->clear();
+}
+
+void QDeclarativeViewInspectorPrivate::highlight(const QList<QGraphicsObject *> &items)
+{
+ if (items.isEmpty())
+ return;
+
+ QList<QGraphicsObject*> objectList;
+ foreach (QGraphicsItem *item, items) {
+ QGraphicsItem *child = item;
+
+ if (child) {
+ QGraphicsObject *childObject = child->toGraphicsObject();
+ if (childObject)
+ objectList << childObject;
+ }
+ }
+
+ boundingRectHighlighter->highlight(objectList);
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(
+ const QPointF &scenePos) const
+{
+ QList<QGraphicsItem*> itemlist = view->scene()->items(scenePos);
+ return filterForSelection(itemlist);
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(const QPoint &pos) const
+{
+ QList<QGraphicsItem*> itemlist = view->items(pos);
+ return filterForSelection(itemlist);
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(
+ const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const
+{
+ QList<QGraphicsItem*> itemlist = view->scene()->items(sceneRect, selectionMode);
+ return filterForSelection(itemlist);
+}
+
+void QDeclarativeViewInspectorPrivate::_q_changeToSingleSelectTool()
+{
+ currentToolMode = Constants::SelectionToolMode;
+ selectionTool->setRubberbandSelectionMode(false);
+
+ changeToSelectTool();
+
+ emit q->selectToolActivated();
+ q->sendCurrentTool(Constants::SelectionToolMode);
+}
+
+void QDeclarativeViewInspectorPrivate::changeToSelectTool()
+{
+ if (currentTool == selectionTool)
+ return;
+
+ currentTool->clear();
+ currentTool = selectionTool;
+ currentTool->clear();
+ currentTool->updateSelectedItems();
+}
+
+void QDeclarativeViewInspectorPrivate::_q_changeToMarqueeSelectTool()
+{
+ changeToSelectTool();
+ currentToolMode = Constants::MarqueeSelectionToolMode;
+ selectionTool->setRubberbandSelectionMode(true);
+
+ emit q->marqueeSelectToolActivated();
+ q->sendCurrentTool(Constants::MarqueeSelectionToolMode);
+}
+
+void QDeclarativeViewInspectorPrivate::_q_changeToZoomTool()
+{
+ currentToolMode = Constants::ZoomMode;
+ currentTool->clear();
+ currentTool = zoomTool;
+ currentTool->clear();
+
+ emit q->zoomToolActivated();
+ q->sendCurrentTool(Constants::ZoomMode);
+}
+
+void QDeclarativeViewInspectorPrivate::_q_changeToColorPickerTool()
+{
+ if (currentTool == colorPickerTool)
+ return;
+
+ currentToolMode = Constants::ColorPickerMode;
+ currentTool->clear();
+ currentTool = colorPickerTool;
+ currentTool->clear();
+
+ emit q->colorPickerActivated();
+ q->sendCurrentTool(Constants::ColorPickerMode);
+}
+
+void QDeclarativeViewInspector::setAnimationSpeed(qreal slowDownFactor)
+{
+ Q_ASSERT(slowDownFactor > 0);
+ if (data->slowDownFactor == slowDownFactor)
+ return;
+
+ animationSpeedChangeRequested(slowDownFactor);
+ sendAnimationSpeed(slowDownFactor);
+}
+
+void QDeclarativeViewInspector::setAnimationPaused(bool paused)
+{
+ if (data->animationPaused == paused)
+ return;
+
+ animationPausedChangeRequested(paused);
+ sendAnimationPaused(paused);
+}
+
+void QDeclarativeViewInspector::animationSpeedChangeRequested(qreal factor)
+{
+ if (data->slowDownFactor != factor) {
+ data->slowDownFactor = factor;
+ emit animationSpeedChanged(factor);
+ }
+
+ const float effectiveFactor = data->animationPaused ? 0 : factor;
+ QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
+}
+
+void QDeclarativeViewInspector::animationPausedChangeRequested(bool paused)
+{
+ if (data->animationPaused != paused) {
+ data->animationPaused = paused;
+ emit animationPausedChanged(paused);
+ }
+
+ const float effectiveFactor = paused ? 0 : data->slowDownFactor;
+ QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
+}
+
+
+void QDeclarativeViewInspectorPrivate::_q_applyChangesFromClient()
+{
+}
+
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::filterForSelection(
+ QList<QGraphicsItem*> &itemlist) const
+{
+ foreach (QGraphicsItem *item, itemlist) {
+ if (isEditorItem(item))
+ itemlist.removeOne(item);
+ }
+
+ return itemlist;
+}
+
+bool QDeclarativeViewInspectorPrivate::isEditorItem(QGraphicsItem *item) const
+{
+ return (item->type() == Constants::EditorItemType
+ || item->type() == Constants::ResizeHandleItemType
+ || item->data(Constants::EditorItemDataKey).toBool());
+}
+
+void QDeclarativeViewInspectorPrivate::_q_onStatusChanged(QDeclarativeView::Status status)
+{
+ if (status == QDeclarativeView::Ready)
+ q->sendReloaded();
+}
+
+void QDeclarativeViewInspectorPrivate::_q_onCurrentObjectsChanged(QList<QObject*> objects)
+{
+ QList<QGraphicsItem*> items;
+ QList<QGraphicsObject*> gfxObjects;
+ foreach (QObject *obj, objects) {
+ if (QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(obj)) {
+ items << declarativeItem;
+ gfxObjects << declarativeItem;
+ }
+ }
+ if (designModeBehavior) {
+ setSelectedItemsForTools(items);
+ clearHighlight();
+ highlight(gfxObjects);
+ }
+}
+
+// adjusts bounding boxes on edges of screen to be visible
+QRectF QDeclarativeViewInspector::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace)
+{
+ int marginFromEdge = 1;
+ QRectF boundingRect(boundingRectInSceneSpace);
+ if (qAbs(boundingRect.left()) - 1 < 2)
+ boundingRect.setLeft(marginFromEdge);
+
+ QRect rect = data->view->rect();
+
+ if (boundingRect.right() >= rect.right())
+ boundingRect.setRight(rect.right() - marginFromEdge);
+
+ if (qAbs(boundingRect.top()) - 1 < 2)
+ boundingRect.setTop(marginFromEdge);
+
+ if (boundingRect.bottom() >= rect.bottom())
+ boundingRect.setBottom(rect.bottom() - marginFromEdge);
+
+ return boundingRect;
+}
+
+void QDeclarativeViewInspectorPrivate::createToolBox()
+{
+ toolBox = new ToolBox(q->declarativeView());
+
+ QmlToolBar *toolBar = toolBox->toolBar();
+
+ QObject::connect(q, SIGNAL(selectedColorChanged(QColor)),
+ toolBar, SLOT(setColorBoxColor(QColor)));
+
+ QObject::connect(q, SIGNAL(designModeBehaviorChanged(bool)),
+ toolBar, SLOT(setDesignModeBehavior(bool)));
+
+ QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)),
+ q, SLOT(setDesignModeBehavior(bool)));
+ QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), q, SLOT(setAnimationSpeed(qreal)));
+ QObject::connect(toolBar, SIGNAL(animationPausedChanged(bool)), q, SLOT(setAnimationPaused(bool)));
+ QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool()));
+ QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool()));
+ QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool()));
+ QObject::connect(toolBar, SIGNAL(marqueeSelectToolSelected()),
+ this, SLOT(_q_changeToMarqueeSelectTool()));
+
+ QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()),
+ this, SLOT(_q_applyChangesFromClient()));
+
+ QObject::connect(q, SIGNAL(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal)));
+ QObject::connect(q, SIGNAL(animationPausedChanged(bool)), toolBar, SLOT(setAnimationPaused(bool)));
+
+ QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool()));
+
+ // disabled features
+ //connect(d->m_toolBar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient()));
+ //connect(q, SIGNAL(resizeToolActivated()), d->m_toolBar, SLOT(activateSelectTool()));
+ //connect(q, SIGNAL(moveToolActivated()), d->m_toolBar, SLOT(activateSelectTool()));
+
+ QObject::connect(q, SIGNAL(colorPickerActivated()), toolBar, SLOT(activateColorPicker()));
+ QObject::connect(q, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom()));
+ QObject::connect(q, SIGNAL(marqueeSelectToolActivated()),
+ toolBar, SLOT(activateMarqueeSelectTool()));
+}
+
+void QDeclarativeViewInspector::handleMessage(const QByteArray &message)
+{
+ QDataStream ds(message);
+
+ InspectorProtocol::Message type;
+ ds >> type;
+
+ switch (type) {
+ case InspectorProtocol::SetCurrentObjects: {
+ int itemCount = 0;
+ ds >> itemCount;
+
+ QList<QObject*> selectedObjects;
+ for (int i = 0; i < itemCount; ++i) {
+ int debugId = -1;
+ ds >> debugId;
+ if (QObject *obj = QDeclarativeDebugService::objectForId(debugId))
+ selectedObjects << obj;
+ }
+
+ data->_q_onCurrentObjectsChanged(selectedObjects);
+ break;
+ }
+ case InspectorProtocol::Reload: {
+ data->_q_reloadView();
+ break;
+ }
+ case InspectorProtocol::SetAnimationSpeed: {
+ qreal speed;
+ ds >> speed;
+ animationSpeedChangeRequested(speed);
+ break;
+ }
+ case InspectorProtocol::SetAnimationPaused: {
+ bool paused;
+ ds >> paused;
+ animationPausedChangeRequested(paused);
+ break;
+ }
+ case InspectorProtocol::ChangeTool: {
+ InspectorProtocol::Tool tool;
+ ds >> tool;
+ switch (tool) {
+ case InspectorProtocol::ColorPickerTool:
+ data->_q_changeToColorPickerTool();
+ break;
+ case InspectorProtocol::SelectTool:
+ data->_q_changeToSingleSelectTool();
+ break;
+ case InspectorProtocol::SelectMarqueeTool:
+ data->_q_changeToMarqueeSelectTool();
+ break;
+ case InspectorProtocol::ZoomTool:
+ data->_q_changeToZoomTool();
+ break;
+ default:
+ qWarning() << "Warning: Unhandled tool:" << tool;
+ }
+ break;
+ }
+ case InspectorProtocol::SetDesignMode: {
+ bool inDesignMode;
+ ds >> inDesignMode;
+ setDesignModeBehavior(inDesignMode);
+ break;
+ }
+ case InspectorProtocol::ShowAppOnTop: {
+ bool showOnTop;
+ ds >> showOnTop;
+ setShowAppOnTop(showOnTop);
+ break;
+ }
+ case InspectorProtocol::CreateObject: {
+ QString qml;
+ int parentId;
+ QString filename;
+ QStringList imports;
+ ds >> qml >> parentId >> imports >> filename;
+ data->_q_createQmlObject(qml, QDeclarativeDebugService::objectForId(parentId),
+ imports, filename);
+ break;
+ }
+ case InspectorProtocol::DestroyObject: {
+ int debugId;
+ ds >> debugId;
+ if (QObject* obj = QDeclarativeDebugService::objectForId(debugId))
+ obj->deleteLater();
+ break;
+ }
+ case InspectorProtocol::MoveObject: {
+ int debugId, newParent;
+ ds >> debugId >> newParent;
+ data->_q_reparentQmlObject(QDeclarativeDebugService::objectForId(debugId),
+ QDeclarativeDebugService::objectForId(newParent));
+ break;
+ }
+ case InspectorProtocol::ObjectIdList: {
+ int itemCount;
+ ds >> itemCount;
+ data->stringIdForObjectId.clear();
+ for (int i = 0; i < itemCount; ++i) {
+ int itemDebugId;
+ QString itemIdString;
+ ds >> itemDebugId
+ >> itemIdString;
+
+ data->stringIdForObjectId.insert(itemDebugId, itemIdString);
+ }
+ break;
+ }
+ case InspectorProtocol::ClearComponentCache: {
+ data->_q_clearComponentCache();
+ break;
+ }
+ default:
+ qWarning() << "Warning: Not handling message:" << type;
+ }
+}
+
+void QDeclarativeViewInspector::sendDesignModeBehavior(bool inDesignMode)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::SetDesignMode
+ << inDesignMode;
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendCurrentObjects(const QList<QObject*> &objects)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::CurrentObjectsChanged
+ << objects.length();
+
+ foreach (QObject *object, objects) {
+ int id = QDeclarativeDebugService::idForObject(object);
+ ds << id;
+ }
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendCurrentTool(Constants::DesignTool toolId)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::ToolChanged
+ << toolId;
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendAnimationSpeed(qreal slowDownFactor)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::AnimationSpeedChanged
+ << slowDownFactor;
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendAnimationPaused(bool paused)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::AnimationPausedChanged
+ << paused;
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendReloaded()
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::Reloaded;
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendShowAppOnTop(bool showAppOnTop)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::ShowAppOnTop << showAppOnTop;
+
+ data->debugService->sendMessage(message);
+}
+
+void QDeclarativeViewInspector::sendColorChanged(const QColor &color)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::ColorChanged
+ << color;
+
+ data->debugService->sendMessage(message);
+}
+
+QString QDeclarativeViewInspector::idStringForObject(QObject *obj) const
+{
+ int id = QDeclarativeDebugService::idForObject(obj);
+ QString idString = data->stringIdForObjectId.value(id, QString());
+ return idString;
+}
+
+QT_END_NAMESPACE
+
+#include "qdeclarativeviewinspector.moc"
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
new file mode 100644
index 0000000000..4efa093fb1
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEWINSPECTOR_P_H
+#define QDECLARATIVEVIEWINSPECTOR_P_H
+
+#include <private/qdeclarativeglobal_p.h>
+#include "qmlinspectorconstants_p.h"
+
+#include <QtCore/QScopedPointer>
+#include <QtDeclarative/QDeclarativeView>
+
+QT_FORWARD_DECLARE_CLASS(QDeclarativeItem)
+QT_FORWARD_DECLARE_CLASS(QMouseEvent)
+QT_FORWARD_DECLARE_CLASS(QToolBar)
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspectorPrivate;
+
+class QDeclarativeViewInspector : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent = 0);
+ ~QDeclarativeViewInspector();
+
+ void setSelectedItems(QList<QGraphicsItem *> items);
+ QList<QGraphicsItem *> selectedItems() const;
+
+ QDeclarativeView *declarativeView();
+
+ QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
+
+ bool showAppOnTop() const;
+
+ void sendDesignModeBehavior(bool inDesignMode);
+ void sendCurrentObjects(const QList<QObject*> &);
+ void sendAnimationSpeed(qreal slowDownFactor);
+ void sendAnimationPaused(bool paused);
+ void sendCurrentTool(Constants::DesignTool toolId);
+ void sendReloaded();
+ void sendShowAppOnTop(bool showAppOnTop);
+
+ QString idStringForObject(QObject *obj) const;
+
+public Q_SLOTS:
+ void sendColorChanged(const QColor &color);
+
+ void setDesignModeBehavior(bool value);
+ bool designModeBehavior();
+
+ void setShowAppOnTop(bool appOnTop);
+
+ void setAnimationSpeed(qreal factor);
+ void setAnimationPaused(bool paused);
+
+Q_SIGNALS:
+ void designModeBehaviorChanged(bool inDesignMode);
+ void showAppOnTopChanged(bool showAppOnTop);
+ void reloadRequested();
+ void marqueeSelectToolActivated();
+ void selectToolActivated();
+ void zoomToolActivated();
+ void colorPickerActivated();
+ void selectedColorChanged(const QColor &color);
+
+ void animationSpeedChanged(qreal factor);
+ void animationPausedChanged(bool paused);
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+ bool leaveEvent(QEvent *);
+ bool mousePressEvent(QMouseEvent *event);
+ bool mouseMoveEvent(QMouseEvent *event);
+ bool mouseReleaseEvent(QMouseEvent *event);
+ bool keyPressEvent(QKeyEvent *event);
+ bool keyReleaseEvent(QKeyEvent *keyEvent);
+ bool mouseDoubleClickEvent(QMouseEvent *event);
+ bool wheelEvent(QWheelEvent *event);
+
+ void setSelectedItemsForTools(QList<QGraphicsItem *> items);
+
+private slots:
+ void handleMessage(const QByteArray &message);
+
+ void animationSpeedChangeRequested(qreal factor);
+ void animationPausedChangeRequested(bool paused);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeViewInspector)
+
+ inline QDeclarativeViewInspectorPrivate *d_func() { return data.data(); }
+ QScopedPointer<QDeclarativeViewInspectorPrivate> data;
+ friend class QDeclarativeViewInspectorPrivate;
+ friend class AbstractLiveEditTool;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEVIEWINSPECTOR_P_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h
new file mode 100644
index 0000000000..11cbe0f447
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEWINSPECTOR_P_P_H
+#define QDECLARATIVEVIEWINSPECTOR_P_P_H
+
+#include "qdeclarativeviewinspector_p.h"
+
+#include <QtCore/QWeakPointer>
+#include <QtCore/QPointF>
+
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeViewInspector;
+class LiveSelectionTool;
+class ZoomTool;
+class ColorPickerTool;
+class LiveLayerItem;
+class BoundingRectHighlighter;
+class ToolBox;
+class AbstractLiveEditTool;
+
+class QDeclarativeViewInspectorPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *);
+ ~QDeclarativeViewInspectorPrivate();
+
+ QDeclarativeView *view;
+ QDeclarativeViewInspector *q;
+ QDeclarativeInspectorService *debugService;
+ QWeakPointer<QWidget> viewport;
+ QHash<int, QString> stringIdForObjectId;
+
+ QPointF cursorPos;
+ QList<QWeakPointer<QGraphicsObject> > currentSelection;
+
+ Constants::DesignTool currentToolMode;
+ AbstractLiveEditTool *currentTool;
+
+ LiveSelectionTool *selectionTool;
+ ZoomTool *zoomTool;
+ ColorPickerTool *colorPickerTool;
+ LiveLayerItem *manipulatorLayer;
+
+ BoundingRectHighlighter *boundingRectHighlighter;
+
+ bool designModeBehavior;
+ bool showAppOnTop;
+
+ bool animationPaused;
+ qreal slowDownFactor;
+
+ ToolBox *toolBox;
+
+ void setViewport(QWidget *widget);
+
+ void clearEditorItems();
+ void createToolBox();
+ void changeToSelectTool();
+ QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const;
+
+ QList<QGraphicsItem*> selectableItems(const QPoint &pos) const;
+ QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
+ QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
+
+ void setSelectedItemsForTools(const QList<QGraphicsItem *> &items);
+ void setSelectedItems(const QList<QGraphicsItem *> &items);
+ QList<QGraphicsItem *> selectedItems() const;
+
+ void changeTool(Constants::DesignTool tool,
+ Constants::ToolFlags flags = Constants::NoToolFlags);
+
+ void clearHighlight();
+ void highlight(const QList<QGraphicsObject *> &item);
+ inline void highlight(QGraphicsObject *item)
+ { highlight(QList<QGraphicsObject*>() << item); }
+
+ bool isEditorItem(QGraphicsItem *item) const;
+
+public slots:
+ void _q_setToolBoxVisible(bool visible);
+
+ void _q_reloadView();
+ void _q_onStatusChanged(QDeclarativeView::Status status);
+ void _q_onCurrentObjectsChanged(QList<QObject*> objects);
+ void _q_applyChangesFromClient();
+ void _q_createQmlObject(const QString &qml, QObject *parent,
+ const QStringList &imports, const QString &filename = QString());
+ void _q_reparentQmlObject(QObject *, QObject *);
+
+ void _q_changeToSingleSelectTool();
+ void _q_changeToMarqueeSelectTool();
+ void _q_changeToZoomTool();
+ void _q_changeToColorPickerTool();
+ void _q_clearComponentCache();
+ void _q_removeFromSelection(QObject *);
+
+public:
+ static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); }
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEVIEWINSPECTOR_P_P_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
new file mode 100644
index 0000000000..f8d7ee8360
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
@@ -0,0 +1,51 @@
+TARGET = qmldbg_inspector
+QT += declarative
+
+include(../../qpluginbase.pri)
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling
+QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
+
+SOURCES += \
+ qdeclarativeinspectorplugin.cpp \
+ qdeclarativeviewinspector.cpp \
+ editor/abstractliveedittool.cpp \
+ editor/liveselectiontool.cpp \
+ editor/livelayeritem.cpp \
+ editor/livesingleselectionmanipulator.cpp \
+ editor/liverubberbandselectionmanipulator.cpp \
+ editor/liveselectionrectangle.cpp \
+ editor/liveselectionindicator.cpp \
+ editor/boundingrecthighlighter.cpp \
+ editor/subcomponentmasklayeritem.cpp \
+ editor/zoomtool.cpp \
+ editor/colorpickertool.cpp \
+ editor/qmltoolbar.cpp \
+ editor/toolbarcolorbox.cpp
+
+HEADERS += \
+ qdeclarativeinspectorplugin.h \
+ qdeclarativeinspectorprotocol.h \
+ qdeclarativeviewinspector_p.h \
+ qdeclarativeviewinspector_p_p.h \
+ qmlinspectorconstants_p.h \
+ editor/abstractliveedittool_p.h \
+ editor/liveselectiontool_p.h \
+ editor/livelayeritem_p.h \
+ editor/livesingleselectionmanipulator_p.h \
+ editor/liverubberbandselectionmanipulator_p.h \
+ editor/liveselectionrectangle_p.h \
+ editor/liveselectionindicator_p.h \
+ editor/boundingrecthighlighter_p.h \
+ editor/subcomponentmasklayeritem_p.h \
+ editor/zoomtool_p.h \
+ editor/colorpickertool_p.h \
+ editor/qmltoolbar_p.h \
+ editor/toolbarcolorbox_p.h
+
+RESOURCES += editor/editor.qrc
+
+target.path += $$[QT_INSTALL_PLUGINS]/qmltooling
+INSTALLS += target
+
+symbian:TARGET.UID3=0x20031E90
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h b/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h
new file mode 100644
index 0000000000..40ec32542d
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLINSPECTORCONSTANTS_H
+#define QMLINSPECTORCONSTANTS_H
+
+#include <QtDeclarative/private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+namespace Constants {
+
+enum DesignTool {
+ NoTool = 0,
+ SelectionToolMode = 1,
+ MarqueeSelectionToolMode = 2,
+ MoveToolMode = 3,
+ ResizeToolMode = 4,
+ ColorPickerMode = 5,
+ ZoomMode = 6
+};
+
+enum ToolFlags {
+ NoToolFlags = 0,
+ UseCursorPos = 1
+};
+
+static const int DragStartTime = 50;
+
+static const int DragStartDistance = 20;
+
+static const double ZoomSnapDelta = 0.04;
+
+static const int EditorItemDataKey = 1000;
+
+enum GraphicsItemTypes {
+ EditorItemType = 0xEAAA,
+ ResizeHandleItemType = 0xEAEA
+};
+
+
+} // namespace Constants
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QMLINSPECTORCONSTANTS_H
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index abc60e13a7..283f7d4cae 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -125,7 +125,13 @@ void QTcpServerConnection::disconnect()
bool QTcpServerConnection::waitForMessage()
{
Q_D(QTcpServerConnection);
- return d->protocol->waitForReadyRead(-1);
+ if (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ return true;
+ } else {
+ return d->protocol->waitForReadyRead(-1);
+ }
}
void QTcpServerConnection::setPort(int port, bool block)
@@ -145,10 +151,11 @@ void QTcpServerConnection::listen()
d->tcpServer = new QTcpServer(this);
QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
- if (d->tcpServer->listen(QHostAddress::Any, d->port))
+ if (d->tcpServer->listen(QHostAddress::Any, d->port)) {
qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port);
- else
+ } else {
qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port);
+ }
}
@@ -158,10 +165,10 @@ void QTcpServerConnection::readyRead()
if (!d->protocol)
return;
- QPacket packet = d->protocol->read();
-
- QByteArray content = packet.data();
- d->debugServer->receiveMessage(content);
+ while (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ }
}
void QTcpServerConnection::newConnection()
diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro
index 0d60eb17ff..8220109efc 100644
--- a/src/plugins/qmltooling/qmltooling.pro
+++ b/src/plugins/qmltooling/qmltooling.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = qmldbg_tcp declarativeobserver
+SUBDIRS = qmldbg_tcp qmldbg_inspector
symbian:SUBDIRS += qmldbg_ost
diff --git a/src/plugins/s60/3_1/3_1.pro b/src/plugins/s60/3_1/3_1.pro
deleted file mode 100644
index 9437f3da29..0000000000
--- a/src/plugins/s60/3_1/3_1.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../s60pluginbase.pri)
-
-TARGET = qts60plugin_3_1$${QT_LIBINFIX}
-
-SOURCES += ../src/qlocale_3_1.cpp \
- ../src/qdesktopservices_3_1.cpp \
- ../src/qcoreapplication_3_1.cpp
-
-TARGET.UID3=0x2001E620
diff --git a/src/plugins/s60/3_2/3_2.pro b/src/plugins/s60/3_2/3_2.pro
deleted file mode 100644
index b104c054b2..0000000000
--- a/src/plugins/s60/3_2/3_2.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-include(../s60pluginbase.pri)
-
-TARGET = qts60plugin_3_2$${QT_LIBINFIX}
-
-contains(S60_VERSION, 3.1) {
- SOURCES += ../src/qlocale_3_1.cpp \
- ../src/qdesktopservices_3_1.cpp \
- ../src/qcoreapplication_3_1.cpp
-} else {
- SOURCES += ../src/qlocale_3_2.cpp \
- ../src/qdesktopservices_3_2.cpp \
- ../src/qcoreapplication_3_2.cpp
- contains(CONFIG, is_using_gnupoc) {
- LIBS += -ldirectorylocalizer
- } else {
- LIBS += -lDirectoryLocalizer
- }
- LIBS += -lefsrv
- LIBS += -lnumberconversion
- INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-}
-
-TARGET.UID3=0x2001E621
diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro
deleted file mode 100644
index b0372155b1..0000000000
--- a/src/plugins/s60/5_0/5_0.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-include(../s60pluginbase.pri)
-
-TARGET = qts60plugin_5_0$${QT_LIBINFIX}
-
-contains(S60_VERSION, 3.1) {
- SOURCES += ../src/qlocale_3_1.cpp \
- ../src/qdesktopservices_3_1.cpp \
- ../src/qcoreapplication_3_1.cpp
-} else {
- SOURCES += ../src/qlocale_3_2.cpp \
- ../src/qdesktopservices_3_2.cpp \
- ../src/qcoreapplication_3_2.cpp
- contains(CONFIG, is_using_gnupoc) {
- LIBS += -ldirectorylocalizer
- } else {
- LIBS += -lDirectoryLocalizer
- }
- LIBS += -lefsrv
- LIBS += -lnumberconversion
- INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-}
-
-TARGET.UID3=0x2001E622
diff --git a/src/plugins/s60/bwins/qts60pluginu.def b/src/plugins/s60/bwins/qts60pluginu.def
deleted file mode 100644
index b4110a9fb4..0000000000
--- a/src/plugins/s60/bwins/qts60pluginu.def
+++ /dev/null
@@ -1,8 +0,0 @@
-EXPORTS
- ?defaultFormatL@@YAXAAVTTime@@AAVTDes16@@ABVTDesC16@@ABVTLocale@@@Z @ 1 NONAME ; void defaultFormatL(class TTime &, class TDes16 &, class TDesC16 const &, class TLocale const &)
- ?defaultGetTimeFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 2 NONAME ; class TPtrC16 defaultGetTimeFormatSpec(class TExtendedLocale &)
- ?defaultGetLongDateFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 3 NONAME ; class TPtrC16 defaultGetLongDateFormatSpec(class TExtendedLocale &)
- ?defaultGetShortDateFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 4 NONAME ; class TPtrC16 defaultGetShortDateFormatSpec(class TExtendedLocale &)
- ?localizedDirectoryName@@YA?AVQString@@AAV1@@Z @ 5 NONAME ; class QString localizedDirectoryName(class QString &)
- ?systemDrive@@YA?AW4TDriveNumber@@AAVRFs@@@Z @ 6 NONAME ; enum TDriveNumber systemDrive(class RFs &)
-
diff --git a/src/plugins/s60/eabi/qts60pluginu.def b/src/plugins/s60/eabi/qts60pluginu.def
deleted file mode 100644
index df7895c0cb..0000000000
--- a/src/plugins/s60/eabi/qts60pluginu.def
+++ /dev/null
@@ -1,8 +0,0 @@
-EXPORTS
- _Z14defaultFormatLR5TTimeR6TDes16RK7TDesC16RK7TLocale @ 1 NONAME
- _Z24defaultGetTimeFormatSpecR15TExtendedLocale @ 2 NONAME
- _Z28defaultGetLongDateFormatSpecR15TExtendedLocale @ 3 NONAME
- _Z29defaultGetShortDateFormatSpecR15TExtendedLocale @ 4 NONAME
- _Z22localizedDirectoryNameR7QString @ 5 NONAME
- _Z11systemDriveR3RFs @ 6 NONAME
-
diff --git a/src/plugins/s60/feedback/feedback.pro b/src/plugins/s60/feedback/feedback.pro
new file mode 100644
index 0000000000..1069220442
--- /dev/null
+++ b/src/plugins/s60/feedback/feedback.pro
@@ -0,0 +1,18 @@
+include(../../qpluginbase.pri)
+
+TARGET = qtactilefeedback$${QT_LIBINFIX}
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60/feedback
+
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+contains(S60_VERSION, 5.0)|contains(S60_VERSION, symbian3) {
+ HEADERS += qtactileFeedback.h
+ SOURCES += qtactileFeedback_s60.cpp
+
+ LIBS += -ltouchfeedback
+}
+
+load(data_caging_paths)
+
+TARGET.UID3=0x200315B4
diff --git a/src/plugins/s60/feedback/qtactileFeedback.h b/src/plugins/s60/feedback/qtactileFeedback.h
new file mode 100644
index 0000000000..7c4cc291fc
--- /dev/null
+++ b/src/plugins/s60/feedback/qtactileFeedback.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 <QEvent>
+#include <QWidget>
+
+#include "private/qs60style_feedbackinterface_p.h"
+
+class QTactileFeedback : public TactileFeedbackInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(TactileFeedbackInterface)
+
+ public:
+ void touchFeedback(QEvent *event, const QWidget *widget);
+ };
diff --git a/src/plugins/s60/feedback/qtactileFeedback_s60.cpp b/src/plugins/s60/feedback/qtactileFeedback_s60.cpp
new file mode 100644
index 0000000000..c2f1d346cf
--- /dev/null
+++ b/src/plugins/s60/feedback/qtactileFeedback_s60.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 <QApplication>
+#include <QObject>
+#include <QSlider>
+#include <QScrollBar>
+
+#include <QtCore/qplugin.h>
+#include "qtactileFeedback.h"
+
+#include <touchfeedback.h>
+
+void QTactileFeedback::touchFeedback(QEvent *event, const QWidget *widget)
+{
+ //Lets share the global instance for touch feedback (you are NOT allowed to try and delete it!).
+ MTouchFeedback* feedback = MTouchFeedback::Instance();
+
+ //If the widget itself is not handling focus, try to use focusProxy widget.
+ const QWidget *w = ((widget->focusPolicy() == Qt::NoFocus) && (widget->focusProxy())) ? widget->focusProxy() : widget;
+
+ //Only give tactile feedback for enabled widgets that take focus.
+ if (feedback && w && w->isEnabled() && w->isWidgetType() && w->isVisible()) {
+ //Scrollbars are 'special' that they don't take focus (nor they have focusProxy), yet we'd like to have tactile feedback for them
+ if (w->focusPolicy() == Qt::NoFocus)
+ if (!qobject_cast<const QScrollBar *>(w))
+ return;
+
+ //Don't give tactile feedback for widgets that are outside topmost dialog.
+ QWidget *dialog = QApplication::activeModalWidget();
+ if (dialog) {
+ QList<const QWidget *> allChildren = dialog->findChildren<const QWidget *>();
+ if (!allChildren.contains(w))
+ return;
+ }
+
+ //Widget specific tactile feedback.
+ if (qobject_cast<const QSlider *>(w) || qobject_cast<const QScrollBar *>(w))
+ feedback->InstantFeedback(ETouchFeedbackSensitive);
+ else
+ feedback->InstantFeedback(ETouchFeedbackBasic);
+ }
+}
+
+Q_EXPORT_PLUGIN2("feedback", QTactileFeedback);
diff --git a/src/plugins/s60/s60.pro b/src/plugins/s60/s60.pro
deleted file mode 100644
index c999fff656..0000000000
--- a/src/plugins/s60/s60.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = subdirs
-
-
-symbian {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- SUBDIRS += 3_1 3_2
- }
-
- # 5.0 is used also for Symbian3 and later
- SUBDIRS += 5_0
-} \ No newline at end of file
diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri
deleted file mode 100644
index 4e1510299b..0000000000
--- a/src/plugins/s60/s60pluginbase.pri
+++ /dev/null
@@ -1,23 +0,0 @@
-# Note: These version based 'plugins' are not an actual Qt plugins,
-# they are just regular runtime loaded libraries
-include(../qpluginbase.pri)
-
-CONFIG -= plugin
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60
-
-MMP_RULES += NOEXPORTLIBRARY
-
-symbian-abld|symbian-sbsv2 {
- defBlock = \
- "$${LITERAL_HASH}ifdef WINSCW" \
- "DEFFILE ../bwins/qts60plugin.def" \
- "$${LITERAL_HASH}else" \
- "DEFFILE ../eabi/qts60plugin.def" \
- "$${LITERAL_HASH}endif"
-} else {
- CONFIG *= def_files
- DEF_FILE = ../eabi/qts60pluginu.def
-}
-
-MMP_RULES += defBlock \ No newline at end of file
diff --git a/src/plugins/s60/src/qcoreapplication_3_1.cpp b/src/plugins/s60/src/qcoreapplication_3_1.cpp
deleted file mode 100644
index 6f2e86a106..0000000000
--- a/src/plugins/s60/src/qcoreapplication_3_1.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qglobal.h>
-#include <f32file.h>
-
-EXPORT_C TDriveNumber systemDrive(RFs&)
-{
- return EDriveC;
-}
diff --git a/src/plugins/s60/src/qcoreapplication_3_2.cpp b/src/plugins/s60/src/qcoreapplication_3_2.cpp
deleted file mode 100644
index 117248c8fc..0000000000
--- a/src/plugins/s60/src/qcoreapplication_3_2.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qglobal.h>
-#include <f32file.h>
-
-EXPORT_C TDriveNumber systemDrive(RFs& fs)
-{
- return fs.GetSystemDrive();
-}
diff --git a/src/plugins/s60/src/qdesktopservices_3_1.cpp b/src/plugins/s60/src/qdesktopservices_3_1.cpp
deleted file mode 100644
index 4b04733eb9..0000000000
--- a/src/plugins/s60/src/qdesktopservices_3_1.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qglobal.h>
-#include <qstring.h>
-
-EXPORT_C QString localizedDirectoryName(QString&)
-{
- qWarning("QDesktopServices::displayName() not implemented for this platform version");
- return QString();
-}
diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp
deleted file mode 100644
index e91ab6b07f..0000000000
--- a/src/plugins/s60/src/qdesktopservices_3_2.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qcore_symbian_p.h>
-#include <qstring.h>
-#include <qdir.h>
-
-#ifdef Q_WS_S60
-#include <e32base.h> // CBase -> Required by cdirectorylocalizer.h
-#include <CDirectoryLocalizer.h> // CDirectoryLocalizer
-
-EXPORT_C QString localizedDirectoryName(QString& rawPath)
-{
- QString ret;
- std::exception dummy; // voodoo fix for "Undefined symbol typeinfo for std::exception" in armv5 build
-
- TRAPD(err,
- QT_TRYCATCH_LEAVING(
- CDirectoryLocalizer* localizer = CDirectoryLocalizer::NewL();
- CleanupStack::PushL(localizer);
- localizer->SetFullPath(qt_QString2TPtrC(QDir::toNativeSeparators(rawPath)));
- if(localizer->IsLocalized()){
- TPtrC locName(localizer->LocalizedName());
- ret = qt_TDesC2QString(locName);
- }
- CleanupStack::PopAndDestroy(localizer);
- )
- )
-
- if (err != KErrNone)
- ret = QString();
-
- return ret;
-}
-#else
-
-EXPORT_C QString localizedDirectoryName(QString& /* rawPath */)
-{
- qWarning("QDesktopServices::displayName() not implemented for this platform version");
- return QString();
-}
-#endif
diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp
deleted file mode 100644
index 5b9777773a..0000000000
--- a/src/plugins/s60/src/qlocale_3_1.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <e32std.h>
-#include <e32const.h>
-#include <e32debug.h>
-
-_LIT(KYear, "%Y");
-_LIT(KMonth, "%M");
-_LIT(KDay, "%D");
-_LIT(KLocaleIndependent, "%F");
-static TBuf<10> dateFormat;
-static TBuf<10> timeFormat;
-
-static void initialiseDateFormat()
-{
- if(dateFormat.Length())
- return;
-
- TLocale locale;
-
- //Separator 1 is used between 1st and 2nd components of the date
- //Separator 2 is used between 2nd and 3rd components of the date
- //Usually they are the same, but they are allowed to be different
- TChar s1 = locale.DateSeparator(1);
- TChar s2 = locale.DateSeparator(2);
- dateFormat=KLocaleIndependent;
- switch(locale.DateFormat()) {
- case EDateAmerican:
- dateFormat.Append(KMonth);
- dateFormat.Append(s1);
- dateFormat.Append(KDay);
- dateFormat.Append(s2);
- dateFormat.Append(KYear);
- break;
- case EDateEuropean:
- dateFormat.Append(KDay);
- dateFormat.Append(s1);
- dateFormat.Append(KMonth);
- dateFormat.Append(s2);
- dateFormat.Append(KYear);
- break;
- case EDateJapanese:
- default: //it's closest to ISO format
- dateFormat.Append(KYear);
- dateFormat.Append(s1);
- dateFormat.Append(KMonth);
- dateFormat.Append(s2);
- dateFormat.Append(KDay);
- break;
- }
-#ifdef _DEBUG
- RDebug::Print(_L("Date Format \"%S\""), &dateFormat);
-#endif
-}
-
-static void initialiseTimeFormat()
-{
- if(timeFormat.Length())
- return;
-
- TLocale locale;
- //Separator 1 is used between 1st and 2nd components of the time
- //Separator 2 is used between 2nd and 3rd components of the time
- //Usually they are the same, but they are allowed to be different
- TChar s1 = locale.TimeSeparator(1);
- TChar s2 = locale.TimeSeparator(2);
- switch(locale.TimeFormat()) {
- case ETime12:
- timeFormat.Append(_L("%I"));
- break;
- case ETime24:
- default:
- timeFormat.Append(_L("%H"));
- break;
- }
- timeFormat.Append(s1);
- timeFormat.Append(_L("%T"));
- timeFormat.Append(s2);
- timeFormat.Append(_L("%S"));
-
-#ifdef _DEBUG
- RDebug::Print(_L("Time Format \"%S\""), &timeFormat);
-#endif
-}
-
-EXPORT_C void defaultFormatL(TTime& time, TDes& des, const TDesC& fmt, const TLocale&)
-{
- //S60 3.1 does not support format for a specific locale, so use default locale
- time.FormatL(des, fmt);
-}
-
-//S60 3.1 doesn't support extended locale date&time formats, so use default locale
-EXPORT_C TPtrC defaultGetTimeFormatSpec(TExtendedLocale&)
-{
- initialiseTimeFormat();
- return TPtrC(timeFormat);
-}
-
-EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale&)
-{
- initialiseDateFormat();
- return TPtrC(dateFormat);
-}
-
-EXPORT_C TPtrC defaultGetShortDateFormatSpec(TExtendedLocale&)
-{
- initialiseDateFormat();
- return TPtrC(dateFormat);
-}
diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp
deleted file mode 100644
index 5d24eec6de..0000000000
--- a/src/plugins/s60/src/qlocale_3_2.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <exception>
-#include <e32std.h>
-#include <e32base.h>
-#include <numberconversion.h>
-
-EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale& locale)
-{
- return locale.GetLongDateFormatSpec();
-}
-
-EXPORT_C TPtrC defaultGetShortDateFormatSpec(TExtendedLocale& locale)
-{
- return locale.GetShortDateFormatSpec();
-}
-
-EXPORT_C TPtrC defaultGetTimeFormatSpec(TExtendedLocale& locale)
-{
- return locale.GetTimeFormatSpec();
-}
-
-EXPORT_C void defaultFormatL(TTime& time, TDes& des, const TDesC& format, const TLocale& locale)
-{
- time.FormatL(des, format, locale);
- NumberConversion::ConvertDigits(des, locale.DigitType());
-}
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index e4f244ca26..58c1c4ac51 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -1000,7 +1000,7 @@ EXPORTS
?addDays@QDate@@QBE?AV1@H@Z @ 999 NONAME ; class QDate QDate::addDays(int) const
?addDays@QDateTime@@QBE?AV1@H@Z @ 1000 NONAME ; class QDateTime QDateTime::addDays(int) const
?addDefaultAnimation@QStateMachine@@QAEXPAVQAbstractAnimation@@@Z @ 1001 NONAME ; void QStateMachine::addDefaultAnimation(class QAbstractAnimation *)
- ?addDeferredActiveObject@QEventDispatcherSymbian@@QAEXPAVQActiveObject@@@Z @ 1002 NONAME ; void QEventDispatcherSymbian::addDeferredActiveObject(class QActiveObject *)
+ ?addDeferredActiveObject@QEventDispatcherSymbian@@QAEXPAVQActiveObject@@@Z @ 1002 NONAME ABSENT ; void QEventDispatcherSymbian::addDeferredActiveObject(class QActiveObject *)
?addEncodedQueryItem@QUrl@@QAEXABVQByteArray@@0@Z @ 1003 NONAME ; void QUrl::addEncodedQueryItem(class QByteArray const &, class QByteArray const &)
?addExtraNamespaceDeclaration@QXmlStreamReader@@QAEXABVQXmlStreamNamespaceDeclaration@@@Z @ 1004 NONAME ; void QXmlStreamReader::addExtraNamespaceDeclaration(class QXmlStreamNamespaceDeclaration const &)
?addExtraNamespaceDeclarations@QXmlStreamReader@@QAEXABV?$QVector@VQXmlStreamNamespaceDeclaration@@@@@Z @ 1005 NONAME ; void QXmlStreamReader::addExtraNamespaceDeclarations(class QVector<class QXmlStreamNamespaceDeclaration> const &)
@@ -2940,7 +2940,7 @@ EXPORTS
?qt_qFindChildren_helper@@YAXPBVQObject@@ABVQString@@PBVQRegExp@@ABUQMetaObject@@PAV?$QList@PAX@@@Z @ 2939 NONAME ; void qt_qFindChildren_helper(class QObject const *, class QString const &, class QRegExp const *, struct QMetaObject const &, class QList<void *> *)
?qt_regexp_toCanonical@@YA?AVQString@@ABV1@W4PatternSyntax@QRegExp@@@Z @ 2940 NONAME ; class QString qt_regexp_toCanonical(class QString const &, enum QRegExp::PatternSyntax)
?qt_register_signal_spy_callbacks@@YAXABUQSignalSpyCallbackSet@@@Z @ 2941 NONAME ; void qt_register_signal_spy_callbacks(struct QSignalSpyCallbackSet const &)
- ?qt_resolveS60PluginFunc@@YAP6AHXZH@Z @ 2942 NONAME ; int (*)(void) qt_resolveS60PluginFunc(int)
+ ?qt_resolveS60PluginFunc@@YAP6AHXZH@Z @ 2942 NONAME ABSENT ; int (*)(void) qt_resolveS60PluginFunc(int)
?qt_s60GetRFs@@YAAAVRFs@@XZ @ 2943 NONAME ; class RFs & qt_s60GetRFs(void)
?qt_safe_select@@YAHHPAUfd_set@@00PBUtimeval@@@Z @ 2944 NONAME ; int qt_safe_select(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval const *)
?qt_symbianLocaleName@@YA?AVQByteArray@@H@Z @ 2945 NONAME ; class QByteArray qt_symbianLocaleName(int)
@@ -3062,7 +3062,7 @@ EXPORTS
?removeColumn@QAbstractItemModel@@QAE_NHABVQModelIndex@@@Z @ 3061 NONAME ; bool QAbstractItemModel::removeColumn(int, class QModelIndex const &)
?removeColumns@QAbstractItemModel@@UAE_NHHABVQModelIndex@@@Z @ 3062 NONAME ; bool QAbstractItemModel::removeColumns(int, int, class QModelIndex const &)
?removeDefaultAnimation@QStateMachine@@QAEXPAVQAbstractAnimation@@@Z @ 3063 NONAME ; void QStateMachine::removeDefaultAnimation(class QAbstractAnimation *)
- ?removeDeferredActiveObject@QEventDispatcherSymbian@@QAEXPAVQActiveObject@@@Z @ 3064 NONAME ; void QEventDispatcherSymbian::removeDeferredActiveObject(class QActiveObject *)
+ ?removeDeferredActiveObject@QEventDispatcherSymbian@@QAEXPAVQActiveObject@@@Z @ 3064 NONAME ABSENT ; void QEventDispatcherSymbian::removeDeferredActiveObject(class QActiveObject *)
?removeEncodedQueryItem@QUrl@@QAEXABVQByteArray@@@Z @ 3065 NONAME ; void QUrl::removeEncodedQueryItem(class QByteArray const &)
?removeEventFilter@QObject@@QAEXPAV1@@Z @ 3066 NONAME ; void QObject::removeEventFilter(class QObject *)
?removeFormat@QMimeData@@QAEXABVQString@@@Z @ 3067 NONAME ; void QMimeData::removeFormat(class QString const &)
@@ -4484,8 +4484,8 @@ EXPORTS
?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4483 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void)
?qt_symbian_SetupThreadHeap@@YAHHAAUSStdEpocThreadCreateInfo@@@Z @ 4484 NONAME ; int qt_symbian_SetupThreadHeap(int, struct SStdEpocThreadCreateInfo &)
?objectNameChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4485 NONAME ; void (*QAbstractDeclarativeData::objectNameChanged)(class QAbstractDeclarativeData *, class QObject *)
- ?queueDeferredActiveObjectsCompletion@QEventDispatcherSymbian@@QAEXXZ @ 4486 NONAME ; void QEventDispatcherSymbian::queueDeferredActiveObjectsCompletion(void)
- ?reactivateDeferredActiveObjects@QEventDispatcherSymbian@@UAEXXZ @ 4487 NONAME ; void QEventDispatcherSymbian::reactivateDeferredActiveObjects(void)
+ ?queueDeferredActiveObjectsCompletion@QEventDispatcherSymbian@@QAEXXZ @ 4486 NONAME ABSENT ; void QEventDispatcherSymbian::queueDeferredActiveObjectsCompletion(void)
+ ?reactivateDeferredActiveObjects@QEventDispatcherSymbian@@UAEXXZ @ 4487 NONAME ABSENT ; void QEventDispatcherSymbian::reactivateDeferredActiveObjects(void)
?contains@QString@@QBE?AVQBool@@ABVQStringRef@@W4CaseSensitivity@Qt@@@Z @ 4488 NONAME ; class QBool QString::contains(class QStringRef const &, enum Qt::CaseSensitivity) const
?swap@QRegExp@@QAEXAAV1@@Z @ 4489 NONAME ; void QRegExp::swap(class QRegExp &)
?indexOf@QStringRef@@QBEHABVQString@@HW4CaseSensitivity@Qt@@@Z @ 4490 NONAME ; int QStringRef::indexOf(class QString const &, int, enum Qt::CaseSensitivity) const
@@ -4612,17 +4612,17 @@ EXPORTS
?reactivateAndComplete@QActiveObject@@QAEXXZ @ 4611 NONAME ; void QActiveObject::reactivateAndComplete(void)
?defaultConnection@QSymbianSocketManager@@QBEPAVRConnection@@XZ @ 4612 NONAME ; class RConnection * QSymbianSocketManager::defaultConnection(void) const
?qt_symbianGetSocketServer@@YAAAVRSocketServ@@XZ @ 4613 NONAME ; class RSocketServ & qt_symbianGetSocketServer(void)
- ?maybeQueueForLater@QActiveObject@@QAE_NXZ @ 4614 NONAME ; bool QActiveObject::maybeQueueForLater(void)
+ ?maybeQueueForLater@QActiveObject@@QAE_NXZ @ 4614 NONAME ABSENT ; bool QActiveObject::maybeQueueForLater(void)
??_EQActiveObject@@UAE@I@Z @ 4615 NONAME ; QActiveObject::~QActiveObject(unsigned int)
?lookupSocket@QSymbianSocketManager@@QBE_NHAAVRSocket@@@Z @ 4616 NONAME ; bool QSymbianSocketManager::lookupSocket(int, class RSocket &) const
- ?wait@QActiveObject@@SA_NPAVCActive@@H@Z @ 4617 NONAME ; bool QActiveObject::wait(class CActive *, int)
+ ?wait@QActiveObject@@SA_NPAVCActive@@H@Z @ 4617 NONAME ABSENT ; bool QActiveObject::wait(class CActive *, int)
?instance@QSymbianSocketManager@@SAAAV1@XZ @ 4618 NONAME ; class QSymbianSocketManager & QSymbianSocketManager::instance(void)
??0QSymbianSocketManager@@QAE@XZ @ 4619 NONAME ; QSymbianSocketManager::QSymbianSocketManager(void)
?create@QNonContiguousByteDeviceFactory@@SAPAVQNonContiguousByteDevice@@V?$QSharedPointer@VQRingBuffer@@@@@Z @ 4620 NONAME ; class QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create(class QSharedPointer<class QRingBuffer>)
??1QSymbianSocketManager@@QAE@XZ @ 4621 NONAME ; QSymbianSocketManager::~QSymbianSocketManager(void)
?isResetDisabled@QNonContiguousByteDevice@@QAE_NXZ @ 4622 NONAME ; bool QNonContiguousByteDevice::isResetDisabled(void)
??1QActiveObject@@UAE@XZ @ 4623 NONAME ; QActiveObject::~QActiveObject(void)
- ?wait@QActiveObject@@SA_NV?$QList@PAVCActive@@@@H@Z @ 4624 NONAME ; bool QActiveObject::wait(class QList<class CActive *>, int)
+ ?wait@QActiveObject@@SA_NV?$QList@PAVCActive@@@@H@Z @ 4624 NONAME ABSENT ; bool QActiveObject::wait(class QList<class CActive *>, int)
?maybeDeferSocketEvent@QActiveObject@@QAE_NXZ @ 4625 NONAME ; bool QActiveObject::maybeDeferSocketEvent(void)
?lookupSocket@QSymbianSocketManager@@QBEHABVRSocket@@@Z @ 4626 NONAME ; int QSymbianSocketManager::lookupSocket(class RSocket const &) const
?areSocketEventsBlocked@QEventDispatcherSymbian@@QBE_NXZ @ 4627 NONAME ; bool QEventDispatcherSymbian::areSocketEventsBlocked(void) const
@@ -4844,172 +4844,41 @@ EXPORTS
?staticMetaObjectExtraData@QEventTransition@@0UQMetaObjectExtraData@@B @ 4843 NONAME ; struct QMetaObjectExtraData const QEventTransition::staticMetaObjectExtraData
?qt_static_metacall@QEventLoop@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 4844 NONAME ; void QEventLoop::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
?keys@QProcessEnvironment@@QBE?AVQStringList@@XZ @ 4845 NONAME ; class QStringList QProcessEnvironment::keys(void) const
- ?progressTextChanged@QFutureWatcherBase@@IAEXABVQString@@@Z @ 4846 NONAME ; void QFutureWatcherBase::progressTextChanged(class QString const &)
- ?timeAfterUser@BlockSizeManager@QtConcurrent@@QAEXXZ @ 4847 NONAME ABSENT ; void QtConcurrent::BlockSizeManager::timeAfterUser(void)
- ?hasThrown@ExceptionStore@internal@QtConcurrent@@QBE_NXZ @ 4848 NONAME ABSENT ; bool QtConcurrent::internal::ExceptionStore::hasThrown(void) const
- ??1ExceptionStore@internal@QtConcurrent@@QAE@XZ @ 4849 NONAME ABSENT ; QtConcurrent::internal::ExceptionStore::~ExceptionStore(void)
- ?isVector@ResultIteratorBase@QtConcurrent@@QBE_NXZ @ 4850 NONAME ABSENT ; bool QtConcurrent::ResultIteratorBase::isVector(void) const
- ?queryState@QFutureInterfaceBase@@QBE_NW4State@1@@Z @ 4851 NONAME ABSENT ; bool QFutureInterfaceBase::queryState(enum QFutureInterfaceBase::State) const
- ?end@ResultStoreBase@QtConcurrent@@QBE?AVResultIteratorBase@2@XZ @ 4852 NONAME ABSENT ; class QtConcurrent::ResultIteratorBase QtConcurrent::ResultStoreBase::end(void) const
- ?run@ThreadEngineBase@QtConcurrent@@EAEXXZ @ 4853 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::run(void)
- ?exception@ExceptionStore@internal@QtConcurrent@@QAE?AVExceptionHolder@23@XZ @ 4854 NONAME ABSENT ; class QtConcurrent::internal::ExceptionHolder QtConcurrent::internal::ExceptionStore::exception(void)
- ?isStarted@QFutureWatcherBase@@QBE_NXZ @ 4855 NONAME ABSENT ; bool QFutureWatcherBase::isStarted(void) const
- ?resultIndex@ResultIteratorBase@QtConcurrent@@QBEHXZ @ 4856 NONAME ABSENT ; int QtConcurrent::ResultIteratorBase::resultIndex(void) const
- ?qt_metacast@QFutureWatcherBase@@UAEPAXPBD@Z @ 4857 NONAME ; void * QFutureWatcherBase::qt_metacast(char const *)
- ??9QFutureInterfaceBase@@QBE_NABV0@@Z @ 4858 NONAME ABSENT ; bool QFutureInterfaceBase::operator!=(class QFutureInterfaceBase const &) const
- ??0QFutureInterfaceBase@@QAE@W4State@0@@Z @ 4859 NONAME ABSENT ; QFutureInterfaceBase::QFutureInterfaceBase(enum QFutureInterfaceBase::State)
- ?staticMetaObjectExtraData@QFutureWatcherBase@@0UQMetaObjectExtraData@@B @ 4860 NONAME ; struct QMetaObjectExtraData const QFutureWatcherBase::staticMetaObjectExtraData
- ??0QFutureWatcherBase@@QAE@PAVQObject@@@Z @ 4861 NONAME ABSENT ; QFutureWatcherBase::QFutureWatcherBase(class QObject *)
- ??1QFutureInterfaceBase@@UAE@XZ @ 4862 NONAME ABSENT ; QFutureInterfaceBase::~QFutureInterfaceBase(void)
- ?resume@QFutureWatcherBase@@QAEXXZ @ 4863 NONAME ; void QFutureWatcherBase::resume(void)
- ?startSingleThreaded@ThreadEngineBase@QtConcurrent@@QAEXXZ @ 4864 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::startSingleThreaded(void)
- ?setPaused@QFutureWatcherBase@@QAEX_N@Z @ 4865 NONAME ; void QFutureWatcherBase::setPaused(bool)
- ?waitForResume@QFutureInterfaceBase@@QAEXXZ @ 4866 NONAME ABSENT ; void QFutureInterfaceBase::waitForResume(void)
- ?progressMinimum@QFutureInterfaceBase@@QBEHXZ @ 4867 NONAME ABSENT ; int QFutureInterfaceBase::progressMinimum(void) const
- ?hasException@ExceptionStore@internal@QtConcurrent@@QBE_NXZ @ 4868 NONAME ABSENT ; bool QtConcurrent::internal::ExceptionStore::hasException(void) const
- ?tr@QFutureWatcherBase@@SA?AVQString@@PBD0H@Z @ 4869 NONAME ; class QString QFutureWatcherBase::tr(char const *, char const *, int)
- ?resultAt@ResultStoreBase@QtConcurrent@@QBE?AVResultIteratorBase@2@H@Z @ 4870 NONAME ABSENT ; class QtConcurrent::ResultIteratorBase QtConcurrent::ResultStoreBase::resultAt(int) const
- ?connectOutputInterface@QFutureWatcherBase@@IAEXXZ @ 4871 NONAME ABSENT ; void QFutureWatcherBase::connectOutputInterface(void)
- ?insertResultItem@ResultStoreBase@QtConcurrent@@IAEHHAAVResultItem@2@@Z @ 4872 NONAME ABSENT ; int QtConcurrent::ResultStoreBase::insertResultItem(int, class QtConcurrent::ResultItem &)
- ?syncResultCount@ResultStoreBase@QtConcurrent@@IAEXXZ @ 4873 NONAME ABSENT ; void QtConcurrent::ResultStoreBase::syncResultCount(void)
- ?setProgressRange@ThreadEngineBase@QtConcurrent@@QAEXHH@Z @ 4874 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::setProgressRange(int, int)
- ??_EQFutureWatcherBase@@UAE@I@Z @ 4875 NONAME ABSENT ; QFutureWatcherBase::~QFutureWatcherBase(unsigned int)
- ?progressValueChanged@QFutureWatcherBase@@IAEXH@Z @ 4876 NONAME ; void QFutureWatcherBase::progressValueChanged(int)
- ?threadExit@ThreadEngineBase@QtConcurrent@@AAEXXZ @ 4877 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::threadExit(void)
- ?mutex@QFutureInterfaceBase@@QBEPAVQMutex@@XZ @ 4878 NONAME ABSENT ; class QMutex * QFutureInterfaceBase::mutex(void) const
- ?staticMetaObject@QFutureWatcherBase@@2UQMetaObject@@B @ 4879 NONAME ; struct QMetaObject const QFutureWatcherBase::staticMetaObject
- ?setException@ExceptionStore@internal@QtConcurrent@@QAEXABVException@3@@Z @ 4880 NONAME ABSENT ; void QtConcurrent::internal::ExceptionStore::setException(class QtConcurrent::Exception const &)
- ??0ResultIteratorBase@QtConcurrent@@QAE@XZ @ 4881 NONAME ABSENT ; QtConcurrent::ResultIteratorBase::ResultIteratorBase(void)
- ?hasNextResult@ResultStoreBase@QtConcurrent@@QBE_NXZ @ 4882 NONAME ABSENT ; bool QtConcurrent::ResultStoreBase::hasNextResult(void) const
- ??_EResultStoreBase@QtConcurrent@@UAE@I@Z @ 4883 NONAME ABSENT ; QtConcurrent::ResultStoreBase::~ResultStoreBase(unsigned int)
- ?contains@ResultStoreBase@QtConcurrent@@QBE_NH@Z @ 4884 NONAME ABSENT ; bool QtConcurrent::ResultStoreBase::contains(int) const
- ?updateInsertIndex@ResultStoreBase@QtConcurrent@@IAEHHH@Z @ 4885 NONAME ABSENT ; int QtConcurrent::ResultStoreBase::updateInsertIndex(int, int)
- ??_EException@QtConcurrent@@UAE@I@Z @ 4886 NONAME ABSENT ; QtConcurrent::Exception::~Exception(unsigned int)
- ?qt_metacall@QFutureWatcherBase@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4887 NONAME ; int QFutureWatcherBase::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?isStarted@QFutureInterfaceBase@@QBE_NXZ @ 4888 NONAME ABSENT ; bool QFutureInterfaceBase::isStarted(void) const
- ??0QFutureInterfaceBase@@QAE@ABV0@@Z @ 4889 NONAME ABSENT ; QFutureInterfaceBase::QFutureInterfaceBase(class QFutureInterfaceBase const &)
- ??_EUnhandledException@QtConcurrent@@UAE@I@Z @ 4890 NONAME ABSENT ; QtConcurrent::UnhandledException::~UnhandledException(unsigned int)
- ?progressValue@QFutureWatcherBase@@QBEHXZ @ 4891 NONAME ABSENT ; int QFutureWatcherBase::progressValue(void) const
- ??8ResultIteratorBase@QtConcurrent@@QBE_NABV01@@Z @ 4892 NONAME ABSENT ; bool QtConcurrent::ResultIteratorBase::operator==(class QtConcurrent::ResultIteratorBase const &) const
- ?tr@QFutureWatcherBase@@SA?AVQString@@PBD0@Z @ 4893 NONAME ; class QString QFutureWatcherBase::tr(char const *, char const *)
- ?startBlocking@ThreadEngineBase@QtConcurrent@@QAEXXZ @ 4894 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::startBlocking(void)
- ?threadThrottleExit@ThreadEngineBase@QtConcurrent@@AAE_NXZ @ 4895 NONAME ABSENT ; bool QtConcurrent::ThreadEngineBase::threadThrottleExit(void)
- ?isFinished@QFutureWatcherBase@@QBE_NXZ @ 4896 NONAME ABSENT ; bool QFutureWatcherBase::isFinished(void) const
- ?resultsReadyAt@QFutureWatcherBase@@IAEXHH@Z @ 4897 NONAME ; void QFutureWatcherBase::resultsReadyAt(int, int)
- ?start@ThreadEngineBase@QtConcurrent@@MAEXXZ @ 4898 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::start(void)
- ?runningAnimationCount@QUnifiedTimer@@QAEHXZ @ 4899 NONAME ; int QUnifiedTimer::runningAnimationCount(void)
- ??9ResultIteratorBase@QtConcurrent@@QBE_NABV01@@Z @ 4900 NONAME ABSENT ; bool QtConcurrent::ResultIteratorBase::operator!=(class QtConcurrent::ResultIteratorBase const &) const
- ??1UnhandledException@QtConcurrent@@UAE@XZ @ 4901 NONAME ABSENT ; QtConcurrent::UnhandledException::~UnhandledException(void)
- ?shouldStartThread@ThreadEngineBase@QtConcurrent@@MAE_NXZ @ 4902 NONAME ABSENT ; bool QtConcurrent::ThreadEngineBase::shouldStartThread(void)
- ?d_func@QFutureWatcherBase@@AAEPAVQFutureWatcherBasePrivate@@XZ @ 4903 NONAME ; class QFutureWatcherBasePrivate * QFutureWatcherBase::d_func(void)
- ?startThread@ThreadEngineBase@QtConcurrent@@QAEXXZ @ 4904 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::startThread(void)
- ?threadFunction@ThreadEngineBase@QtConcurrent@@MAE?AW4ThreadFunctionResult@2@XZ @ 4905 NONAME ABSENT ; enum QtConcurrent::ThreadFunctionResult QtConcurrent::ThreadEngineBase::threadFunction(void)
- ?count@ResultStoreBase@QtConcurrent@@QBEHXZ @ 4906 NONAME ABSENT ; int QtConcurrent::ResultStoreBase::count(void) const
- ?isThrottled@QFutureInterfaceBase@@QBE_NXZ @ 4907 NONAME ABSENT ; bool QFutureInterfaceBase::isThrottled(void) const
- ?waitForResume@ThreadEngineBase@QtConcurrent@@QAEXXZ @ 4908 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::waitForResume(void)
- ?progressMinimum@QFutureWatcherBase@@QBEHXZ @ 4909 NONAME ABSENT ; int QFutureWatcherBase::progressMinimum(void) const
- ??1ThreadEngineBase@QtConcurrent@@UAE@XZ @ 4910 NONAME ABSENT ; QtConcurrent::ThreadEngineBase::~ThreadEngineBase(void)
- ?finished@QFutureWatcherBase@@IAEXXZ @ 4911 NONAME ; void QFutureWatcherBase::finished(void)
- ?progressMaximum@QFutureInterfaceBase@@QBEHXZ @ 4912 NONAME ABSENT ; int QFutureInterfaceBase::progressMaximum(void) const
- ?pause@QFutureWatcherBase@@QAEXXZ @ 4913 NONAME ; void QFutureWatcherBase::pause(void)
- ?isProgressReportingEnabled@ThreadEngineBase@QtConcurrent@@QAE_NXZ @ 4914 NONAME ABSENT ; bool QtConcurrent::ThreadEngineBase::isProgressReportingEnabled(void)
- ?blockSizeMaxed@BlockSizeManager@QtConcurrent@@AAE_NXZ @ 4915 NONAME ABSENT ; bool QtConcurrent::BlockSizeManager::blockSizeMaxed(void)
- ?isCanceled@QFutureInterfaceBase@@QBE_NXZ @ 4916 NONAME ABSENT ; bool QFutureInterfaceBase::isCanceled(void) const
- ?cancel@QFutureInterfaceBase@@QAEXXZ @ 4917 NONAME ABSENT ; void QFutureInterfaceBase::cancel(void)
- ?setFilterMode@QFutureInterfaceBase@@QAEX_N@Z @ 4918 NONAME ABSENT ; void QFutureInterfaceBase::setFilterMode(bool)
- ?setProgressValueAndText@QFutureInterfaceBase@@QAEXHABVQString@@@Z @ 4919 NONAME ABSENT ; void QFutureInterfaceBase::setProgressValueAndText(int, class QString const &)
- ?setRunnable@QFutureInterfaceBase@@QAEXPAVQRunnable@@@Z @ 4920 NONAME ABSENT ; void QFutureInterfaceBase::setRunnable(class QRunnable *)
- ?trUtf8@QFutureWatcherBase@@SA?AVQString@@PBD0H@Z @ 4921 NONAME ; class QString QFutureWatcherBase::trUtf8(char const *, char const *, int)
- ?paused@QFutureWatcherBase@@IAEXXZ @ 4922 NONAME ; void QFutureWatcherBase::paused(void)
- ?disconnectOutputInterface@QFutureWatcherBase@@IAEX_N@Z @ 4923 NONAME ABSENT ; void QFutureWatcherBase::disconnectOutputInterface(bool)
- ?isCanceled@QFutureWatcherBase@@QBE_NXZ @ 4924 NONAME ABSENT ; bool QFutureWatcherBase::isCanceled(void) const
- ?expectedResultCount@QFutureInterfaceBase@@QAEHXZ @ 4925 NONAME ABSENT ; int QFutureInterfaceBase::expectedResultCount(void)
- ??_EQFutureInterfaceBase@@UAE@I@Z @ 4926 NONAME ABSENT ; QFutureInterfaceBase::~QFutureInterfaceBase(unsigned int)
- ?waitForResult@QFutureInterfaceBase@@QAEXH@Z @ 4927 NONAME ABSENT ; void QFutureInterfaceBase::waitForResult(int)
- ?d_func@QFutureWatcherBase@@ABEPBVQFutureWatcherBasePrivate@@XZ @ 4928 NONAME ; class QFutureWatcherBasePrivate const * QFutureWatcherBase::d_func(void) const
- ?setPaused@QFutureInterfaceBase@@QAEX_N@Z @ 4929 NONAME ABSENT ; void QFutureInterfaceBase::setPaused(bool)
- ??_EThreadEngineBase@QtConcurrent@@UAE@I@Z @ 4930 NONAME ABSENT ; QtConcurrent::ThreadEngineBase::~ThreadEngineBase(unsigned int)
- ??0Exception@QtConcurrent@@QAE@ABV01@@Z @ 4931 NONAME ABSENT ; QtConcurrent::Exception::Exception(class QtConcurrent::Exception const &)
- ?referenceCountIsOne@QFutureInterfaceBase@@IBE_NXZ @ 4932 NONAME ABSENT ; bool QFutureInterfaceBase::referenceCountIsOne(void) const
- ?progressText@QFutureInterfaceBase@@QBE?AVQString@@XZ @ 4933 NONAME ABSENT ; class QString QFutureInterfaceBase::progressText(void) const
- ?startThreadInternal@ThreadEngineBase@QtConcurrent@@AAE_NXZ @ 4934 NONAME ABSENT ; bool QtConcurrent::ThreadEngineBase::startThreadInternal(void)
- ?addResult@ResultStoreBase@QtConcurrent@@QAEHHPBX@Z @ 4935 NONAME ABSENT ; int QtConcurrent::ResultStoreBase::addResult(int, void const *)
- ?waitForFinished@QFutureWatcherBase@@QAEXXZ @ 4936 NONAME ABSENT ; void QFutureWatcherBase::waitForFinished(void)
- ?togglePaused@QFutureInterfaceBase@@QAEXXZ @ 4937 NONAME ABSENT ; void QFutureInterfaceBase::togglePaused(void)
- ?isProgressUpdateNeeded@QFutureInterfaceBase@@QBE_NXZ @ 4938 NONAME ABSENT ; bool QFutureInterfaceBase::isProgressUpdateNeeded(void) const
- ?resultReadyAt@QFutureWatcherBase@@IAEXH@Z @ 4939 NONAME ; void QFutureWatcherBase::resultReadyAt(int)
- ?waitForNextResult@QFutureInterfaceBase@@QAE_NXZ @ 4940 NONAME ABSENT ; bool QFutureInterfaceBase::waitForNextResult(void)
- ?raise@UnhandledException@QtConcurrent@@UBEXXZ @ 4941 NONAME ABSENT ; void QtConcurrent::UnhandledException::raise(void) const
- ?setProgressValue@QFutureInterfaceBase@@QAEXH@Z @ 4942 NONAME ABSENT ; void QFutureInterfaceBase::setProgressValue(int)
- ?startThreads@ThreadEngineBase@QtConcurrent@@AAEXXZ @ 4943 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::startThreads(void)
- ?isPaused@QFutureInterfaceBase@@QBE_NXZ @ 4944 NONAME ABSENT ; bool QFutureInterfaceBase::isPaused(void) const
- ?resultStoreBase@QFutureInterfaceBase@@QAEAAVResultStoreBase@QtConcurrent@@XZ @ 4945 NONAME ABSENT ; class QtConcurrent::ResultStoreBase & QFutureInterfaceBase::resultStoreBase(void)
- ?isRunning@QFutureInterfaceBase@@QBE_NXZ @ 4946 NONAME ABSENT ; bool QFutureInterfaceBase::isRunning(void) const
- ?begin@ResultStoreBase@QtConcurrent@@QBE?AVResultIteratorBase@2@XZ @ 4947 NONAME ABSENT ; class QtConcurrent::ResultIteratorBase QtConcurrent::ResultStoreBase::begin(void) const
- ?resultStoreBase@QFutureInterfaceBase@@QBEABVResultStoreBase@QtConcurrent@@XZ @ 4948 NONAME ABSENT ; class QtConcurrent::ResultStoreBase const & QFutureInterfaceBase::resultStoreBase(void) const
- ?setExpectedResultCount@QFutureInterfaceBase@@QAEXH@Z @ 4949 NONAME ABSENT ; void QFutureInterfaceBase::setExpectedResultCount(int)
- ?progressMaximum@QFutureWatcherBase@@QBEHXZ @ 4950 NONAME ABSENT ; int QFutureWatcherBase::progressMaximum(void) const
- ??0ResultStoreBase@QtConcurrent@@QAE@XZ @ 4951 NONAME ABSENT ; QtConcurrent::ResultStoreBase::ResultStoreBase(void)
- ?setProgressRange@QFutureInterfaceBase@@QAEXHH@Z @ 4952 NONAME ABSENT ; void QFutureInterfaceBase::setProgressRange(int, int)
- ?canIncrementVectorIndex@ResultIteratorBase@QtConcurrent@@QBE_NXZ @ 4953 NONAME ABSENT ; bool QtConcurrent::ResultIteratorBase::canIncrementVectorIndex(void) const
- ?progressValue@QFutureInterfaceBase@@QBEHXZ @ 4954 NONAME ABSENT ; int QFutureInterfaceBase::progressValue(void) const
- ?cancel@QFutureWatcherBase@@QAEXXZ @ 4955 NONAME ; void QFutureWatcherBase::cancel(void)
- ?trolltechConf@QCoreApplicationPrivate@@SAPAVQSettings@@XZ @ 4956 NONAME ; class QSettings * QCoreApplicationPrivate::trolltechConf(void)
- ?trUtf8@QFutureWatcherBase@@SA?AVQString@@PBD0@Z @ 4957 NONAME ; class QString QFutureWatcherBase::trUtf8(char const *, char const *)
- ?getStaticMetaObject@QFutureWatcherBase@@SAABUQMetaObject@@XZ @ 4958 NONAME ; struct QMetaObject const & QFutureWatcherBase::getStaticMetaObject(void)
- ?vectorIndex@ResultIteratorBase@QtConcurrent@@QBEHXZ @ 4959 NONAME ABSENT ; int QtConcurrent::ResultIteratorBase::vectorIndex(void) const
- ?syncPendingResults@ResultStoreBase@QtConcurrent@@IAEXXZ @ 4960 NONAME ABSENT ; void QtConcurrent::ResultStoreBase::syncPendingResults(void)
- ?progressText@QFutureWatcherBase@@QBE?AVQString@@XZ @ 4961 NONAME ABSENT ; class QString QFutureWatcherBase::progressText(void) const
- ??1QFutureWatcherBase@@UAE@XZ @ 4962 NONAME ABSENT ; QFutureWatcherBase::~QFutureWatcherBase(void)
- ?togglePaused@QFutureWatcherBase@@QAEXXZ @ 4963 NONAME ; void QFutureWatcherBase::togglePaused(void)
- ?acquireBarrierSemaphore@ThreadEngineBase@QtConcurrent@@QAEXXZ @ 4964 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::acquireBarrierSemaphore(void)
- ?setFilterMode@ResultStoreBase@QtConcurrent@@QAEX_N@Z @ 4965 NONAME ABSENT ; void QtConcurrent::ResultStoreBase::setFilterMode(bool)
- ?disconnectNotify@QFutureWatcherBase@@MAEXPBD@Z @ 4966 NONAME ABSENT ; void QFutureWatcherBase::disconnectNotify(char const *)
- ?handleException@ThreadEngineBase@QtConcurrent@@AAEXABVException@2@@Z @ 4967 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::handleException(class QtConcurrent::Exception const &)
- ?setThrottled@QFutureInterfaceBase@@QAEX_N@Z @ 4968 NONAME ABSENT ; void QFutureInterfaceBase::setThrottled(bool)
- ?setProgressValue@ThreadEngineBase@QtConcurrent@@QAEXH@Z @ 4969 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::setProgressValue(int)
- ??4QFutureInterfaceBase@@QAEAAV0@ABV0@@Z @ 4970 NONAME ABSENT ; class QFutureInterfaceBase & QFutureInterfaceBase::operator=(class QFutureInterfaceBase const &)
- ?isFinished@QFutureInterfaceBase@@QBE_NXZ @ 4971 NONAME ABSENT ; bool QFutureInterfaceBase::isFinished(void) const
- ?progressRangeChanged@QFutureWatcherBase@@IAEXHH@Z @ 4972 NONAME ; void QFutureWatcherBase::progressRangeChanged(int, int)
- ?finish@ThreadEngineBase@QtConcurrent@@MAEXXZ @ 4973 NONAME ABSENT ; void QtConcurrent::ThreadEngineBase::finish(void)
- ?isRunning@QFutureWatcherBase@@QBE_NXZ @ 4974 NONAME ABSENT ; bool QFutureWatcherBase::isRunning(void) const
- ?reportResultsReady@QFutureInterfaceBase@@QAEXHH@Z @ 4975 NONAME ABSENT ; void QFutureInterfaceBase::reportResultsReady(int, int)
- ?qt_static_metacall@QFutureWatcherBase@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 4976 NONAME ; void QFutureWatcherBase::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?blockSize@BlockSizeManager@QtConcurrent@@QAEHXZ @ 4977 NONAME ABSENT ; int QtConcurrent::BlockSizeManager::blockSize(void)
- ??0BlockSizeManager@QtConcurrent@@QAE@H@Z @ 4978 NONAME ABSENT ; QtConcurrent::BlockSizeManager::BlockSizeManager(int)
- ?batchSize@ResultIteratorBase@QtConcurrent@@QBEHXZ @ 4979 NONAME ABSENT ; int QtConcurrent::ResultIteratorBase::batchSize(void) const
- ?started@QFutureWatcherBase@@IAEXXZ @ 4980 NONAME ; void QFutureWatcherBase::started(void)
- ?metaObject@QFutureWatcherBase@@UBEPBUQMetaObject@@XZ @ 4981 NONAME ; struct QMetaObject const * QFutureWatcherBase::metaObject(void) const
- ?resumed@QFutureWatcherBase@@IAEXXZ @ 4982 NONAME ; void QFutureWatcherBase::resumed(void)
- ??0UnhandledException@QtConcurrent@@QAE@ABV01@@Z @ 4983 NONAME ABSENT ; QtConcurrent::UnhandledException::UnhandledException(class QtConcurrent::UnhandledException const &)
- ?timeBeforeUser@BlockSizeManager@QtConcurrent@@QAEXXZ @ 4984 NONAME ABSENT ; void QtConcurrent::BlockSizeManager::timeBeforeUser(void)
- ??EResultIteratorBase@QtConcurrent@@QAE?AV01@XZ @ 4985 NONAME ABSENT ; class QtConcurrent::ResultIteratorBase QtConcurrent::ResultIteratorBase::operator++(void)
- ?isResultReadyAt@QFutureInterfaceBase@@QBE_NH@Z @ 4986 NONAME ABSENT ; bool QFutureInterfaceBase::isResultReadyAt(int) const
- ?throwPossibleException@ExceptionStore@internal@QtConcurrent@@QAEXXZ @ 4987 NONAME ABSENT ; void QtConcurrent::internal::ExceptionStore::throwPossibleException(void)
- ?setPendingResultsLimit@QFutureWatcherBase@@QAEXH@Z @ 4988 NONAME ABSENT ; void QFutureWatcherBase::setPendingResultsLimit(int)
- ?resultCount@QFutureInterfaceBase@@QBEHXZ @ 4989 NONAME ABSENT ; int QFutureInterfaceBase::resultCount(void) const
- ?event@QFutureWatcherBase@@UAE_NPAVQEvent@@@Z @ 4990 NONAME ABSENT ; bool QFutureWatcherBase::event(class QEvent *)
- ?isPaused@QFutureWatcherBase@@QBE_NXZ @ 4991 NONAME ABSENT ; bool QFutureWatcherBase::isPaused(void) const
- ?clone@Exception@QtConcurrent@@UBEPAV12@XZ @ 4992 NONAME ABSENT ; class QtConcurrent::Exception * QtConcurrent::Exception::clone(void) const
- ?insertResultItemIfValid@ResultStoreBase@QtConcurrent@@IAEXHAAVResultItem@2@@Z @ 4993 NONAME ABSENT ; void QtConcurrent::ResultStoreBase::insertResultItemIfValid(int, class QtConcurrent::ResultItem &)
- ?reportException@QFutureInterfaceBase@@QAEXABVException@QtConcurrent@@@Z @ 4994 NONAME ABSENT ; void QFutureInterfaceBase::reportException(class QtConcurrent::Exception const &)
- ?waitForFinished@QFutureInterfaceBase@@QAEXXZ @ 4995 NONAME ABSENT ; void QFutureInterfaceBase::waitForFinished(void)
- ??0ResultIteratorBase@QtConcurrent@@QAE@Vconst_iterator@?$QMap@HVResultItem@QtConcurrent@@@@H@Z @ 4996 NONAME ABSENT ; QtConcurrent::ResultIteratorBase::ResultIteratorBase(class QMap<int, class QtConcurrent::ResultItem>::const_iterator, int)
- ?reportStarted@QFutureInterfaceBase@@QAEXXZ @ 4997 NONAME ABSENT ; void QFutureInterfaceBase::reportStarted(void)
- ??8QFutureInterfaceBase@@QBE_NABV0@@Z @ 4998 NONAME ABSENT ; bool QFutureInterfaceBase::operator==(class QFutureInterfaceBase const &) const
- ?addResults@ResultStoreBase@QtConcurrent@@QAEHHPBXHH@Z @ 4999 NONAME ABSENT ; int QtConcurrent::ResultStoreBase::addResults(int, void const *, int, int)
- ?shouldThrottleThread@ThreadEngineBase@QtConcurrent@@MAE_NXZ @ 5000 NONAME ABSENT ; bool QtConcurrent::ThreadEngineBase::shouldThrottleThread(void)
- ?reportFinished@QFutureInterfaceBase@@QAEXXZ @ 5001 NONAME ABSENT ; void QFutureInterfaceBase::reportFinished(void)
- ??0ThreadEngineBase@QtConcurrent@@QAE@XZ @ 5002 NONAME ABSENT ; QtConcurrent::ThreadEngineBase::ThreadEngineBase(void)
- ??1Exception@QtConcurrent@@UAE@XZ @ 5003 NONAME ABSENT ; QtConcurrent::Exception::~Exception(void)
- ?filterMode@ResultStoreBase@QtConcurrent@@QBE_NXZ @ 5004 NONAME ABSENT ; bool QtConcurrent::ResultStoreBase::filterMode(void) const
- ?raise@Exception@QtConcurrent@@UBEXXZ @ 5005 NONAME ABSENT ; void QtConcurrent::Exception::raise(void) const
- ?batchedAdvance@ResultIteratorBase@QtConcurrent@@QAEXXZ @ 5006 NONAME ABSENT ; void QtConcurrent::ResultIteratorBase::batchedAdvance(void)
- ?exceptionStore@QFutureInterfaceBase@@QAEAAVExceptionStore@internal@QtConcurrent@@XZ @ 5007 NONAME ABSENT ; class QtConcurrent::internal::ExceptionStore & QFutureInterfaceBase::exceptionStore(void)
- ?reportCanceled@QFutureInterfaceBase@@QAEXXZ @ 5008 NONAME ABSENT ; void QFutureInterfaceBase::reportCanceled(void)
- ?connectNotify@QFutureWatcherBase@@MAEXPBD@Z @ 5009 NONAME ABSENT ; void QFutureWatcherBase::connectNotify(char const *)
- ??1ResultStoreBase@QtConcurrent@@UAE@XZ @ 5010 NONAME ABSENT ; QtConcurrent::ResultStoreBase::~ResultStoreBase(void)
- ?isCanceled@ThreadEngineBase@QtConcurrent@@QAE_NXZ @ 5011 NONAME ABSENT ; bool QtConcurrent::ThreadEngineBase::isCanceled(void)
- ?canceled@QFutureWatcherBase@@IAEXXZ @ 5012 NONAME ; void QFutureWatcherBase::canceled(void)
- ?clone@UnhandledException@QtConcurrent@@UBEPAVException@2@XZ @ 5013 NONAME ABSENT ; class QtConcurrent::Exception * QtConcurrent::UnhandledException::clone(void) const
+ ?qt_static_metacall@QFutureWatcherBase@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 4846 NONAME ; void QFutureWatcherBase::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?progressValueChanged@QFutureWatcherBase@@IAEXH@Z @ 4847 NONAME ; void QFutureWatcherBase::progressValueChanged(int)
+ ?qt_metacast@QFutureWatcherBase@@UAEPAXPBD@Z @ 4848 NONAME ; void * QFutureWatcherBase::qt_metacast(char const *)
+ ?qIsEffectiveTLD@@YA_NABVQString@@@Z @ 4849 NONAME ; bool qIsEffectiveTLD(class QString const &)
+ ?tr@QFutureWatcherBase@@SA?AVQString@@PBD0@Z @ 4850 NONAME ; class QString QFutureWatcherBase::tr(char const *, char const *)
+ ?trolltechConf@QCoreApplicationPrivate@@SAPAVQSettings@@XZ @ 4851 NONAME ; class QSettings * QCoreApplicationPrivate::trolltechConf(void)
+ ?pause@QFutureWatcherBase@@QAEXXZ @ 4852 NONAME ; void QFutureWatcherBase::pause(void)
+ ?topLevelDomain@QUrl@@QBE?AVQString@@XZ @ 4853 NONAME ; class QString QUrl::topLevelDomain(void) const
+ ?togglePaused@QFutureWatcherBase@@QAEXXZ @ 4854 NONAME ; void QFutureWatcherBase::togglePaused(void)
+ ?toRfc4122@QUuid@@QBE?AVQByteArray@@XZ @ 4855 NONAME ; class QByteArray QUuid::toRfc4122(void) const
+ ?progressRangeChanged@QFutureWatcherBase@@IAEXHH@Z @ 4856 NONAME ; void QFutureWatcherBase::progressRangeChanged(int, int)
+ ?cancel@QFutureWatcherBase@@QAEXXZ @ 4857 NONAME ; void QFutureWatcherBase::cancel(void)
+ ?tr@QFutureWatcherBase@@SA?AVQString@@PBD0H@Z @ 4858 NONAME ; class QString QFutureWatcherBase::tr(char const *, char const *, int)
+ ?toByteArray@QUuid@@QBE?AVQByteArray@@XZ @ 4859 NONAME ; class QByteArray QUuid::toByteArray(void) const
+ ?runningAnimationCount@QUnifiedTimer@@QAEHXZ @ 4860 NONAME ; int QUnifiedTimer::runningAnimationCount(void)
+ ?getStaticMetaObject@QFutureWatcherBase@@SAABUQMetaObject@@XZ @ 4861 NONAME ; struct QMetaObject const & QFutureWatcherBase::getStaticMetaObject(void)
+ ?trUtf8@QFutureWatcherBase@@SA?AVQString@@PBD0H@Z @ 4862 NONAME ; class QString QFutureWatcherBase::trUtf8(char const *, char const *, int)
+ ?staticMetaObjectExtraData@QFutureWatcherBase@@0UQMetaObjectExtraData@@B @ 4863 NONAME ; struct QMetaObjectExtraData const QFutureWatcherBase::staticMetaObjectExtraData
+ ?qt_metacall@QFutureWatcherBase@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4864 NONAME ; int QFutureWatcherBase::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?resumed@QFutureWatcherBase@@IAEXXZ @ 4865 NONAME ; void QFutureWatcherBase::resumed(void)
+ ?setPaused@QFutureWatcherBase@@QAEX_N@Z @ 4866 NONAME ; void QFutureWatcherBase::setPaused(bool)
+ ?canceled@QFutureWatcherBase@@IAEXXZ @ 4867 NONAME ; void QFutureWatcherBase::canceled(void)
+ ?progressTextChanged@QFutureWatcherBase@@IAEXABVQString@@@Z @ 4868 NONAME ; void QFutureWatcherBase::progressTextChanged(class QString const &)
+ ?fromRfc4122@QUuid@@SA?AU1@ABVQByteArray@@@Z @ 4869 NONAME ; struct QUuid QUuid::fromRfc4122(class QByteArray const &)
+ ?staticMetaObject@QFutureWatcherBase@@2UQMetaObject@@B @ 4870 NONAME ; struct QMetaObject const QFutureWatcherBase::staticMetaObject
+ ?trUtf8@QFutureWatcherBase@@SA?AVQString@@PBD0@Z @ 4871 NONAME ; class QString QFutureWatcherBase::trUtf8(char const *, char const *)
+ ?d_func@QFutureWatcherBase@@ABEPBVQFutureWatcherBasePrivate@@XZ @ 4872 NONAME ; class QFutureWatcherBasePrivate const * QFutureWatcherBase::d_func(void) const
+ ?metaObject@QFutureWatcherBase@@UBEPBUQMetaObject@@XZ @ 4873 NONAME ; struct QMetaObject const * QFutureWatcherBase::metaObject(void) const
+ ?d_func@QFutureWatcherBase@@AAEPAVQFutureWatcherBasePrivate@@XZ @ 4874 NONAME ; class QFutureWatcherBasePrivate * QFutureWatcherBase::d_func(void)
+ ?qTopLevelDomain@@YA?AVQString@@ABV1@@Z @ 4875 NONAME ; class QString qTopLevelDomain(class QString const &)
+ ??0QUuid@@QAE@ABVQByteArray@@@Z @ 4876 NONAME ; QUuid::QUuid(class QByteArray const &)
+ ?resultReadyAt@QFutureWatcherBase@@IAEXH@Z @ 4877 NONAME ; void QFutureWatcherBase::resultReadyAt(int)
+ ?paused@QFutureWatcherBase@@IAEXXZ @ 4878 NONAME ; void QFutureWatcherBase::paused(void)
+ ?finished@QFutureWatcherBase@@IAEXXZ @ 4879 NONAME ; void QFutureWatcherBase::finished(void)
+ ?resume@QFutureWatcherBase@@QAEXXZ @ 4880 NONAME ; void QFutureWatcherBase::resume(void)
+ ?resultsReadyAt@QFutureWatcherBase@@IAEXHH@Z @ 4881 NONAME ; void QFutureWatcherBase::resultsReadyAt(int, int)
+ ?started@QFutureWatcherBase@@IAEXXZ @ 4882 NONAME ; void QFutureWatcherBase::started(void)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 8206a76249..a976e3f76e 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -1923,34 +1923,35 @@ EXPORTS
?staticMetaObjectExtraData@QDeclarativeStateGroup@@0UQMetaObjectExtraData@@B @ 1922 NONAME ; struct QMetaObjectExtraData const QDeclarativeStateGroup::staticMetaObjectExtraData
?staticMetaObjectExtraData@QDeclarativeView@@0UQMetaObjectExtraData@@B @ 1923 NONAME ; struct QMetaObjectExtraData const QDeclarativeView::staticMetaObjectExtraData
?qt_static_metacall@QDeclarativeEngine@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1924 NONAME ; void QDeclarativeEngine::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QDeclarativeDebuggingEnabler@@QAE@XZ @ 1925 NONAME ; QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler(void)
- ?removeView@QDeclarativeObserverService@@QAEXPAVQDeclarativeView@@@Z @ 1926 NONAME ; void QDeclarativeObserverService::removeView(class QDeclarativeView *)
- ??_EQDeclarativeObserverService@@UAE@I@Z @ 1927 NONAME ; QDeclarativeObserverService::~QDeclarativeObserverService(unsigned int)
- ?sendMessage@QDeclarativeObserverService@@QAEXABVQByteArray@@@Z @ 1928 NONAME ; void QDeclarativeObserverService::sendMessage(class QByteArray const &)
- ?instance@QDeclarativeObserverService@@SAPAV1@XZ @ 1929 NONAME ; class QDeclarativeObserverService * QDeclarativeObserverService::instance(void)
- ?trUtf8@QDeclarativeObserverService@@SA?AVQString@@PBD0@Z @ 1930 NONAME ; class QString QDeclarativeObserverService::trUtf8(char const *, char const *)
- ?messageReceived@QDeclarativeObserverService@@MAEXABVQByteArray@@@Z @ 1931 NONAME ; void QDeclarativeObserverService::messageReceived(class QByteArray const &)
- ?views@QDeclarativeObserverService@@QBE?AV?$QList@PAVQDeclarativeView@@@@XZ @ 1932 NONAME ; class QList<class QDeclarativeView *> QDeclarativeObserverService::views(void) const
+ ?instance@QDeclarativeInspectorService@@SAPAV1@XZ @ 1925 NONAME ; class QDeclarativeInspectorService * QDeclarativeInspectorService::instance(void)
+ ??_EQDeclarativeInspectorInterface@@UAE@I@Z @ 1926 NONAME ; QDeclarativeInspectorInterface::~QDeclarativeInspectorInterface(unsigned int)
+ ?qt_static_metacall@QDeclarativeInspectorService@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1927 NONAME ; void QDeclarativeInspectorService::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?flushCache@QDeclarativePixmap@@SAXXZ @ 1928 NONAME ; void QDeclarativePixmap::flushCache(void)
+ ??0QDeclarativeDebuggingEnabler@@QAE@XZ @ 1929 NONAME ; QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler(void)
+ ?addView@QDeclarativeInspectorService@@QAEXPAVQDeclarativeView@@@Z @ 1930 NONAME ; void QDeclarativeInspectorService::addView(class QDeclarativeView *)
+ ?tr@QDeclarativeInspectorService@@SA?AVQString@@PBD0@Z @ 1931 NONAME ; class QString QDeclarativeInspectorService::tr(char const *, char const *)
+ ?statusChanged@QDeclarativeInspectorService@@MAEXW4Status@QDeclarativeDebugService@@@Z @ 1932 NONAME ; void QDeclarativeInspectorService::statusChanged(enum QDeclarativeDebugService::Status)
?waitForReadyRead@QPacketProtocol@@QAE_NH@Z @ 1933 NONAME ; bool QPacketProtocol::waitForReadyRead(int)
?waitForMessage@QDeclarativeDebugService@@QAE_NXZ @ 1934 NONAME ; bool QDeclarativeDebugService::waitForMessage(void)
- ?tr@QDeclarativeObserverService@@SA?AVQString@@PBD0@Z @ 1935 NONAME ; class QString QDeclarativeObserverService::tr(char const *, char const *)
- ?tr@QDeclarativeObserverService@@SA?AVQString@@PBD0H@Z @ 1936 NONAME ; class QString QDeclarativeObserverService::tr(char const *, char const *, int)
- ?qt_static_metacall@QDeclarativeObserverService@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1937 NONAME ; void QDeclarativeObserverService::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDeclarativeObserverService@@0UQMetaObjectExtraData@@B @ 1938 NONAME ; struct QMetaObjectExtraData const QDeclarativeObserverService::staticMetaObjectExtraData
- ?waitForMessage@QDeclarativeDebugServer@@QAE_NPAVQDeclarativeDebugService@@@Z @ 1939 NONAME ; bool QDeclarativeDebugServer::waitForMessage(class QDeclarativeDebugService *)
- ??1QDeclarativeObserverService@@UAE@XZ @ 1940 NONAME ; QDeclarativeObserverService::~QDeclarativeObserverService(void)
- ?qt_metacast@QDeclarativeObserverService@@UAEPAXPBD@Z @ 1941 NONAME ; void * QDeclarativeObserverService::qt_metacast(char const *)
- ??_EQDeclarativeObserverInterface@@UAE@I@Z @ 1942 NONAME ; QDeclarativeObserverInterface::~QDeclarativeObserverInterface(unsigned int)
- ?qt_metacall@QDeclarativeObserverService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1943 NONAME ; int QDeclarativeObserverService::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?staticMetaObject@QDeclarativeObserverService@@2UQMetaObject@@B @ 1944 NONAME ; struct QMetaObject const QDeclarativeObserverService::staticMetaObject
- ?addView@QDeclarativeObserverService@@QAEXPAVQDeclarativeView@@@Z @ 1945 NONAME ; void QDeclarativeObserverService::addView(class QDeclarativeView *)
- ?trUtf8@QDeclarativeObserverService@@SA?AVQString@@PBD0H@Z @ 1946 NONAME ; class QString QDeclarativeObserverService::trUtf8(char const *, char const *, int)
- ??0QDeclarativeObserverService@@QAE@XZ @ 1947 NONAME ; QDeclarativeObserverService::QDeclarativeObserverService(void)
- ?loadObserverPlugin@QDeclarativeObserverService@@CAPAVQDeclarativeObserverInterface@@XZ @ 1948 NONAME ; class QDeclarativeObserverInterface * QDeclarativeObserverService::loadObserverPlugin(void)
- ??1QDeclarativeObserverInterface@@UAE@XZ @ 1949 NONAME ; QDeclarativeObserverInterface::~QDeclarativeObserverInterface(void)
- ?statusChanged@QDeclarativeObserverService@@MAEXW4Status@QDeclarativeDebugService@@@Z @ 1950 NONAME ; void QDeclarativeObserverService::statusChanged(enum QDeclarativeDebugService::Status)
- ?getStaticMetaObject@QDeclarativeObserverService@@SAABUQMetaObject@@XZ @ 1951 NONAME ; struct QMetaObject const & QDeclarativeObserverService::getStaticMetaObject(void)
- ??0QDeclarativeObserverInterface@@QAE@XZ @ 1952 NONAME ; QDeclarativeObserverInterface::QDeclarativeObserverInterface(void)
- ?gotMessage@QDeclarativeObserverService@@IAEXABVQByteArray@@@Z @ 1953 NONAME ; void QDeclarativeObserverService::gotMessage(class QByteArray const &)
- ?metaObject@QDeclarativeObserverService@@UBEPBUQMetaObject@@XZ @ 1954 NONAME ; struct QMetaObject const * QDeclarativeObserverService::metaObject(void) const
+ ?staticMetaObject@QDeclarativeInspectorService@@2UQMetaObject@@B @ 1935 NONAME ; struct QMetaObject const QDeclarativeInspectorService::staticMetaObject
+ ?qt_metacast@QDeclarativeInspectorService@@UAEPAXPBD@Z @ 1936 NONAME ; void * QDeclarativeInspectorService::qt_metacast(char const *)
+ ?waitForMessage@QDeclarativeDebugServer@@QAE_NPAVQDeclarativeDebugService@@@Z @ 1937 NONAME ; bool QDeclarativeDebugServer::waitForMessage(class QDeclarativeDebugService *)
+ ?sendMessage@QDeclarativeInspectorService@@QAEXABVQByteArray@@@Z @ 1938 NONAME ; void QDeclarativeInspectorService::sendMessage(class QByteArray const &)
+ ??_EQDeclarativeInspectorService@@UAE@I@Z @ 1939 NONAME ; QDeclarativeInspectorService::~QDeclarativeInspectorService(unsigned int)
+ ??1QDeclarativeInspectorService@@UAE@XZ @ 1940 NONAME ; QDeclarativeInspectorService::~QDeclarativeInspectorService(void)
+ ?gotMessage@QDeclarativeInspectorService@@IAEXABVQByteArray@@@Z @ 1941 NONAME ; void QDeclarativeInspectorService::gotMessage(class QByteArray const &)
+ ?loadInspectorPlugin@QDeclarativeInspectorService@@CAPAVQDeclarativeInspectorInterface@@XZ @ 1942 NONAME ; class QDeclarativeInspectorInterface * QDeclarativeInspectorService::loadInspectorPlugin(void)
+ ?removeView@QDeclarativeInspectorService@@QAEXPAVQDeclarativeView@@@Z @ 1943 NONAME ; void QDeclarativeInspectorService::removeView(class QDeclarativeView *)
+ ?trUtf8@QDeclarativeInspectorService@@SA?AVQString@@PBD0@Z @ 1944 NONAME ; class QString QDeclarativeInspectorService::trUtf8(char const *, char const *)
+ ?metaObject@QDeclarativeInspectorService@@UBEPBUQMetaObject@@XZ @ 1945 NONAME ; struct QMetaObject const * QDeclarativeInspectorService::metaObject(void) const
+ ?tr@QDeclarativeInspectorService@@SA?AVQString@@PBD0H@Z @ 1946 NONAME ; class QString QDeclarativeInspectorService::tr(char const *, char const *, int)
+ ?views@QDeclarativeInspectorService@@QBE?AV?$QList@PAVQDeclarativeView@@@@XZ @ 1947 NONAME ; class QList<class QDeclarativeView *> QDeclarativeInspectorService::views(void) const
+ ??0QDeclarativeInspectorService@@QAE@XZ @ 1948 NONAME ; QDeclarativeInspectorService::QDeclarativeInspectorService(void)
+ ?getStaticMetaObject@QDeclarativeInspectorService@@SAABUQMetaObject@@XZ @ 1949 NONAME ; struct QMetaObject const & QDeclarativeInspectorService::getStaticMetaObject(void)
+ ?staticMetaObjectExtraData@QDeclarativeInspectorService@@0UQMetaObjectExtraData@@B @ 1950 NONAME ; struct QMetaObjectExtraData const QDeclarativeInspectorService::staticMetaObjectExtraData
+ ??0QDeclarativeInspectorInterface@@QAE@XZ @ 1951 NONAME ; QDeclarativeInspectorInterface::QDeclarativeInspectorInterface(void)
+ ?messageReceived@QDeclarativeInspectorService@@MAEXABVQByteArray@@@Z @ 1952 NONAME ; void QDeclarativeInspectorService::messageReceived(class QByteArray const &)
+ ?trUtf8@QDeclarativeInspectorService@@SA?AVQString@@PBD0H@Z @ 1953 NONAME ; class QString QDeclarativeInspectorService::trUtf8(char const *, char const *, int)
+ ??1QDeclarativeInspectorInterface@@UAE@XZ @ 1954 NONAME ; QDeclarativeInspectorInterface::~QDeclarativeInspectorInterface(void)
+ ?qt_metacall@QDeclarativeInspectorService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1955 NONAME ; int QDeclarativeInspectorService::qt_metacall(enum QMetaObject::Call, int, void * *)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 7468b854bb..90bef7b641 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12902,7 +12902,7 @@ EXPORTS
??0QStaticTextItem@@QAE@ABV0@@Z @ 12901 NONAME ; QStaticTextItem::QStaticTextItem(class QStaticTextItem const &)
??4QStaticTextItem@@QAEXABV0@@Z @ 12902 NONAME ; void QStaticTextItem::operator=(class QStaticTextItem const &)
?fontEngine@QStaticTextItem@@QBEPAVQFontEngine@@XZ @ 12903 NONAME ; class QFontEngine * QStaticTextItem::fontEngine(void) const
- ?reactivateDeferredActiveObjects@QEventDispatcherS60@@UAEXXZ @ 12904 NONAME ; void QEventDispatcherS60::reactivateDeferredActiveObjects(void)
+ ?reactivateDeferredActiveObjects@QEventDispatcherS60@@UAEXXZ @ 12904 NONAME ABSENT ; void QEventDispatcherS60::reactivateDeferredActiveObjects(void)
?userData@QStaticTextItem@@QBEPAVQStaticTextUserData@@XZ @ 12905 NONAME ; class QStaticTextUserData * QStaticTextItem::userData(void) const
?populate@QTextureGlyphCache@@QAE_NPAVQFontEngine@@HPBIPBUQFixedPoint@@@Z @ 12906 NONAME ; bool QTextureGlyphCache::populate(class QFontEngine *, int, unsigned int const *, struct QFixedPoint const *)
?resetCursorBlinkTimer@QLineControl@@QAEXXZ @ 12907 NONAME ; void QLineControl::resetCursorBlinkTimer(void)
@@ -13201,602 +13201,845 @@ EXPORTS
png_write_sig @ 13200 NONAME
?clipEnabledChanged@QBlitterPaintEngine@@UAEXXZ @ 13201 NONAME ; void QBlitterPaintEngine::clipEnabledChanged(void)
?supportsSubPixelPositions@QFontEngine@@UBE_NXZ @ 13202 NONAME ; bool QFontEngine::supportsSubPixelPositions(void) const
- ?qt_static_metacall@QEventDispatcherS60@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13203 NONAME ; void QEventDispatcherS60::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QStyledItemDelegate@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13204 NONAME ; void QStyledItemDelegate::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QPixmapDropShadowFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13205 NONAME ; void QPixmapDropShadowFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QS60Style@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13206 NONAME ; void QS60Style::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTableWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13207 NONAME ; void QTableWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTextBrowser@@0UQMetaObjectExtraData@@B @ 13208 NONAME ; struct QMetaObjectExtraData const QTextBrowser::staticMetaObjectExtraData
- ?qt_static_metacall@QMenuBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13209 NONAME ; void QMenuBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?exists@QZipWriter@@QBE_NXZ @ 13210 NONAME ; bool QZipWriter::exists(void) const
- ?heightForWidth@QTabWidget@@UBEHH@Z @ 13211 NONAME ; int QTabWidget::heightForWidth(int) const
- ?staticMetaObjectExtraData@QSplashScreen@@0UQMetaObjectExtraData@@B @ 13212 NONAME ; struct QMetaObjectExtraData const QSplashScreen::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsItemAnimation@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13213 NONAME ; void QGraphicsItemAnimation::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QRasterWindowSurface@@QAE@PAVQWidget@@_N@Z @ 13214 NONAME ; QRasterWindowSurface::QRasterWindowSurface(class QWidget *, bool)
- ?brushChanged@QBlitterPaintEngine@@UAEXXZ @ 13215 NONAME ; void QBlitterPaintEngine::brushChanged(void)
- ?clip@QBlitterPaintEngine@@UAEXABVQRect@@W4ClipOperation@Qt@@@Z @ 13216 NONAME ; void QBlitterPaintEngine::clip(class QRect const &, enum Qt::ClipOperation)
- ?staticMetaObjectExtraData@QGraphicsWidget@@0UQMetaObjectExtraData@@B @ 13217 NONAME ; struct QMetaObjectExtraData const QGraphicsWidget::staticMetaObjectExtraData
- ?qt_static_metacall@QSessionManager@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13218 NONAME ; void QSessionManager::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTabWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13219 NONAME ; void QTabWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTapAndHoldGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13220 NONAME ; void QTapAndHoldGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QMainWindow@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13221 NONAME ; void QMainWindow::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QMovie@@0UQMetaObjectExtraData@@B @ 13222 NONAME ; struct QMetaObjectExtraData const QMovie::staticMetaObjectExtraData
- ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13223 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *)
- ?staticMetaObjectExtraData@QPixmapConvolutionFilter@@0UQMetaObjectExtraData@@B @ 13224 NONAME ; struct QMetaObjectExtraData const QPixmapConvolutionFilter::staticMetaObjectExtraData
- ?setHintingPreference@QFont@@QAEXW4HintingPreference@1@@Z @ 13225 NONAME ; void QFont::setHintingPreference(enum QFont::HintingPreference)
- ?qt_static_metacall@QTextControl@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13226 NONAME ; void QTextControl::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QToolBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13227 NONAME ; void QToolBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QSplitter@@0UQMetaObjectExtraData@@B @ 13228 NONAME ; struct QMetaObjectExtraData const QSplitter::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsTextItem@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13229 NONAME ; void QGraphicsTextItem::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setCursorMoveStyle@QLineControl@@QAEXW4MoveStyle@QTextCursor@@@Z @ 13230 NONAME ABSENT ; void QLineControl::setCursorMoveStyle(enum QTextCursor::MoveStyle)
- ?qt_static_metacall@QGraphicsView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13231 NONAME ; void QGraphicsView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QGraphicsOpacityEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13232 NONAME ; void QGraphicsOpacityEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QGraphicsBlurEffect@@0UQMetaObjectExtraData@@B @ 13233 NONAME ; struct QMetaObjectExtraData const QGraphicsBlurEffect::staticMetaObjectExtraData
- ?capabilities@QBlittable@@QBE?AV?$QFlags@W4Capability@QBlittable@@@@XZ @ 13234 NONAME ; class QFlags<enum QBlittable::Capability> QBlittable::capabilities(void) const
- ?qt_static_metacall@QDoubleSpinBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13235 NONAME ; void QDoubleSpinBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QGraphicsObject@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13236 NONAME ; void QGraphicsObject::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QAbstractButton@@0UQMetaObjectExtraData@@B @ 13237 NONAME ; struct QMetaObjectExtraData const QAbstractButton::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGraphicsEffectSource@@0UQMetaObjectExtraData@@B @ 13238 NONAME ; struct QMetaObjectExtraData const QGraphicsEffectSource::staticMetaObjectExtraData
- ?qt_static_metacall@QAbstractItemView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13239 NONAME ; void QAbstractItemView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QPaintBufferResource@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13240 NONAME ; void QPaintBufferResource::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?swap@QBrush@@QAEXAAV1@@Z @ 13241 NONAME ; void QBrush::swap(class QBrush &)
- ?qt_static_metacall@QTextDocument@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13242 NONAME ; void QTextDocument::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?fontHintingPreference@QTextCharFormat@@QBE?AW4HintingPreference@QFont@@XZ @ 13243 NONAME ; enum QFont::HintingPreference QTextCharFormat::fontHintingPreference(void) const
- ?swap@QPixmap@@QAEXAAV1@@Z @ 13244 NONAME ; void QPixmap::swap(class QPixmap &)
- ??0QBlitterPaintEngine@@QAE@PAVQBlittablePixmapData@@@Z @ 13245 NONAME ; QBlitterPaintEngine::QBlitterPaintEngine(class QBlittablePixmapData *)
- ?staticMetaObjectExtraData@QTableView@@0UQMetaObjectExtraData@@B @ 13246 NONAME ; struct QMetaObjectExtraData const QTableView::staticMetaObjectExtraData
- ?qt_static_metacall@QAction@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13247 NONAME ; void QAction::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QPinchGesture@@0UQMetaObjectExtraData@@B @ 13248 NONAME ; struct QMetaObjectExtraData const QPinchGesture::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QIdentityProxyModel@@0UQMetaObjectExtraData@@B @ 13249 NONAME ; struct QMetaObjectExtraData const QIdentityProxyModel::staticMetaObjectExtraData
- ?numberPrefix@QTextListFormat@@QBE?AVQString@@XZ @ 13250 NONAME ; class QString QTextListFormat::numberPrefix(void) const
- ?qt_static_metacall@QPlainTextEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13251 NONAME ; void QPlainTextEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QListView@@0UQMetaObjectExtraData@@B @ 13252 NONAME ; struct QMetaObjectExtraData const QListView::staticMetaObjectExtraData
- ?qt_static_metacall@QLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13253 NONAME ; void QLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QWindowsStyle@@0UQMetaObjectExtraData@@B @ 13254 NONAME ; struct QMetaObjectExtraData const QWindowsStyle::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QMdiSubWindow@@0UQMetaObjectExtraData@@B @ 13255 NONAME ; struct QMetaObjectExtraData const QMdiSubWindow::staticMetaObjectExtraData
- ?qt_static_metacall@QClipboard@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13256 NONAME ; void QClipboard::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??MQItemSelectionRange@@QBE_NABV0@@Z @ 13257 NONAME ; bool QItemSelectionRange::operator<(class QItemSelectionRange const &) const
- ?setWidthForHeight@QSizePolicy@@QAEX_N@Z @ 13258 NONAME ; void QSizePolicy::setWidthForHeight(bool)
- ?qt_static_metacall@QGraphicsScene@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13259 NONAME ; void QGraphicsScene::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTextList@@0UQMetaObjectExtraData@@B @ 13260 NONAME ; struct QMetaObjectExtraData const QTextList::staticMetaObjectExtraData
- ?qt_fontdata_from_index@@YA?AVQByteArray@@H@Z @ 13261 NONAME ; class QByteArray qt_fontdata_from_index(int)
- ?defaultCursorMoveStyle@QTextDocument@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 13262 NONAME ABSENT ; enum QTextCursor::MoveStyle QTextDocument::defaultCursorMoveStyle(void) const
- ?offsetInLigature@QTextEngine@@QAE?AUQFixed@@PBUQScriptItem@@HHH@Z @ 13263 NONAME ; struct QFixed QTextEngine::offsetInLigature(struct QScriptItem const *, int, int, int)
- ?qt_static_metacall@QGraphicsAnchor@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13264 NONAME ; void QGraphicsAnchor::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?swap@QImage@@QAEXAAV1@@Z @ 13265 NONAME ; void QImage::swap(class QImage &)
- ?staticMetaObjectExtraData@QDockWidget@@0UQMetaObjectExtraData@@B @ 13266 NONAME ; struct QMetaObjectExtraData const QDockWidget::staticMetaObjectExtraData
- ?compositionModeChanged@QBlitterPaintEngine@@UAEXXZ @ 13267 NONAME ; void QBlitterPaintEngine::compositionModeChanged(void)
- ?staticMetaObjectExtraData@QPictureFormatPlugin@@0UQMetaObjectExtraData@@B @ 13268 NONAME ; struct QMetaObjectExtraData const QPictureFormatPlugin::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QAbstractItemView@@0UQMetaObjectExtraData@@B @ 13269 NONAME ; struct QMetaObjectExtraData const QAbstractItemView::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QValidator@@0UQMetaObjectExtraData@@B @ 13270 NONAME ; struct QMetaObjectExtraData const QValidator::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsBlurEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13271 NONAME ; void QGraphicsBlurEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDialog@@0UQMetaObjectExtraData@@B @ 13272 NONAME ; struct QMetaObjectExtraData const QDialog::staticMetaObjectExtraData
- ?qt_static_metacall@QSplitter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13273 NONAME ; void QSplitter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QLineControl@@0UQMetaObjectExtraData@@B @ 13274 NONAME ; struct QMetaObjectExtraData const QLineControl::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QProgressDialog@@0UQMetaObjectExtraData@@B @ 13275 NONAME ; struct QMetaObjectExtraData const QProgressDialog::staticMetaObjectExtraData
- ?drawRects@QBlitterPaintEngine@@UAEXPBVQRectF@@H@Z @ 13276 NONAME ; void QBlitterPaintEngine::drawRects(class QRectF const *, int)
- ?qt_static_metacall@QGridLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13277 NONAME ; void QGridLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QMenuBar@@0UQMetaObjectExtraData@@B @ 13278 NONAME ; struct QMetaObjectExtraData const QMenuBar::staticMetaObjectExtraData
- ?qt_static_metacall@QStackedLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13279 NONAME ; void QStackedLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QLineEdit@@0UQMetaObjectExtraData@@B @ 13280 NONAME ; struct QMetaObjectExtraData const QLineEdit::staticMetaObjectExtraData
- ?qt_metacall@QIdentityProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13281 NONAME ; int QIdentityProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QListWidget@@0UQMetaObjectExtraData@@B @ 13282 NONAME ; struct QMetaObjectExtraData const QListWidget::staticMetaObjectExtraData
- ??1QBlitterPaintEngine@@UAE@XZ @ 13283 NONAME ; QBlitterPaintEngine::~QBlitterPaintEngine(void)
- ?markRasterOverlay@QBlittablePixmapData@@QAEXPBVQRectF@@H@Z @ 13284 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRectF const *, int)
- ?qt_static_metacall@QTableView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13285 NONAME ; void QTableView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?mapSelectionFromSource@QIdentityProxyModel@@UBE?AVQItemSelection@@ABV2@@Z @ 13286 NONAME ; class QItemSelection QIdentityProxyModel::mapSelectionFromSource(class QItemSelection const &) const
- ?qt_static_metacall@QIdentityProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13287 NONAME ; void QIdentityProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QEventDispatcherS60@@0UQMetaObjectExtraData@@B @ 13288 NONAME ; struct QMetaObjectExtraData const QEventDispatcherS60::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QStylePlugin@@0UQMetaObjectExtraData@@B @ 13289 NONAME ; struct QMetaObjectExtraData const QStylePlugin::staticMetaObjectExtraData
- ?drawTextItem@QBlitterPaintEngine@@UAEXABVQPointF@@ABVQTextItem@@@Z @ 13290 NONAME ; void QBlitterPaintEngine::drawTextItem(class QPointF const &, class QTextItem const &)
- ?qt_static_metacall@QLabel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13291 NONAME ; void QLabel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QLayout@@0UQMetaObjectExtraData@@B @ 13292 NONAME ; struct QMetaObjectExtraData const QLayout::staticMetaObjectExtraData
- ?retrieveData@QInternalMimeData@@MBE?AVQVariant@@ABVQString@@W4Type@2@@Z @ 13293 NONAME ; class QVariant QInternalMimeData::retrieveData(class QString const &, enum QVariant::Type) const
- ?qt_static_metacall@QCheckBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13294 NONAME ; void QCheckBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDirModel@@0UQMetaObjectExtraData@@B @ 13295 NONAME ; struct QMetaObjectExtraData const QDirModel::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QFocusFrame@@0UQMetaObjectExtraData@@B @ 13296 NONAME ; struct QMetaObjectExtraData const QFocusFrame::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsScale@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13297 NONAME ; void QGraphicsScale::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13298 NONAME ; void QFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?drawImage@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQImage@@0V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 13299 NONAME ; void QBlitterPaintEngine::drawImage(class QRectF const &, class QImage const &, class QRectF const &, class QFlags<enum Qt::ImageConversionFlag>)
- ?staticMetaObjectExtraData@QDateTimeEdit@@0UQMetaObjectExtraData@@B @ 13300 NONAME ; struct QMetaObjectExtraData const QDateTimeEdit::staticMetaObjectExtraData
- ?mimeTypes@QAbstractProxyModel@@UBE?AVQStringList@@XZ @ 13301 NONAME ; class QStringList QAbstractProxyModel::mimeTypes(void) const
- ?mapSelectionToSource@QIdentityProxyModel@@UBE?AVQItemSelection@@ABV2@@Z @ 13302 NONAME ; class QItemSelection QIdentityProxyModel::mapSelectionToSource(class QItemSelection const &) const
- ?createState@QBlitterPaintEngine@@UBEPAVQPainterState@@PAV2@@Z @ 13303 NONAME ; class QPainterState * QBlitterPaintEngine::createState(class QPainterState *) const
- ??1QIdentityProxyModel@@UAE@XZ @ 13304 NONAME ; QIdentityProxyModel::~QIdentityProxyModel(void)
- ?qt_static_metacall@QDoubleValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13305 NONAME ; void QDoubleValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?removeItem@QGraphicsGridLayout@@QAEXPAVQGraphicsLayoutItem@@@Z @ 13306 NONAME ; void QGraphicsGridLayout::removeItem(class QGraphicsLayoutItem *)
- ?qt_static_metacall@QHBoxLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13307 NONAME ; void QHBoxLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?clipBoundingRect@QPainter@@QBE?AVQRectF@@XZ @ 13308 NONAME ; class QRectF QPainter::clipBoundingRect(void) const
- ?staticMetaObjectExtraData@QAbstractSlider@@0UQMetaObjectExtraData@@B @ 13309 NONAME ; struct QMetaObjectExtraData const QAbstractSlider::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QSlider@@0UQMetaObjectExtraData@@B @ 13310 NONAME ; struct QMetaObjectExtraData const QSlider::staticMetaObjectExtraData
- ?formats@QInternalMimeData@@UBE?AVQStringList@@XZ @ 13311 NONAME ; class QStringList QInternalMimeData::formats(void) const
- ?staticMetaObjectExtraData@QMainWindow@@0UQMetaObjectExtraData@@B @ 13312 NONAME ; struct QMetaObjectExtraData const QMainWindow::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QButtonGroup@@0UQMetaObjectExtraData@@B @ 13313 NONAME ; struct QMetaObjectExtraData const QButtonGroup::staticMetaObjectExtraData
- ?qt_static_metacall@QAbstractSlider@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13314 NONAME ; void QAbstractSlider::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??_EQIdentityProxyModel@@UAE@I@Z @ 13315 NONAME ; QIdentityProxyModel::~QIdentityProxyModel(unsigned int)
- ?qt_static_metacall@QPictureFormatPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13316 NONAME ; void QPictureFormatPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QGuiPlatformPlugin@@0UQMetaObjectExtraData@@B @ 13317 NONAME ; struct QMetaObjectExtraData const QGuiPlatformPlugin::staticMetaObjectExtraData
- ?removeRows@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13318 NONAME ; bool QIdentityProxyModel::removeRows(int, int, class QModelIndex const &)
- ?staticMetaObjectExtraData@QPixmapDropShadowFilter@@0UQMetaObjectExtraData@@B @ 13319 NONAME ; struct QMetaObjectExtraData const QPixmapDropShadowFilter::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGridLayout@@0UQMetaObjectExtraData@@B @ 13320 NONAME ; struct QMetaObjectExtraData const QGridLayout::staticMetaObjectExtraData
- ?raster@QBlitterPaintEngine@@ABEPAVQRasterPaintEngine@@XZ @ 13321 NONAME ; class QRasterPaintEngine * QBlitterPaintEngine::raster(void) const
- ?sort@QAbstractProxyModel@@UAEXHW4SortOrder@Qt@@@Z @ 13322 NONAME ; void QAbstractProxyModel::sort(int, enum Qt::SortOrder)
- ?staticMetaObjectExtraData@QPlainTextEdit@@0UQMetaObjectExtraData@@B @ 13323 NONAME ; struct QMetaObjectExtraData const QPlainTextEdit::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QTableWidget@@0UQMetaObjectExtraData@@B @ 13324 NONAME ; struct QMetaObjectExtraData const QTableWidget::staticMetaObjectExtraData
- ?qt_static_metacall@QSyntaxHighlighter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13325 NONAME ; void QSyntaxHighlighter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setCreationPermissions@QZipWriter@@QAEXV?$QFlags@W4Permission@QFile@@@@@Z @ 13326 NONAME ; void QZipWriter::setCreationPermissions(class QFlags<enum QFile::Permission>)
- ?d_func@QBlittable@@AAEPAVQBlittablePrivate@@XZ @ 13327 NONAME ; class QBlittablePrivate * QBlittable::d_func(void)
- ?previousLogicalPosition@QTextEngine@@QBEHH@Z @ 13328 NONAME ; int QTextEngine::previousLogicalPosition(int) const
- ?type@QBlitterPaintEngine@@UBE?AW4Type@QPaintEngine@@XZ @ 13329 NONAME ; enum QPaintEngine::Type QBlitterPaintEngine::type(void) const
- ?qt_static_metacall@QCommandLinkButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13330 NONAME ; void QCommandLinkButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?buddy@QAbstractProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13331 NONAME ; class QModelIndex QAbstractProxyModel::buddy(class QModelIndex const &) const
- ?staticMetaObjectExtraData@QProxyModel@@0UQMetaObjectExtraData@@B @ 13332 NONAME ; struct QMetaObjectExtraData const QProxyModel::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QInputContextPlugin@@0UQMetaObjectExtraData@@B @ 13333 NONAME ; struct QMetaObjectExtraData const QInputContextPlugin::staticMetaObjectExtraData
- ?metaObject@QIdentityProxyModel@@UBEPBUQMetaObject@@XZ @ 13334 NONAME ; struct QMetaObject const * QIdentityProxyModel::metaObject(void) const
- ?cursorMoveStyle@QLineControl@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 13335 NONAME ABSENT ; enum QTextCursor::MoveStyle QLineControl::cursorMoveStyle(void) const
- ?removeColumns@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13336 NONAME ; bool QIdentityProxyModel::removeColumns(int, int, class QModelIndex const &)
- ?qt_static_metacall@QDirModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13337 NONAME ; void QDirModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QMdiSubWindow@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13338 NONAME ; void QMdiSubWindow::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?fill@QImage@@QAEXABVQColor@@@Z @ 13339 NONAME ; void QImage::fill(class QColor const &)
- ??0QZipWriter@@QAE@PAVQIODevice@@@Z @ 13340 NONAME ; QZipWriter::QZipWriter(class QIODevice *)
- ?fill@QImage@@QAEXW4GlobalColor@Qt@@@Z @ 13341 NONAME ; void QImage::fill(enum Qt::GlobalColor)
- ?staticMetaObjectExtraData@QUndoView@@0UQMetaObjectExtraData@@B @ 13342 NONAME ; struct QMetaObjectExtraData const QUndoView::staticMetaObjectExtraData
- ?canFetchMore@QAbstractProxyModel@@UBE_NABVQModelIndex@@@Z @ 13343 NONAME ; bool QAbstractProxyModel::canFetchMore(class QModelIndex const &) const
- ?staticMetaObjectExtraData@QTextObject@@0UQMetaObjectExtraData@@B @ 13344 NONAME ; struct QMetaObjectExtraData const QTextObject::staticMetaObjectExtraData
- ?qt_static_metacall@QPixmapConvolutionFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13345 NONAME ; void QPixmapConvolutionFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?alignLine@QTextEngine@@QAE?AUQFixed@@ABUQScriptLine@@@Z @ 13346 NONAME ; struct QFixed QTextEngine::alignLine(struct QScriptLine const &)
- ?qt_static_metacall@QSortFilterProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13347 NONAME ; void QSortFilterProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTreeView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13348 NONAME ; void QTreeView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QGraphicsSystemPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13349 NONAME ; void QGraphicsSystemPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?resize@QBlittablePixmapData@@UAEXHH@Z @ 13350 NONAME ; void QBlittablePixmapData::resize(int, int)
- ?setTabsClosable@QMdiArea@@QAEX_N@Z @ 13351 NONAME ; void QMdiArea::setTabsClosable(bool)
- ?staticMetaObjectExtraData@QTreeWidget@@0UQMetaObjectExtraData@@B @ 13352 NONAME ; struct QMetaObjectExtraData const QTreeWidget::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QBoxLayout@@0UQMetaObjectExtraData@@B @ 13353 NONAME ; struct QMetaObjectExtraData const QBoxLayout::staticMetaObjectExtraData
- ?qt_s60_setPartialScreenAutomaticTranslation@@YAX_N@Z @ 13354 NONAME ; void qt_s60_setPartialScreenAutomaticTranslation(bool)
- ?qt_static_metacall@QTabBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13355 NONAME ; void QTabBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?parent@QIdentityProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13356 NONAME ; class QModelIndex QIdentityProxyModel::parent(class QModelIndex const &) const
- ?insertColumns@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13357 NONAME ; bool QIdentityProxyModel::insertColumns(int, int, class QModelIndex const &)
- ?staticMetaObjectExtraData@QDesktopWidget@@0UQMetaObjectExtraData@@B @ 13358 NONAME ; struct QMetaObjectExtraData const QDesktopWidget::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QScrollArea@@0UQMetaObjectExtraData@@B @ 13359 NONAME ; struct QMetaObjectExtraData const QScrollArea::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QImageIOPlugin@@0UQMetaObjectExtraData@@B @ 13360 NONAME ; struct QMetaObjectExtraData const QImageIOPlugin::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QVBoxLayout@@0UQMetaObjectExtraData@@B @ 13361 NONAME ; struct QMetaObjectExtraData const QVBoxLayout::staticMetaObjectExtraData
- ?compressionPolicy@QZipWriter@@QBE?AW4CompressionPolicy@1@XZ @ 13362 NONAME ; enum QZipWriter::CompressionPolicy QZipWriter::compressionPolicy(void) const
- ?getText@QInputDialog@@SA?AVQString@@PAVQWidget@@ABV2@1W4EchoMode@QLineEdit@@1PA_NV?$QFlags@W4WindowType@Qt@@@@V?$QFlags@W4InputMethodHint@Qt@@@@@Z @ 13363 NONAME ; class QString QInputDialog::getText(class QWidget *, class QString const &, class QString const &, enum QLineEdit::EchoMode, class QString const &, bool *, class QFlags<enum Qt::WindowType>, class QFlags<enum Qt::InputMethodHint>)
- ?hasWidthForHeight@QSizePolicy@@QBE_NXZ @ 13364 NONAME ; bool QSizePolicy::hasWidthForHeight(void) const
- ?staticMetaObjectExtraData@QSizeGrip@@0UQMetaObjectExtraData@@B @ 13365 NONAME ; struct QMetaObjectExtraData const QSizeGrip::staticMetaObjectExtraData
- ?qt_static_metacall@QDesktopWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13366 NONAME ; void QDesktopWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QGraphicsDropShadowEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13367 NONAME ; void QGraphicsDropShadowEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QAbstractProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13368 NONAME ; void QAbstractProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?transformChanged@QBlitterPaintEngine@@UAEXXZ @ 13369 NONAME ; void QBlitterPaintEngine::transformChanged(void)
- ??0QBlittablePixmapData@@QAE@XZ @ 13370 NONAME ; QBlittablePixmapData::QBlittablePixmapData(void)
- ?staticMetaObjectExtraData@QHBoxLayout@@0UQMetaObjectExtraData@@B @ 13371 NONAME ; struct QMetaObjectExtraData const QHBoxLayout::staticMetaObjectExtraData
- ?close@QZipWriter@@QAEXXZ @ 13372 NONAME ; void QZipWriter::close(void)
- ?staticMetaObjectExtraData@QUndoGroup@@0UQMetaObjectExtraData@@B @ 13373 NONAME ; struct QMetaObjectExtraData const QUndoGroup::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QDoubleSpinBox@@0UQMetaObjectExtraData@@B @ 13374 NONAME ; struct QMetaObjectExtraData const QDoubleSpinBox::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsTransform@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13375 NONAME ; void QGraphicsTransform::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?dropMimeData@QIdentityProxyModel@@UAE_NPBVQMimeData@@W4DropAction@Qt@@HHABVQModelIndex@@@Z @ 13376 NONAME ; bool QIdentityProxyModel::dropMimeData(class QMimeData const *, enum Qt::DropAction, int, int, class QModelIndex const &)
- ?staticMetaObjectExtraData@QErrorMessage@@0UQMetaObjectExtraData@@B @ 13377 NONAME ; struct QMetaObjectExtraData const QErrorMessage::staticMetaObjectExtraData
- ?size@QBlittable@@QBE?AVQSize@@XZ @ 13378 NONAME ; class QSize QBlittable::size(void) const
- ?staticMetaObjectExtraData@QGraphicsScene@@0UQMetaObjectExtraData@@B @ 13379 NONAME ; struct QMetaObjectExtraData const QGraphicsScene::staticMetaObjectExtraData
- ?qt_static_metacall@QPixmapFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13380 NONAME ; void QPixmapFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13381 NONAME ; void QStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setBlittable@QBlittablePixmapData@@QAEXPAVQBlittable@@@Z @ 13382 NONAME ; void QBlittablePixmapData::setBlittable(class QBlittable *)
- ?qt_static_metacall@QMdiArea@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13383 NONAME ; void QMdiArea::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?visualCursorMovement@QTextEngine@@QBE_NXZ @ 13384 NONAME ; bool QTextEngine::visualCursorMovement(void) const
- ?qt_static_metacall@QComboBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13385 NONAME ; void QComboBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QRadialGradient@@QAE@MMMMMM@Z @ 13386 NONAME ; QRadialGradient::QRadialGradient(float, float, float, float, float, float)
- ?staticMetaObjectExtraData@QRadioButton@@0UQMetaObjectExtraData@@B @ 13387 NONAME ; struct QMetaObjectExtraData const QRadioButton::staticMetaObjectExtraData
- ?opacityChanged@QBlitterPaintEngine@@UAEXXZ @ 13388 NONAME ; void QBlitterPaintEngine::opacityChanged(void)
- ?qt_static_metacall@QAbstractScrollArea@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13389 NONAME ; void QAbstractScrollArea::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QDateTimeEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13390 NONAME ; void QDateTimeEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QFontComboBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13391 NONAME ; void QFontComboBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QGraphicsRotation@@0UQMetaObjectExtraData@@B @ 13392 NONAME ; struct QMetaObjectExtraData const QGraphicsRotation::staticMetaObjectExtraData
- ?setState@QBlitterPaintEngine@@UAEXPAVQPainterState@@@Z @ 13393 NONAME ; void QBlitterPaintEngine::setState(class QPainterState *)
- ?addFile@QZipWriter@@QAEXABVQString@@ABVQByteArray@@@Z @ 13394 NONAME ; void QZipWriter::addFile(class QString const &, class QByteArray const &)
- ?qt_static_metacall@QAbstractButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13395 NONAME ; void QAbstractButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTextDocument@@0UQMetaObjectExtraData@@B @ 13396 NONAME ; struct QMetaObjectExtraData const QTextDocument::staticMetaObjectExtraData
- ?setSourceModel@QIdentityProxyModel@@UAEXPAVQAbstractItemModel@@@Z @ 13397 NONAME ; void QIdentityProxyModel::setSourceModel(class QAbstractItemModel *)
- ?clip@QBlitterPaintEngine@@UAEXABVQRegion@@W4ClipOperation@Qt@@@Z @ 13398 NONAME ; void QBlitterPaintEngine::clip(class QRegion const &, enum Qt::ClipOperation)
- ?subPixelPositionForX@QTextureGlyphCache@@QBE?AUQFixed@@U2@@Z @ 13399 NONAME ; struct QFixed QTextureGlyphCache::subPixelPositionForX(struct QFixed) const
- ?addFile@QZipWriter@@QAEXABVQString@@PAVQIODevice@@@Z @ 13400 NONAME ; void QZipWriter::addFile(class QString const &, class QIODevice *)
- ?hasAlphaChannel@QBlittablePixmapData@@UBE_NXZ @ 13401 NONAME ; bool QBlittablePixmapData::hasAlphaChannel(void) const
- ?numberSuffix@QTextListFormat@@QBE?AVQString@@XZ @ 13402 NONAME ; class QString QTextListFormat::numberSuffix(void) const
- ?tabsMovable@QMdiArea@@QBE_NXZ @ 13403 NONAME ; bool QMdiArea::tabsMovable(void) const
- ?staticMetaObjectExtraData@QRubberBand@@0UQMetaObjectExtraData@@B @ 13404 NONAME ; struct QMetaObjectExtraData const QRubberBand::staticMetaObjectExtraData
- ?qt_static_metacall@QRubberBand@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13405 NONAME ; void QRubberBand::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QMenu@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13406 NONAME ; void QMenu::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?end@QBlitterPaintEngine@@UAE_NXZ @ 13407 NONAME ; bool QBlitterPaintEngine::end(void)
- ?staticMetaObjectExtraData@QAbstractItemDelegate@@0UQMetaObjectExtraData@@B @ 13408 NONAME ; struct QMetaObjectExtraData const QAbstractItemDelegate::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGraphicsTextItem@@0UQMetaObjectExtraData@@B @ 13409 NONAME ; struct QMetaObjectExtraData const QGraphicsTextItem::staticMetaObjectExtraData
- ?getStaticMetaObject@QIdentityProxyModel@@SAABUQMetaObject@@XZ @ 13410 NONAME ; struct QMetaObject const & QIdentityProxyModel::getStaticMetaObject(void)
- ?qt_static_metacall@QFormLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13411 NONAME ; void QFormLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTextTable@@0UQMetaObjectExtraData@@B @ 13412 NONAME ; struct QMetaObjectExtraData const QTextTable::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QWizard@@0UQMetaObjectExtraData@@B @ 13413 NONAME ; struct QMetaObjectExtraData const QWizard::staticMetaObjectExtraData
- ?fill@QBlitterPaintEngine@@UAEXABVQVectorPath@@ABVQBrush@@@Z @ 13414 NONAME ; void QBlitterPaintEngine::fill(class QVectorPath const &, class QBrush const &)
- ?drawPixmap@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQPixmap@@0@Z @ 13415 NONAME ; void QBlitterPaintEngine::drawPixmap(class QRectF const &, class QPixmap const &, class QRectF const &)
- ?staticMetaObjectExtraData@QTextBlockGroup@@0UQMetaObjectExtraData@@B @ 13416 NONAME ; struct QMetaObjectExtraData const QTextBlockGroup::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QActionGroup@@0UQMetaObjectExtraData@@B @ 13417 NONAME ; struct QMetaObjectExtraData const QActionGroup::staticMetaObjectExtraData
- ?index@QIdentityProxyModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 13418 NONAME ; class QModelIndex QIdentityProxyModel::index(int, int, class QModelIndex const &) const
- ?status@QZipWriter@@QBE?AW4Status@1@XZ @ 13419 NONAME ; enum QZipWriter::Status QZipWriter::status(void) const
- ?qt_static_metacall@QTextFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13420 NONAME ; void QTextFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QSlider@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13421 NONAME ; void QSlider::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?tr@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13422 NONAME ; class QString QInternalMimeData::tr(char const *, char const *, int)
- ?qt_static_metacall@QTimeEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13423 NONAME ; void QTimeEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QPaintBufferSignalProxy@@0UQMetaObjectExtraData@@B @ 13424 NONAME ; struct QMetaObjectExtraData const QPaintBufferSignalProxy::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QIconEnginePluginV2@@0UQMetaObjectExtraData@@B @ 13425 NONAME ; struct QMetaObjectExtraData const QIconEnginePluginV2::staticMetaObjectExtraData
- ?get@QFontPrivate@@SAPAV1@ABVQFont@@@Z @ 13426 NONAME ; class QFontPrivate * QFontPrivate::get(class QFont const &)
- ?staticMetaObjectExtraData@QStyledItemDelegate@@0UQMetaObjectExtraData@@B @ 13427 NONAME ; struct QMetaObjectExtraData const QStyledItemDelegate::staticMetaObjectExtraData
- ?qt_static_metacall@QMouseEventTransition@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13428 NONAME ; void QMouseEventTransition::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setInstantInvalidatePropagation@QGraphicsLayout@@SAX_N@Z @ 13429 NONAME ; void QGraphicsLayout::setInstantInvalidatePropagation(bool)
- ?qt_static_metacall@QItemDelegate@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13430 NONAME ; void QItemDelegate::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QMdiArea@@0UQMetaObjectExtraData@@B @ 13431 NONAME ; struct QMetaObjectExtraData const QMdiArea::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGraphicsView@@0UQMetaObjectExtraData@@B @ 13432 NONAME ; struct QMetaObjectExtraData const QGraphicsView::staticMetaObjectExtraData
- ?paintingActive@QVolatileImage@@QBE_NXZ @ 13433 NONAME ; bool QVolatileImage::paintingActive(void) const
- ?staticMetaObjectExtraData@QStyle@@0UQMetaObjectExtraData@@B @ 13434 NONAME ; struct QMetaObjectExtraData const QStyle::staticMetaObjectExtraData
- ?fetchMore@QAbstractProxyModel@@UAEXABVQModelIndex@@@Z @ 13435 NONAME ; void QAbstractProxyModel::fetchMore(class QModelIndex const &)
- ?insertRows@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13436 NONAME ; bool QIdentityProxyModel::insertRows(int, int, class QModelIndex const &)
- ?positionAfterVisualMovement@QTextEngine@@QAEHHW4MoveOperation@QTextCursor@@@Z @ 13437 NONAME ; int QTextEngine::positionAfterVisualMovement(int, enum QTextCursor::MoveOperation)
- ?resolveFontFamilyAlias@QFontDatabase@@CA?AVQString@@ABV2@@Z @ 13438 NONAME ; class QString QFontDatabase::resolveFontFamilyAlias(class QString const &)
- ?alphaRGBMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@HABVQTransform@@@Z @ 13439 NONAME ; class QImage QFontEngine::alphaRGBMapForGlyph(unsigned int, struct QFixed, int, class QTransform const &)
- ?setCenterRadius@QRadialGradient@@QAEXM@Z @ 13440 NONAME ; void QRadialGradient::setCenterRadius(float)
- ?staticMetaObjectExtraData@QPixmapBlurFilter@@0UQMetaObjectExtraData@@B @ 13441 NONAME ; struct QMetaObjectExtraData const QPixmapBlurFilter::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QMenu@@0UQMetaObjectExtraData@@B @ 13442 NONAME ; struct QMetaObjectExtraData const QMenu::staticMetaObjectExtraData
- ?swap@QBitmap@@QAEXAAV1@@Z @ 13443 NONAME ; void QBitmap::swap(class QBitmap &)
- ?hasFormat@QInternalMimeData@@UBE_NABVQString@@@Z @ 13444 NONAME ; bool QInternalMimeData::hasFormat(class QString const &) const
- ?leftCursorPosition@QTextLayout@@QBEHH@Z @ 13445 NONAME ; int QTextLayout::leftCursorPosition(int) const
- ?staticMetaObjectExtraData@QGroupBox@@0UQMetaObjectExtraData@@B @ 13446 NONAME ; struct QMetaObjectExtraData const QGroupBox::staticMetaObjectExtraData
- ?renderDataHelper@QInternalMimeData@@SA?AVQByteArray@@ABVQString@@PBVQMimeData@@@Z @ 13447 NONAME ; class QByteArray QInternalMimeData::renderDataHelper(class QString const &, class QMimeData const *)
- ?staticMetaObjectExtraData@QKeyEventTransition@@0UQMetaObjectExtraData@@B @ 13448 NONAME ; struct QMetaObjectExtraData const QKeyEventTransition::staticMetaObjectExtraData
- ?qt_static_metacall@QKeyEventTransition@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13449 NONAME ; void QKeyEventTransition::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QWindowSurface@@QAE@PAVQWidget@@_N@Z @ 13450 NONAME ; QWindowSurface::QWindowSurface(class QWidget *, bool)
- ?fill@QBlittablePixmapData@@UAEXABVQColor@@@Z @ 13451 NONAME ; void QBlittablePixmapData::fill(class QColor const &)
- ?staticMetaObjectExtraData@QTabWidget@@0UQMetaObjectExtraData@@B @ 13452 NONAME ; struct QMetaObjectExtraData const QTabWidget::staticMetaObjectExtraData
- ?metric@QBlittablePixmapData@@UBEHW4PaintDeviceMetric@QPaintDevice@@@Z @ 13453 NONAME ; int QBlittablePixmapData::metric(enum QPaintDevice::PaintDeviceMetric) const
- ?fillRect@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQColor@@@Z @ 13454 NONAME ; void QBlitterPaintEngine::fillRect(class QRectF const &, class QColor const &)
- ??6@YA?AVQDebug@@V0@PBVQSymbianEvent@@@Z @ 13455 NONAME ; class QDebug operator<<(class QDebug, class QSymbianEvent const *)
- ?qt_static_metacall@QSplitterHandle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13456 NONAME ; void QSplitterHandle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTextEdit@@0UQMetaObjectExtraData@@B @ 13457 NONAME ; struct QMetaObjectExtraData const QTextEdit::staticMetaObjectExtraData
- ?qt_static_metacall@QCompleter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13458 NONAME ; void QCompleter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QSwipeGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13459 NONAME ; void QSwipeGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QWindowsStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13460 NONAME ; void QWindowsStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?ProcessCommandParametersL@QS60MainAppUi@@UAEHW4TApaCommand@@AAV?$TBuf@$0BAA@@@ABVTDesC8@@@Z @ 13461 NONAME ; int QS60MainAppUi::ProcessCommandParametersL(enum TApaCommand, class TBuf<256> &, class TDesC8 const &)
- ?qt_static_metacall@QVBoxLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13462 NONAME ; void QVBoxLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QSpinBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13463 NONAME ; void QSpinBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??_EQBlittablePixmapData@@UAE@I@Z @ 13464 NONAME ; QBlittablePixmapData::~QBlittablePixmapData(unsigned int)
- ?qt_static_metacall@QStringListModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13465 NONAME ; void QStringListModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QPanGesture@@0UQMetaObjectExtraData@@B @ 13466 NONAME ; struct QMetaObjectExtraData const QPanGesture::staticMetaObjectExtraData
- ?device@QZipWriter@@QBEPAVQIODevice@@XZ @ 13467 NONAME ; class QIODevice * QZipWriter::device(void) const
- ?mimeData@QAbstractProxyModel@@UBEPAVQMimeData@@ABV?$QList@VQModelIndex@@@@@Z @ 13468 NONAME ; class QMimeData * QAbstractProxyModel::mimeData(class QList<class QModelIndex> const &) const
- ?qt_static_metacall@QWidgetResizeHandler@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13469 NONAME ; void QWidgetResizeHandler::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QZipWriter@@QAE@ABVQString@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z @ 13470 NONAME ; QZipWriter::QZipWriter(class QString const &, class QFlags<enum QIODevice::OpenModeFlag>)
- ?qt_static_metacall@QPinchGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13471 NONAME ; void QPinchGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTextBrowser@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13472 NONAME ; void QTextBrowser::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTabBar@@0UQMetaObjectExtraData@@B @ 13473 NONAME ; struct QMetaObjectExtraData const QTabBar::staticMetaObjectExtraData
- ?setTabsMovable@QMdiArea@@QAEX_N@Z @ 13474 NONAME ; void QMdiArea::setTabsMovable(bool)
- ?minimumSizeHint@QRadioButton@@UBE?AVQSize@@XZ @ 13475 NONAME ; class QSize QRadioButton::minimumSizeHint(void) const
- ?staticMetaObjectExtraData@QGraphicsObject@@0UQMetaObjectExtraData@@B @ 13476 NONAME ; struct QMetaObjectExtraData const QGraphicsObject::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QPaintBufferResource@@0UQMetaObjectExtraData@@B @ 13477 NONAME ; struct QMetaObjectExtraData const QPaintBufferResource::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QToolBar@@0UQMetaObjectExtraData@@B @ 13478 NONAME ; struct QMetaObjectExtraData const QToolBar::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QFontDialog@@0UQMetaObjectExtraData@@B @ 13479 NONAME ; struct QMetaObjectExtraData const QFontDialog::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QCheckBox@@0UQMetaObjectExtraData@@B @ 13480 NONAME ; struct QMetaObjectExtraData const QCheckBox::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsRotation@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13481 NONAME ; void QGraphicsRotation::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?drawRects@QBlitterPaintEngine@@UAEXPBVQRect@@H@Z @ 13482 NONAME ; void QBlitterPaintEngine::drawRects(class QRect const *, int)
- ?fillInPendingGlyphs@QTextureGlyphCache@@QAEXXZ @ 13483 NONAME ; void QTextureGlyphCache::fillInPendingGlyphs(void)
- ?qt_static_metacall@QColorDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13484 NONAME ; void QColorDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QPixmapBlurFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13485 NONAME ; void QPixmapBlurFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QFontDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13486 NONAME ; void QFontDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?focalRadius@QRadialGradient@@QBEMXZ @ 13487 NONAME ; float QRadialGradient::focalRadius(void) const
- ?renderHintsChanged@QBlitterPaintEngine@@UAEXXZ @ 13488 NONAME ; void QBlitterPaintEngine::renderHintsChanged(void)
- ?staticMetaObjectExtraData@QColorDialog@@0UQMetaObjectExtraData@@B @ 13489 NONAME ; struct QMetaObjectExtraData const QColorDialog::staticMetaObjectExtraData
- ?supportedDropActions@QAbstractProxyModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 13490 NONAME ; class QFlags<enum Qt::DropAction> QAbstractProxyModel::supportedDropActions(void) const
- ?qt_metacast@QIdentityProxyModel@@UAEPAXPBD@Z @ 13491 NONAME ; void * QIdentityProxyModel::qt_metacast(char const *)
- ?qt_static_metacall@QLineControl@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13492 NONAME ; void QLineControl::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?fillRect@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQBrush@@@Z @ 13493 NONAME ; void QBlitterPaintEngine::fillRect(class QRectF const &, class QBrush const &)
- ?qt_draw_decoration_for_glyphs@@YAXPAVQPainter@@PBIPBUQFixedPoint@@HPAVQFontEngine@@ABVQFont@@ABVQTextCharFormat@@@Z @ 13494 NONAME ; void qt_draw_decoration_for_glyphs(class QPainter *, unsigned int const *, struct QFixedPoint const *, int, class QFontEngine *, class QFont const &, class QTextCharFormat const &)
- ?staticMetaObjectExtraData@QClipboard@@0UQMetaObjectExtraData@@B @ 13495 NONAME ; struct QMetaObjectExtraData const QClipboard::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QPixmapColorizeFilter@@0UQMetaObjectExtraData@@B @ 13496 NONAME ; struct QMetaObjectExtraData const QPixmapColorizeFilter::staticMetaObjectExtraData
- ?qt_static_metacall@QUndoStack@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13497 NONAME ; void QUndoStack::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QStandardItemModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13498 NONAME ; void QStandardItemModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QSessionManager@@0UQMetaObjectExtraData@@B @ 13499 NONAME ; struct QMetaObjectExtraData const QSessionManager::staticMetaObjectExtraData
- ?d_func@QBlittable@@ABEPBVQBlittablePrivate@@XZ @ 13500 NONAME ; class QBlittablePrivate const * QBlittable::d_func(void) const
- ?staticMetaObjectExtraData@QStringListModel@@0UQMetaObjectExtraData@@B @ 13501 NONAME ; struct QMetaObjectExtraData const QStringListModel::staticMetaObjectExtraData
- ?qt_static_metacall@QPaintBufferSignalProxy@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13502 NONAME ; void QPaintBufferSignalProxy::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDrag@@0UQMetaObjectExtraData@@B @ 13503 NONAME ; struct QMetaObjectExtraData const QDrag::staticMetaObjectExtraData
- ?qt_static_metacall@QProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13504 NONAME ; void QProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QWidgetResizeHandler@@0UQMetaObjectExtraData@@B @ 13505 NONAME ; struct QMetaObjectExtraData const QWidgetResizeHandler::staticMetaObjectExtraData
- ?state@QBlitterPaintEngine@@QBEPBVQPainterState@@XZ @ 13506 NONAME ; class QPainterState const * QBlitterPaintEngine::state(void) const
- ?qt_static_metacall@QGroupBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13507 NONAME ; void QGroupBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTextObject@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13508 NONAME ; void QTextObject::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QScrollBar@@0UQMetaObjectExtraData@@B @ 13509 NONAME ; struct QMetaObjectExtraData const QScrollBar::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QWizardPage@@0UQMetaObjectExtraData@@B @ 13510 NONAME ; struct QMetaObjectExtraData const QWizardPage::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QShortcut@@0UQMetaObjectExtraData@@B @ 13511 NONAME ; struct QMetaObjectExtraData const QShortcut::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGraphicsScale@@0UQMetaObjectExtraData@@B @ 13512 NONAME ; struct QMetaObjectExtraData const QGraphicsScale::staticMetaObjectExtraData
- ??0QRadialGradient@@QAE@ABVQPointF@@M0M@Z @ 13513 NONAME ; QRadialGradient::QRadialGradient(class QPointF const &, float, class QPointF const &, float)
- ?qt_static_metacall@QTextEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13514 NONAME ; void QTextEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QTapAndHoldGesture@@0UQMetaObjectExtraData@@B @ 13515 NONAME ; struct QMetaObjectExtraData const QTapAndHoldGesture::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QApplication@@0UQMetaObjectExtraData@@B @ 13516 NONAME ; struct QMetaObjectExtraData const QApplication::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsEffectSource@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13517 NONAME ; void QGraphicsEffectSource::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QPushButton@@0UQMetaObjectExtraData@@B @ 13518 NONAME ; struct QMetaObjectExtraData const QPushButton::staticMetaObjectExtraData
- ?centerRadius@QRadialGradient@@QBEMXZ @ 13519 NONAME ; float QRadialGradient::centerRadius(void) const
- ?qt_static_metacall@QAbstractItemDelegate@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13520 NONAME ; void QAbstractItemDelegate::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??1QBlittablePixmapData@@UAE@XZ @ 13521 NONAME ; QBlittablePixmapData::~QBlittablePixmapData(void)
- ?formatsHelper@QInternalMimeData@@SA?AVQStringList@@PBVQMimeData@@@Z @ 13522 NONAME ; class QStringList QInternalMimeData::formatsHelper(class QMimeData const *)
- ?qt_metacast@QInternalMimeData@@UAEPAXPBD@Z @ 13523 NONAME ; void * QInternalMimeData::qt_metacast(char const *)
- ?qt_isExtendedRadialGradient@@YA_NABVQBrush@@@Z @ 13524 NONAME ; bool qt_isExtendedRadialGradient(class QBrush const &)
- ?staticMetaObjectExtraData@QStatusBar@@0UQMetaObjectExtraData@@B @ 13525 NONAME ; struct QMetaObjectExtraData const QStatusBar::staticMetaObjectExtraData
- ?qt_static_metacall@QScrollArea@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13526 NONAME ; void QScrollArea::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13527 NONAME ; void QWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDial@@0UQMetaObjectExtraData@@B @ 13528 NONAME ; struct QMetaObjectExtraData const QDial::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QItemSelectionModel@@0UQMetaObjectExtraData@@B @ 13529 NONAME ; struct QMetaObjectExtraData const QItemSelectionModel::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QFileSystemModel@@0UQMetaObjectExtraData@@B @ 13530 NONAME ; struct QMetaObjectExtraData const QFileSystemModel::staticMetaObjectExtraData
- ?setCompressionPolicy@QZipWriter@@QAEXW4CompressionPolicy@1@@Z @ 13531 NONAME ; void QZipWriter::setCompressionPolicy(enum QZipWriter::CompressionPolicy)
- ?mapToSource@QIdentityProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13532 NONAME ; class QModelIndex QIdentityProxyModel::mapToSource(class QModelIndex const &) const
- ?staticMetaObjectExtraData@QColumnView@@0UQMetaObjectExtraData@@B @ 13533 NONAME ; struct QMetaObjectExtraData const QColumnView::staticMetaObjectExtraData
- ?paintEngine@QBlittablePixmapData@@UBEPAVQPaintEngine@@XZ @ 13534 NONAME ; class QPaintEngine * QBlittablePixmapData::paintEngine(void) const
- ?qt_static_metacall@QInputContextPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13535 NONAME ; void QInputContextPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?d_func@QIdentityProxyModel@@AAEPAVQIdentityProxyModelPrivate@@XZ @ 13536 NONAME ; class QIdentityProxyModelPrivate * QIdentityProxyModel::d_func(void)
- ?qt_static_metacall@QGraphicsColorizeEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13537 NONAME ; void QGraphicsColorizeEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?hasChildren@QAbstractProxyModel@@UBE_NABVQModelIndex@@@Z @ 13538 NONAME ; bool QAbstractProxyModel::hasChildren(class QModelIndex const &) const
- ?qt_static_metacall@QPushButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13539 NONAME ; void QPushButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?swap@QPen@@QAEXAAV1@@Z @ 13540 NONAME ; void QPen::swap(class QPen &)
- ?span@QAbstractProxyModel@@UBE?AVQSize@@ABVQModelIndex@@@Z @ 13541 NONAME ; class QSize QAbstractProxyModel::span(class QModelIndex const &) const
- ?staticMetaObjectExtraData@QSound@@0UQMetaObjectExtraData@@B @ 13542 NONAME ; struct QMetaObjectExtraData const QSound::staticMetaObjectExtraData
- ?qt_static_metacall@QDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13543 NONAME ; void QDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QGraphicsItemAnimation@@0UQMetaObjectExtraData@@B @ 13544 NONAME ; struct QMetaObjectExtraData const QGraphicsItemAnimation::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGraphicsAnchor@@0UQMetaObjectExtraData@@B @ 13545 NONAME ; struct QMetaObjectExtraData const QGraphicsAnchor::staticMetaObjectExtraData
- ?qt_static_metacall@QImageIOPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13546 NONAME ; void QImageIOPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?textureMapForGlyph@QTextureGlyphCache@@QBE?AVQImage@@IUQFixed@@@Z @ 13547 NONAME ; class QImage QTextureGlyphCache::textureMapForGlyph(unsigned int, struct QFixed) const
- ?qt_static_metacall@QUndoView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13548 NONAME ; void QUndoView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QIntValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13549 NONAME ; void QIntValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QRegExpValidator@@0UQMetaObjectExtraData@@B @ 13550 NONAME ; struct QMetaObjectExtraData const QRegExpValidator::staticMetaObjectExtraData
- ?insertionPointsForLine@QTextEngine@@QAEXHAAV?$QVector@H@@@Z @ 13551 NONAME ; void QTextEngine::insertionPointsForLine(int, class QVector<int> &)
- ?staticMetaObjectExtraData@QAbstractSpinBox@@0UQMetaObjectExtraData@@B @ 13552 NONAME ; struct QMetaObjectExtraData const QAbstractSpinBox::staticMetaObjectExtraData
- ?qt_metacall@QInternalMimeData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13553 NONAME ; int QInternalMimeData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QLCDNumber@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13554 NONAME ; void QLCDNumber::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??1QZipWriter@@QAE@XZ @ 13555 NONAME ; QZipWriter::~QZipWriter(void)
- ?staticMetaObjectExtraData@QSpinBox@@0UQMetaObjectExtraData@@B @ 13556 NONAME ; struct QMetaObjectExtraData const QSpinBox::staticMetaObjectExtraData
- ?lineHeightType@QTextBlockFormat@@QBEHXZ @ 13557 NONAME ; int QTextBlockFormat::lineHeightType(void) const
- ?hintingPreference@QFont@@QBE?AW4HintingPreference@1@XZ @ 13558 NONAME ; enum QFont::HintingPreference QFont::hintingPreference(void) const
- ?qt_static_metacall@QDockWidgetLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13559 NONAME ; void QDockWidgetLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13560 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *, int)
- ?cloneWithSize@QFontEngine@@UBEPAV1@M@Z @ 13561 NONAME ; class QFontEngine * QFontEngine::cloneWithSize(float) const
- ?begin@QBlitterPaintEngine@@UAE_NPAVQPaintDevice@@@Z @ 13562 NONAME ; bool QBlitterPaintEngine::begin(class QPaintDevice *)
- ?staticMetaObjectExtraData@QPixmapFilter@@0UQMetaObjectExtraData@@B @ 13563 NONAME ; struct QMetaObjectExtraData const QPixmapFilter::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QTapGesture@@0UQMetaObjectExtraData@@B @ 13564 NONAME ; struct QMetaObjectExtraData const QTapGesture::staticMetaObjectExtraData
- ?inFontUcs4@QFontMetricsF@@QBE_NI@Z @ 13565 NONAME ; bool QFontMetricsF::inFontUcs4(unsigned int) const
- ?staticMetaObjectExtraData@QTextControl@@0UQMetaObjectExtraData@@B @ 13566 NONAME ; struct QMetaObjectExtraData const QTextControl::staticMetaObjectExtraData
- ?qt_static_metacall@QScrollBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13567 NONAME ; void QScrollBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QStackedWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13568 NONAME ; void QStackedWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQRectF@@@Z @ 13569 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRectF const &)
- ?d_func@QBlitterPaintEngine@@AAEPAVQBlitterPaintEnginePrivate@@XZ @ 13570 NONAME ; class QBlitterPaintEnginePrivate * QBlitterPaintEngine::d_func(void)
- ?setNumberPrefix@QTextListFormat@@QAEXABVQString@@@Z @ 13571 NONAME ; void QTextListFormat::setNumberPrefix(class QString const &)
- ?qt_static_metacall@QAbstractSpinBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13572 NONAME ; void QAbstractSpinBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setCursorMoveStyle@QLineEdit@@QAEXW4MoveStyle@QTextCursor@@@Z @ 13573 NONAME ABSENT ; void QLineEdit::setCursorMoveStyle(enum QTextCursor::MoveStyle)
- ?lineHeight@QTextBlockFormat@@QBEMMM@Z @ 13574 NONAME ; float QTextBlockFormat::lineHeight(float, float) const
- ??0QIdentityProxyModel@@IAE@AAVQIdentityProxyModelPrivate@@PAVQObject@@@Z @ 13575 NONAME ; QIdentityProxyModel::QIdentityProxyModel(class QIdentityProxyModelPrivate &, class QObject *)
- ?staticMetaObjectExtraData@QGraphicsEffect@@0UQMetaObjectExtraData@@B @ 13576 NONAME ; struct QMetaObjectExtraData const QGraphicsEffect::staticMetaObjectExtraData
- ?qt_static_metacall@QMovie@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13577 NONAME ; void QMovie::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QToolBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13578 NONAME ; void QToolBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?getItem@QInputDialog@@SA?AVQString@@PAVQWidget@@ABV2@1ABVQStringList@@H_NPA_NV?$QFlags@W4WindowType@Qt@@@@V?$QFlags@W4InputMethodHint@Qt@@@@@Z @ 13579 NONAME ; class QString QInputDialog::getItem(class QWidget *, class QString const &, class QString const &, class QStringList const &, int, bool, bool *, class QFlags<enum Qt::WindowType>, class QFlags<enum Qt::InputMethodHint>)
- ?staticMetaObjectExtraData@QItemDelegate@@0UQMetaObjectExtraData@@B @ 13580 NONAME ; struct QMetaObjectExtraData const QItemDelegate::staticMetaObjectExtraData
- ?qt_static_metacall@QFileSystemModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13581 NONAME ; void QFileSystemModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?hasFeature@QWindowSurface@@QBE_NW4WindowSurfaceFeature@1@@Z @ 13582 NONAME ; bool QWindowSurface::hasFeature(enum QWindowSurface::WindowSurfaceFeature) const
- ?qGamma_correct_back_to_linear_cs@@YAXPAVQImage@@@Z @ 13583 NONAME ; void qGamma_correct_back_to_linear_cs(class QImage *)
- ?qt_static_metacall@QBoxLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13584 NONAME ; void QBoxLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QInputContext@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13585 NONAME ; void QInputContext::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QColumnView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13586 NONAME ; void QColumnView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?clip@QBlitterPaintEngine@@UAEXABVQVectorPath@@W4ClipOperation@Qt@@@Z @ 13587 NONAME ; void QBlitterPaintEngine::clip(class QVectorPath const &, enum Qt::ClipOperation)
- ?qt_static_metacall@QSizeGrip@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13588 NONAME ; void QSizeGrip::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QFileDialog@@0UQMetaObjectExtraData@@B @ 13589 NONAME ; struct QMetaObjectExtraData const QFileDialog::staticMetaObjectExtraData
- ?qt_static_metacall@QCalendarWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13590 NONAME ; void QCalendarWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?canReadData@QInternalMimeData@@SA_NABVQString@@@Z @ 13591 NONAME ; bool QInternalMimeData::canReadData(class QString const &)
- ?leadingSpaceWidth@QTextEngine@@QAE?AUQFixed@@ABUQScriptLine@@@Z @ 13592 NONAME ; struct QFixed QTextEngine::leadingSpaceWidth(struct QScriptLine const &)
- ?staticMetaObjectExtraData@QSwipeGesture@@0UQMetaObjectExtraData@@B @ 13593 NONAME ; struct QMetaObjectExtraData const QSwipeGesture::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QProxyStyle@@0UQMetaObjectExtraData@@B @ 13594 NONAME ; struct QMetaObjectExtraData const QProxyStyle::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QMessageBox@@0UQMetaObjectExtraData@@B @ 13595 NONAME ; struct QMetaObjectExtraData const QMessageBox::staticMetaObjectExtraData
- ?qt_static_metacall@QStatusBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13596 NONAME ; void QStatusBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDataWidgetMapper@@0UQMetaObjectExtraData@@B @ 13597 NONAME ; struct QMetaObjectExtraData const QDataWidgetMapper::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QPlainTextDocumentLayout@@0UQMetaObjectExtraData@@B @ 13598 NONAME ; struct QMetaObjectExtraData const QPlainTextDocumentLayout::staticMetaObjectExtraData
- ?qt_static_metacall@QProxyStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13599 NONAME ; void QProxyStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QAbstractTextDocumentLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13600 NONAME ; void QAbstractTextDocumentLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QDockWidgetLayout@@0UQMetaObjectExtraData@@B @ 13601 NONAME ; struct QMetaObjectExtraData const QDockWidgetLayout::staticMetaObjectExtraData
- ?qt_static_metacall@QIconEnginePluginV2@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13602 NONAME ; void QIconEnginePluginV2::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QRegExpValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13603 NONAME ; void QRegExpValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?lineNumberForTextPosition@QTextEngine@@QAEHH@Z @ 13604 NONAME ; int QTextEngine::lineNumberForTextPosition(int)
- ?instantInvalidatePropagation@QGraphicsLayout@@SA_NXZ @ 13605 NONAME ; bool QGraphicsLayout::instantInvalidatePropagation(void)
- ?staticMetaObjectExtraData@QDoubleValidator@@0UQMetaObjectExtraData@@B @ 13606 NONAME ; struct QMetaObjectExtraData const QDoubleValidator::staticMetaObjectExtraData
- ?qt_static_metacall@QCommonStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13607 NONAME ; void QCommonStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTextList@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13608 NONAME ; void QTextList::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?beginningOfLine@QTextEngine@@AAEHH@Z @ 13609 NONAME ; int QTextEngine::beginningOfLine(int)
- ?qt_static_metacall@QDockWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13610 NONAME ; void QDockWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QAbstractProxyModel@@0UQMetaObjectExtraData@@B @ 13611 NONAME ; struct QMetaObjectExtraData const QAbstractProxyModel::staticMetaObjectExtraData
- ?alphaMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@ABVQTransform@@@Z @ 13612 NONAME ; class QImage QFontEngine::alphaMapForGlyph(unsigned int, struct QFixed, class QTransform const &)
- ?staticMetaObjectExtraData@QUndoStack@@0UQMetaObjectExtraData@@B @ 13613 NONAME ; struct QMetaObjectExtraData const QUndoStack::staticMetaObjectExtraData
- ?qt_static_metacall@QErrorMessage@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13614 NONAME ; void QErrorMessage::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?fromImage@QBlittablePixmapData@@UAEXABVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 13615 NONAME ; void QBlittablePixmapData::fromImage(class QImage const &, class QFlags<enum Qt::ImageConversionFlag>)
- ??0QInternalMimeData@@QAE@XZ @ 13616 NONAME ; QInternalMimeData::QInternalMimeData(void)
- ?features@QRasterWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 13617 NONAME ; class QFlags<enum QWindowSurface::WindowSurfaceFeature> QRasterWindowSurface::features(void) const
- ?qt_static_metacall@QActionGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13618 NONAME ; void QActionGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QBlittable@@QAE@ABVQSize@@V?$QFlags@W4Capability@QBlittable@@@@@Z @ 13619 NONAME ; QBlittable::QBlittable(class QSize const &, class QFlags<enum QBlittable::Capability>)
- ?qt_static_metacall@QDataWidgetMapper@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13620 NONAME ; void QDataWidgetMapper::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QGraphicsSystemPlugin@@0UQMetaObjectExtraData@@B @ 13621 NONAME ; struct QMetaObjectExtraData const QGraphicsSystemPlugin::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QCommonStyle@@0UQMetaObjectExtraData@@B @ 13622 NONAME ; struct QMetaObjectExtraData const QCommonStyle::staticMetaObjectExtraData
- ?qt_static_metacall@QWizard@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13623 NONAME ; void QWizard::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QIdentityProxyModel@@QAE@PAVQObject@@@Z @ 13624 NONAME ; QIdentityProxyModel::QIdentityProxyModel(class QObject *)
- ?staticMetaObjectExtraData@QTreeView@@0UQMetaObjectExtraData@@B @ 13625 NONAME ; struct QMetaObjectExtraData const QTreeView::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QDateEdit@@0UQMetaObjectExtraData@@B @ 13626 NONAME ; struct QMetaObjectExtraData const QDateEdit::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGesture@@0UQMetaObjectExtraData@@B @ 13627 NONAME ; struct QMetaObjectExtraData const QGesture::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsProxyWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13628 NONAME ; void QGraphicsProxyWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?markRasterOverlay@QBlittablePixmapData@@QAEXPBVQRect@@H@Z @ 13629 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRect const *, int)
- ?rightCursorPosition@QTextLayout@@QBEHH@Z @ 13630 NONAME ; int QTextLayout::rightCursorPosition(int) const
- ?tabsClosable@QMdiArea@@QBE_NXZ @ 13631 NONAME ; bool QMdiArea::tabsClosable(void) const
- ?staticMetaObjectExtraData@QTextFrame@@0UQMetaObjectExtraData@@B @ 13632 NONAME ; struct QMetaObjectExtraData const QTextFrame::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QAbstractScrollArea@@0UQMetaObjectExtraData@@B @ 13633 NONAME ; struct QMetaObjectExtraData const QAbstractScrollArea::staticMetaObjectExtraData
- ?setLineHeight@QTextBlockFormat@@QAEXMH@Z @ 13634 NONAME ; void QTextBlockFormat::setLineHeight(float, int)
- ?staticMetaObjectExtraData@QFormLayout@@0UQMetaObjectExtraData@@B @ 13635 NONAME ; struct QMetaObjectExtraData const QFormLayout::staticMetaObjectExtraData
- ?calculateSubPixelPositionCount@QTextureGlyphCache@@IBEHI@Z @ 13636 NONAME ; int QTextureGlyphCache::calculateSubPixelPositionCount(unsigned int) const
- ?staticMetaObjectExtraData@QStackedWidget@@0UQMetaObjectExtraData@@B @ 13637 NONAME ; struct QMetaObjectExtraData const QStackedWidget::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QDialogButtonBox@@0UQMetaObjectExtraData@@B @ 13638 NONAME ; struct QMetaObjectExtraData const QDialogButtonBox::staticMetaObjectExtraData
- ?qt_static_metacall@QToolButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13639 NONAME ; void QToolButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QPanGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13640 NONAME ; void QPanGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?features@QWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 13641 NONAME ; class QFlags<enum QWindowSurface::WindowSurfaceFeature> QWindowSurface::features(void) const
- ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQVectorPath@@@Z @ 13642 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QVectorPath const &)
- ?alphaMapBoundingBox@QFontEngine@@UAE?AUglyph_metrics_t@@IUQFixed@@ABVQTransform@@W4GlyphFormat@1@@Z @ 13643 NONAME ; struct glyph_metrics_t QFontEngine::alphaMapBoundingBox(unsigned int, struct QFixed, class QTransform const &, enum QFontEngine::GlyphFormat)
- ?qt_static_metacall@QTapGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13644 NONAME ; void QTapGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QIntValidator@@0UQMetaObjectExtraData@@B @ 13645 NONAME ; struct QMetaObjectExtraData const QIntValidator::staticMetaObjectExtraData
- ?qt_static_metacall@QInputDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13646 NONAME ; void QInputDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?clip@QBlitterPaintEngine@@QAEPBVQClipData@@XZ @ 13647 NONAME ; class QClipData const * QBlitterPaintEngine::clip(void)
- ?qt_static_metacall@QStylePlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13648 NONAME ; void QStylePlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setNumberSuffix@QTextListFormat@@QAEXABVQString@@@Z @ 13649 NONAME ; void QTextListFormat::setNumberSuffix(class QString const &)
- ?qt_static_metacall@QApplication@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13650 NONAME ; void QApplication::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?swap@QPicture@@QAEXAAV1@@Z @ 13651 NONAME ; void QPicture::swap(class QPicture &)
- ?d_func@QIdentityProxyModel@@ABEPBVQIdentityProxyModelPrivate@@XZ @ 13652 NONAME ; class QIdentityProxyModelPrivate const * QIdentityProxyModel::d_func(void) const
- ?qt_static_metacall@QSplashScreen@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13653 NONAME ; void QSplashScreen::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?swap@QPainterPath@@QAEXAAV1@@Z @ 13654 NONAME ; void QPainterPath::swap(class QPainterPath &)
- ?qt_static_metacall@QFocusFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13655 NONAME ; void QFocusFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?minimumSizeHint@QCheckBox@@UBE?AVQSize@@XZ @ 13656 NONAME ; class QSize QCheckBox::minimumSizeHint(void) const
- ?alphaMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@@Z @ 13657 NONAME ; class QImage QFontEngine::alphaMapForGlyph(unsigned int, struct QFixed)
- ?fillTexture@QImageTextureGlyphCache@@UAEXABUCoord@QTextureGlyphCache@@IUQFixed@@@Z @ 13658 NONAME ; void QImageTextureGlyphCache::fillTexture(struct QTextureGlyphCache::Coord const &, unsigned int, struct QFixed)
- ?swap@QIcon@@QAEXAAV1@@Z @ 13659 NONAME ; void QIcon::swap(class QIcon &)
- ?columnCount@QIdentityProxyModel@@UBEHABVQModelIndex@@@Z @ 13660 NONAME ; int QIdentityProxyModel::columnCount(class QModelIndex const &) const
- ?unmarkRasterOverlay@QBlittablePixmapData@@QAEXABVQRectF@@@Z @ 13661 NONAME ; void QBlittablePixmapData::unmarkRasterOverlay(class QRectF const &)
- ?cursorMoveStyle@QLineEdit@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 13662 NONAME ABSENT ; enum QTextCursor::MoveStyle QLineEdit::cursorMoveStyle(void) const
- ?trUtf8@QIdentityProxyModel@@SA?AVQString@@PBD0H@Z @ 13663 NONAME ; class QString QIdentityProxyModel::trUtf8(char const *, char const *, int)
- ?brushOriginChanged@QBlitterPaintEngine@@UAEXXZ @ 13664 NONAME ; void QBlitterPaintEngine::brushOriginChanged(void)
- ?openFile@QFileOpenEvent@@QBE_NAAVQFile@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z @ 13665 NONAME ; bool QFileOpenEvent::openFile(class QFile &, class QFlags<enum QIODevice::OpenModeFlag>) const
- ??0QApplicationPrivate@@QAE@AAHPAPADW4Type@QApplication@@H@Z @ 13666 NONAME ; QApplicationPrivate::QApplicationPrivate(int &, char * *, enum QApplication::Type, int)
- ?qt_static_metacall@QSound@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13667 NONAME ; void QSound::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QToolBox@@0UQMetaObjectExtraData@@B @ 13668 NONAME ; struct QMetaObjectExtraData const QToolBox::staticMetaObjectExtraData
- ?addDirectory@QZipWriter@@QAEXABVQString@@@Z @ 13669 NONAME ; void QZipWriter::addDirectory(class QString const &)
- ?staticMetaObjectExtraData@QGraphicsOpacityEffect@@0UQMetaObjectExtraData@@B @ 13670 NONAME ; struct QMetaObjectExtraData const QGraphicsOpacityEffect::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QGraphicsColorizeEffect@@0UQMetaObjectExtraData@@B @ 13671 NONAME ; struct QMetaObjectExtraData const QGraphicsColorizeEffect::staticMetaObjectExtraData
- ?inFontUcs4@QFontMetrics@@QBE_NI@Z @ 13672 NONAME ; bool QFontMetrics::inFontUcs4(unsigned int) const
- ?staticMetaObjectExtraData@QIconEnginePlugin@@0UQMetaObjectExtraData@@B @ 13673 NONAME ; struct QMetaObjectExtraData const QIconEnginePlugin::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QFrame@@0UQMetaObjectExtraData@@B @ 13674 NONAME ; struct QMetaObjectExtraData const QFrame::staticMetaObjectExtraData
- ?isWritable@QZipWriter@@QBE_NXZ @ 13675 NONAME ; bool QZipWriter::isWritable(void) const
- ?qt_static_metacall@QValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13676 NONAME ; void QValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QStandardItemModel@@0UQMetaObjectExtraData@@B @ 13677 NONAME ; struct QMetaObjectExtraData const QStandardItemModel::staticMetaObjectExtraData
- ?qt_static_metacall@QDrag@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13678 NONAME ; void QDrag::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QFontComboBox@@0UQMetaObjectExtraData@@B @ 13679 NONAME ; struct QMetaObjectExtraData const QFontComboBox::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QInputDialog@@0UQMetaObjectExtraData@@B @ 13680 NONAME ; struct QMetaObjectExtraData const QInputDialog::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QInputContext@@0UQMetaObjectExtraData@@B @ 13681 NONAME ; struct QMetaObjectExtraData const QInputContext::staticMetaObjectExtraData
- ?unlock@QBlittable@@QAEXXZ @ 13682 NONAME ; void QBlittable::unlock(void)
- ?swap@QRegion@@QAEXAAV1@@Z @ 13683 NONAME ; void QRegion::swap(class QRegion &)
- ?staticMetaObjectExtraData@QLCDNumber@@0UQMetaObjectExtraData@@B @ 13684 NONAME ; struct QMetaObjectExtraData const QLCDNumber::staticMetaObjectExtraData
- ?setDefaultCursorMoveStyle@QTextDocument@@QAEXW4MoveStyle@QTextCursor@@@Z @ 13685 NONAME ABSENT ; void QTextDocument::setDefaultCursorMoveStyle(enum QTextCursor::MoveStyle)
- ?staticMetaObjectExtraData@QS60Style@@0UQMetaObjectExtraData@@B @ 13686 NONAME ; struct QMetaObjectExtraData const QS60Style::staticMetaObjectExtraData
- ?qt_static_metacall@QWidgetAction@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13687 NONAME ; void QWidgetAction::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QListView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13688 NONAME ; void QListView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?setItemData@QAbstractProxyModel@@UAE_NABVQModelIndex@@ABV?$QMap@HVQVariant@@@@@Z @ 13689 NONAME ; bool QAbstractProxyModel::setItemData(class QModelIndex const &, class QMap<int, class QVariant> const &)
- ?getStaticMetaObject@QInternalMimeData@@SAABUQMetaObject@@XZ @ 13690 NONAME ; struct QMetaObject const & QInternalMimeData::getStaticMetaObject(void)
- ?swap@QPolygonF@@QAEXAAV1@@Z @ 13691 NONAME ; void QPolygonF::swap(class QPolygonF &)
- ?creationPermissions@QZipWriter@@QBE?AV?$QFlags@W4Permission@QFile@@@@XZ @ 13692 NONAME ; class QFlags<enum QFile::Permission> QZipWriter::creationPermissions(void) const
- ?qt_static_metacall@QDial@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13693 NONAME ; void QDial::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?swap@QPolygon@@QAEXAAV1@@Z @ 13694 NONAME ; void QPolygon::swap(class QPolygon &)
- ?qt_static_metacall@QWorkspace@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13695 NONAME ; void QWorkspace::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QProgressDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13696 NONAME ; void QProgressDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?d_func@QBlitterPaintEngine@@ABEPBVQBlitterPaintEnginePrivate@@XZ @ 13697 NONAME ; class QBlitterPaintEnginePrivate const * QBlitterPaintEngine::d_func(void) const
- ?actionText@QUndoCommand@@QBE?AVQString@@XZ @ 13698 NONAME ; class QString QUndoCommand::actionText(void) const
- ?staticMetaObjectExtraData@QWidgetAction@@0UQMetaObjectExtraData@@B @ 13699 NONAME ; struct QMetaObjectExtraData const QWidgetAction::staticMetaObjectExtraData
- ?qt_static_metacall@QListWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13700 NONAME ; void QListWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?tr@QIdentityProxyModel@@SA?AVQString@@PBD0H@Z @ 13701 NONAME ; class QString QIdentityProxyModel::tr(char const *, char const *, int)
- ?swap@QKeySequence@@QAEXAAV1@@Z @ 13702 NONAME ; void QKeySequence::swap(class QKeySequence &)
- ?staticMetaObjectExtraData@QGraphicsDropShadowEffect@@0UQMetaObjectExtraData@@B @ 13703 NONAME ; struct QMetaObjectExtraData const QGraphicsDropShadowEffect::staticMetaObjectExtraData
- ?qt_static_metacall@QProgressBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13704 NONAME ; void QProgressBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QTextBlockGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13705 NONAME ; void QTextBlockGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?lineHeight@QTextBlockFormat@@QBEMXZ @ 13706 NONAME ; float QTextBlockFormat::lineHeight(void) const
- ?stroke@QBlitterPaintEngine@@UAEXABVQVectorPath@@ABVQPen@@@Z @ 13707 NONAME ; void QBlitterPaintEngine::stroke(class QVectorPath const &, class QPen const &)
- ?qt_static_metacall@QWizardPage@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13708 NONAME ; void QWizardPage::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QToolButton@@0UQMetaObjectExtraData@@B @ 13709 NONAME ; struct QMetaObjectExtraData const QToolButton::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QSyntaxHighlighter@@0UQMetaObjectExtraData@@B @ 13710 NONAME ; struct QMetaObjectExtraData const QSyntaxHighlighter::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QHeaderView@@0UQMetaObjectExtraData@@B @ 13711 NONAME ; struct QMetaObjectExtraData const QHeaderView::staticMetaObjectExtraData
- ?tr@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13712 NONAME ; class QString QInternalMimeData::tr(char const *, char const *)
- ?mapFromSource@QIdentityProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13713 NONAME ; class QModelIndex QIdentityProxyModel::mapFromSource(class QModelIndex const &) const
- ??1QBlittable@@UAE@XZ @ 13714 NONAME ; QBlittable::~QBlittable(void)
- ??_EQBlitterPaintEngine@@UAE@I@Z @ 13715 NONAME ; QBlitterPaintEngine::~QBlitterPaintEngine(unsigned int)
- ?staticMetaObjectExtraData@QInternalMimeData@@0UQMetaObjectExtraData@@B @ 13716 NONAME ; struct QMetaObjectExtraData const QInternalMimeData::staticMetaObjectExtraData
- ?buffer@QBlittablePixmapData@@UAEPAVQImage@@XZ @ 13717 NONAME ; class QImage * QBlittablePixmapData::buffer(void)
- ?staticMetaObjectExtraData@QComboBox@@0UQMetaObjectExtraData@@B @ 13718 NONAME ; struct QMetaObjectExtraData const QComboBox::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QWorkspace@@0UQMetaObjectExtraData@@B @ 13719 NONAME ; struct QMetaObjectExtraData const QWorkspace::staticMetaObjectExtraData
- ?nextLogicalPosition@QTextEngine@@QBEHH@Z @ 13720 NONAME ; int QTextEngine::nextLogicalPosition(int) const
- ?qt_static_metacall@QGraphicsEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13721 NONAME ; void QGraphicsEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QUndoGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13722 NONAME ; void QUndoGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QProgressBar@@0UQMetaObjectExtraData@@B @ 13723 NONAME ; struct QMetaObjectExtraData const QProgressBar::staticMetaObjectExtraData
- ?qt_static_metacall@QLineEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13724 NONAME ; void QLineEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?drawStaticTextItem@QBlitterPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 13725 NONAME ; void QBlitterPaintEngine::drawStaticTextItem(class QStaticTextItem *)
- ?setCursorMoveStyle@QTextLayout@@QAEXW4MoveStyle@QTextCursor@@@Z @ 13726 NONAME ABSENT ; void QTextLayout::setCursorMoveStyle(enum QTextCursor::MoveStyle)
- ?lock@QBlittable@@QAEPAVQImage@@XZ @ 13727 NONAME ; class QImage * QBlittable::lock(void)
- ?setFontHintingPreference@QTextCharFormat@@QAEXW4HintingPreference@QFont@@@Z @ 13728 NONAME ; void QTextCharFormat::setFontHintingPreference(enum QFont::HintingPreference)
- ?qt_static_metacall@QPixmapColorizeFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13729 NONAME ; void QPixmapColorizeFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QGuiPlatformPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13730 NONAME ; void QGuiPlatformPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QSplitterHandle@@0UQMetaObjectExtraData@@B @ 13731 NONAME ; struct QMetaObjectExtraData const QSplitterHandle::staticMetaObjectExtraData
- ?qt_static_metacall@QButtonGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13732 NONAME ; void QButtonGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QCalendarWidget@@0UQMetaObjectExtraData@@B @ 13733 NONAME ; struct QMetaObjectExtraData const QCalendarWidget::staticMetaObjectExtraData
- ?qt_static_metacall@QTreeWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13734 NONAME ; void QTreeWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?doItemsLayout@QTableView@@UAEXXZ @ 13735 NONAME ; void QTableView::doItemsLayout(void)
- ??_EQInternalMimeData@@UAE@I@Z @ 13736 NONAME ; QInternalMimeData::~QInternalMimeData(unsigned int)
- ?staticMetaObjectExtraData@QMouseEventTransition@@0UQMetaObjectExtraData@@B @ 13737 NONAME ; struct QMetaObjectExtraData const QMouseEventTransition::staticMetaObjectExtraData
- ?qt_static_metacall@QIconEnginePlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13738 NONAME ; void QIconEnginePlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QDialogButtonBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13739 NONAME ; void QDialogButtonBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQPointF@@ABVQTextItem@@@Z @ 13740 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QPointF const &, class QTextItem const &)
- ?qt_static_metacall@QPlainTextDocumentLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13741 NONAME ; void QPlainTextDocumentLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QLabel@@0UQMetaObjectExtraData@@B @ 13742 NONAME ; struct QMetaObjectExtraData const QLabel::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QCompleter@@0UQMetaObjectExtraData@@B @ 13743 NONAME ; struct QMetaObjectExtraData const QCompleter::staticMetaObjectExtraData
- ?qt_static_metacall@QDateEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13744 NONAME ; void QDateEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?drawEllipse@QBlitterPaintEngine@@UAEXABVQRectF@@@Z @ 13745 NONAME ; void QBlitterPaintEngine::drawEllipse(class QRectF const &)
- ?staticMetaObjectExtraData@QTimeEdit@@0UQMetaObjectExtraData@@B @ 13746 NONAME ; struct QMetaObjectExtraData const QTimeEdit::staticMetaObjectExtraData
- ?blittable@QBlittablePixmapData@@QBEPAVQBlittable@@XZ @ 13747 NONAME ; class QBlittable * QBlittablePixmapData::blittable(void) const
- ?setFocalRadius@QRadialGradient@@QAEXM@Z @ 13748 NONAME ; void QRadialGradient::setFocalRadius(float)
- ?qt_painterPathFromVectorPath@@YA?AVQPainterPath@@ABVQVectorPath@@@Z @ 13749 NONAME ; class QPainterPath qt_painterPathFromVectorPath(class QVectorPath const &)
- ?staticMetaObjectExtraData@QAction@@0UQMetaObjectExtraData@@B @ 13750 NONAME ; struct QMetaObjectExtraData const QAction::staticMetaObjectExtraData
- ?resizeCache@QTextureGlyphCache@@QAEXHH@Z @ 13751 NONAME ; void QTextureGlyphCache::resizeCache(int, int)
- ?qt_static_metacall@QHeaderView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13752 NONAME ; void QHeaderView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QGraphicsProxyWidget@@0UQMetaObjectExtraData@@B @ 13753 NONAME ; struct QMetaObjectExtraData const QGraphicsProxyWidget::staticMetaObjectExtraData
- ?metaObject@QInternalMimeData@@UBEPBUQMetaObject@@XZ @ 13754 NONAME ; struct QMetaObject const * QInternalMimeData::metaObject(void) const
- ?addSymLink@QZipWriter@@QAEXABVQString@@0@Z @ 13755 NONAME ; void QZipWriter::addSymLink(class QString const &, class QString const &)
- ?tr@QIdentityProxyModel@@SA?AVQString@@PBD0@Z @ 13756 NONAME ; class QString QIdentityProxyModel::tr(char const *, char const *)
- ?qt_static_metacall@QFileDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13757 NONAME ; void QFileDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QInternalMimeData@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13758 NONAME ; void QInternalMimeData::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13759 NONAME ; void QGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?hasFormatHelper@QInternalMimeData@@SA_NABVQString@@PBVQMimeData@@@Z @ 13760 NONAME ; bool QInternalMimeData::hasFormatHelper(class QString const &, class QMimeData const *)
- ?state@QBlitterPaintEngine@@QAEPAVQPainterState@@XZ @ 13761 NONAME ; class QPainterState * QBlitterPaintEngine::state(void)
- ?penChanged@QBlitterPaintEngine@@UAEXXZ @ 13762 NONAME ; void QBlitterPaintEngine::penChanged(void)
- ??0QFileOpenEvent@@QAE@ABVRFile@@@Z @ 13763 NONAME ; QFileOpenEvent::QFileOpenEvent(class RFile const &)
- ?staticMetaObjectExtraData@QStackedLayout@@0UQMetaObjectExtraData@@B @ 13764 NONAME ; struct QMetaObjectExtraData const QStackedLayout::staticMetaObjectExtraData
- ?match@QIdentityProxyModel@@UBE?AV?$QList@VQModelIndex@@@@ABVQModelIndex@@HABVQVariant@@HV?$QFlags@W4MatchFlag@Qt@@@@@Z @ 13765 NONAME ; class QList<class QModelIndex> QIdentityProxyModel::match(class QModelIndex const &, int, class QVariant const &, int, class QFlags<enum Qt::MatchFlag>) const
- ?hasHeightForWidth@QWidgetPrivate@@UBE_NXZ @ 13766 NONAME ; bool QWidgetPrivate::hasHeightForWidth(void) const
- ?qt_static_metacall@QMessageBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13767 NONAME ; void QMessageBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObjectExtraData@QSortFilterProxyModel@@0UQMetaObjectExtraData@@B @ 13768 NONAME ; struct QMetaObjectExtraData const QSortFilterProxyModel::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QCommandLinkButton@@0UQMetaObjectExtraData@@B @ 13769 NONAME ; struct QMetaObjectExtraData const QCommandLinkButton::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QWidget@@0UQMetaObjectExtraData@@B @ 13770 NONAME ; struct QMetaObjectExtraData const QWidget::staticMetaObjectExtraData
- ?toImage@QBlittablePixmapData@@UBE?AVQImage@@XZ @ 13771 NONAME ; class QImage QBlittablePixmapData::toImage(void) const
- ??_EQBlittable@@UAE@I@Z @ 13772 NONAME ; QBlittable::~QBlittable(unsigned int)
- ?staticMetaObject@QIdentityProxyModel@@2UQMetaObject@@B @ 13773 NONAME ; struct QMetaObject const QIdentityProxyModel::staticMetaObject
- ?rowCount@QIdentityProxyModel@@UBEHABVQModelIndex@@@Z @ 13774 NONAME ; int QIdentityProxyModel::rowCount(class QModelIndex const &) const
- ?trUtf8@QIdentityProxyModel@@SA?AVQString@@PBD0@Z @ 13775 NONAME ; class QString QIdentityProxyModel::trUtf8(char const *, char const *)
- ?qt_static_metacall@QRadioButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13776 NONAME ; void QRadioButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??1QInternalMimeData@@UAE@XZ @ 13777 NONAME ; QInternalMimeData::~QInternalMimeData(void)
- ?cursorMoveStyle@QTextLayout@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 13778 NONAME ABSENT ; enum QTextCursor::MoveStyle QTextLayout::cursorMoveStyle(void) const
- ?qt_addBitmapToPath@@YAXMMPBEHHHPAVQPainterPath@@@Z @ 13779 NONAME ; void qt_addBitmapToPath(float, float, unsigned char const *, int, int, int, class QPainterPath *)
- ?qt_static_metacall@QTextTable@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13780 NONAME ; void QTextTable::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QItemSelectionModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13781 NONAME ; void QItemSelectionModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?staticMetaObject@QInternalMimeData@@2UQMetaObject@@B @ 13782 NONAME ; struct QMetaObject const QInternalMimeData::staticMetaObject
- ?staticMetaObjectExtraData@QGraphicsTransform@@0UQMetaObjectExtraData@@B @ 13783 NONAME ; struct QMetaObjectExtraData const QGraphicsTransform::staticMetaObjectExtraData
- ?staticMetaObjectExtraData@QAbstractTextDocumentLayout@@0UQMetaObjectExtraData@@B @ 13784 NONAME ; struct QMetaObjectExtraData const QAbstractTextDocumentLayout::staticMetaObjectExtraData
- ?qt_static_metacall@QGraphicsWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13785 NONAME ; void QGraphicsWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?qt_static_metacall@QShortcut@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13786 NONAME ; void QShortcut::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ?endOfLine@QTextEngine@@AAEHH@Z @ 13787 NONAME ; int QTextEngine::endOfLine(int)
- ?setCursorMoveStyle@QTextLayout@@QAEXW4CursorMoveStyle@Qt@@@Z @ 13788 NONAME ; void QTextLayout::setCursorMoveStyle(enum Qt::CursorMoveStyle)
- ?defaultCursorMoveStyle@QTextDocument@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 13789 NONAME ; enum Qt::CursorMoveStyle QTextDocument::defaultCursorMoveStyle(void) const
- ?cursorMoveStyle@QTextLayout@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 13790 NONAME ; enum Qt::CursorMoveStyle QTextLayout::cursorMoveStyle(void) const
- ?setDefaultCursorMoveStyle@QTextDocument@@QAEXW4CursorMoveStyle@Qt@@@Z @ 13791 NONAME ; void QTextDocument::setDefaultCursorMoveStyle(enum Qt::CursorMoveStyle)
- ?setCursorMoveStyle@QLineControl@@QAEXW4CursorMoveStyle@Qt@@@Z @ 13792 NONAME ; void QLineControl::setCursorMoveStyle(enum Qt::CursorMoveStyle)
- ?cursorMoveStyle@QLineEdit@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 13793 NONAME ; enum Qt::CursorMoveStyle QLineEdit::cursorMoveStyle(void) const
- ?forceToRaster@QSymbianGraphicsSystemEx@@UAEXPAVQWidget@@@Z @ 13794 NONAME ; void QSymbianGraphicsSystemEx::forceToRaster(class QWidget *)
- ?releaseCachedGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 13795 NONAME ; void QSymbianGraphicsSystemEx::releaseCachedGpuResources(void)
- ?setCursorMoveStyle@QLineEdit@@QAEXW4CursorMoveStyle@Qt@@@Z @ 13796 NONAME ; void QLineEdit::setCursorMoveStyle(enum Qt::CursorMoveStyle)
- ?platformExtension@QGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 13797 NONAME ; class QGraphicsSystemEx * QGraphicsSystem::platformExtension(void)
- ?releaseAllGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 13798 NONAME ; void QSymbianGraphicsSystemEx::releaseAllGpuResources(void)
- ?cursorMoveStyle@QLineControl@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 13799 NONAME ; enum Qt::CursorMoveStyle QLineControl::cursorMoveStyle(void) const
- ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 13800 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void)
+ ??_EQScrollerProperties@@UAE@I@Z @ 13203 NONAME ABSENT ; QScrollerProperties::~QScrollerProperties(unsigned int)
+ ??_EQFontPrivate@@QAE@I@Z @ 13204 NONAME ABSENT ; QFontPrivate::~QFontPrivate(unsigned int)
+ ??0QMimeSource@@QAE@XZ @ 13205 NONAME ABSENT ; QMimeSource::QMimeSource(void)
+ ??0QStyleFactoryInterface@@QAE@XZ @ 13206 NONAME ABSENT ; QStyleFactoryInterface::QStyleFactoryInterface(void)
+ ?d_func@QScrollEvent@@AAEPAVQScrollEventPrivate@@XZ @ 13207 NONAME ABSENT ; class QScrollEventPrivate * QScrollEvent::d_func(void)
+ ??0QFileOpenEvent@@QAE@ABV0@@Z @ 13208 NONAME ABSENT ; QFileOpenEvent::QFileOpenEvent(class QFileOpenEvent const &)
+ ??4QStyleOptionViewItemV2@@QAEAAV0@ABV0@@Z @ 13209 NONAME ABSENT ; class QStyleOptionViewItemV2 & QStyleOptionViewItemV2::operator=(class QStyleOptionViewItemV2 const &)
+ ?heightForWidth@QTabWidget@@UBEHH@Z @ 13210 NONAME ; int QTabWidget::heightForWidth(int) const
+ ??1QFlickGesture@@UAE@XZ @ 13211 NONAME ABSENT ; QFlickGesture::~QFlickGesture(void)
+ ??0QRasterWindowSurface@@QAE@PAVQWidget@@_N@Z @ 13212 NONAME ; QRasterWindowSurface::QRasterWindowSurface(class QWidget *, bool)
+ ?brushChanged@QBlitterPaintEngine@@UAEXXZ @ 13213 NONAME ; void QBlitterPaintEngine::brushChanged(void)
+ ?clip@QBlitterPaintEngine@@UAEXABVQRect@@W4ClipOperation@Qt@@@Z @ 13214 NONAME ; void QBlitterPaintEngine::clip(class QRect const &, enum Qt::ClipOperation)
+ ?detach@QGlyphs@@AAEXXZ @ 13215 NONAME ABSENT ; void QGlyphs::detach(void)
+ ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13216 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *)
+ ??0QShowEvent@@QAE@ABV0@@Z @ 13217 NONAME ABSENT ; QShowEvent::QShowEvent(class QShowEvent const &)
+ ??0QMouseEvent@@QAE@ABV0@@Z @ 13218 NONAME ABSENT ; QMouseEvent::QMouseEvent(class QMouseEvent const &)
+ ?setHintingPreference@QFont@@QAEXW4HintingPreference@1@@Z @ 13219 NONAME ; void QFont::setHintingPreference(enum QFont::HintingPreference)
+ ??0QActionEvent@@QAE@ABV0@@Z @ 13220 NONAME ABSENT ; QActionEvent::QActionEvent(class QActionEvent const &)
+ ??0QTouchEvent@@QAE@ABV0@@Z @ 13221 NONAME ABSENT ; QTouchEvent::QTouchEvent(class QTouchEvent const &)
+ ?capabilities@QBlittable@@QBE?AV?$QFlags@W4Capability@QBlittable@@@@XZ @ 13222 NONAME ; class QFlags<enum QBlittable::Capability> QBlittable::capabilities(void) const
+ ?setContentPosRange@QScrollPrepareEvent@@QAEXABVQRectF@@@Z @ 13223 NONAME ABSENT ; void QScrollPrepareEvent::setContentPosRange(class QRectF const &)
+ ??_EQImageData@@QAE@I@Z @ 13224 NONAME ABSENT ; QImageData::~QImageData(unsigned int)
+ ?swap@QBrush@@QAEXAAV1@@Z @ 13225 NONAME ; void QBrush::swap(class QBrush &)
+ ?trUtf8@QFlickGesture@@SA?AVQString@@PBD0H@Z @ 13226 NONAME ABSENT ; class QString QFlickGesture::trUtf8(char const *, char const *, int)
+ ?fontHintingPreference@QTextCharFormat@@QBE?AW4HintingPreference@QFont@@XZ @ 13227 NONAME ; enum QFont::HintingPreference QTextCharFormat::fontHintingPreference(void) const
+ ?swap@QPixmap@@QAEXAAV1@@Z @ 13228 NONAME ; void QPixmap::swap(class QPixmap &)
+ ??0QBlitterPaintEngine@@QAE@PAVQBlittablePixmapData@@@Z @ 13229 NONAME ; QBlitterPaintEngine::QBlitterPaintEngine(class QBlittablePixmapData *)
+ ?numberPrefix@QTextListFormat@@QBE?AVQString@@XZ @ 13230 NONAME ; class QString QTextListFormat::numberPrefix(void) const
+ ?setSnapPositionsX@QScroller@@QAEXMM@Z @ 13231 NONAME ABSENT ; void QScroller::setSnapPositionsX(float, float)
+ ?scroller@QScroller@@SAPBV1@PBVQObject@@@Z @ 13232 NONAME ABSENT ; class QScroller const * QScroller::scroller(class QObject const *)
+ ?qt_metacall@QScroller@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13233 NONAME ABSENT ; int QScroller::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?tr@QFlickGesture@@SA?AVQString@@PBD0@Z @ 13234 NONAME ABSENT ; class QString QFlickGesture::tr(char const *, char const *)
+ ??4QBezier@@QAEAAV0@ABV0@@Z @ 13235 NONAME ABSENT ; class QBezier & QBezier::operator=(class QBezier const &)
+ ?setScrollerProperties@QScroller@@QAEXABVQScrollerProperties@@@Z @ 13236 NONAME ABSENT ; void QScroller::setScrollerProperties(class QScrollerProperties const &)
+ ??0QIconEngineV2@@QAE@XZ @ 13237 NONAME ABSENT ; QIconEngineV2::QIconEngineV2(void)
+ ??4iterator@QTextBlock@@QAEAAV01@ABV01@@Z @ 13238 NONAME ABSENT ; class QTextBlock::iterator & QTextBlock::iterator::operator=(class QTextBlock::iterator const &)
+ ??MQItemSelectionRange@@QBE_NABV0@@Z @ 13239 NONAME ; bool QItemSelectionRange::operator<(class QItemSelectionRange const &) const
+ ?setWidthForHeight@QSizePolicy@@QAEX_N@Z @ 13240 NONAME ; void QSizePolicy::setWidthForHeight(bool)
+ ?qt_fontdata_from_index@@YA?AVQByteArray@@H@Z @ 13241 NONAME ; class QByteArray qt_fontdata_from_index(int)
+ ??0QIconEngineV2@@QAE@ABV0@@Z @ 13242 NONAME ABSENT ; QIconEngineV2::QIconEngineV2(class QIconEngineV2 const &)
+ ?swap@QImage@@QAEXAAV1@@Z @ 13243 NONAME ; void QImage::swap(class QImage &)
+ ??0QIconEngineFactoryInterfaceV2@@QAE@XZ @ 13244 NONAME ABSENT ; QIconEngineFactoryInterfaceV2::QIconEngineFactoryInterfaceV2(void)
+ ??0QScroller@@AAE@PAVQObject@@@Z @ 13245 NONAME ABSENT ; QScroller::QScroller(class QObject *)
+ ?compositionModeChanged@QBlitterPaintEngine@@UAEXXZ @ 13246 NONAME ; void QBlitterPaintEngine::compositionModeChanged(void)
+ ?contentPosRange@QScrollPrepareEvent@@QBE?AVQRectF@@XZ @ 13247 NONAME ABSENT ; class QRectF QScrollPrepareEvent::contentPosRange(void) const
+ ?grabGesture@QScroller@@SA?AW4GestureType@Qt@@PAVQObject@@W4ScrollerGestureType@1@@Z @ 13248 NONAME ABSENT ; enum Qt::GestureType QScroller::grabGesture(class QObject *, enum QScroller::ScrollerGestureType)
+ ??_EQFlickGesture@@UAE@I@Z @ 13249 NONAME ABSENT ; QFlickGesture::~QFlickGesture(unsigned int)
+ ?drawRects@QBlitterPaintEngine@@UAEXPBVQRectF@@H@Z @ 13250 NONAME ; void QBlitterPaintEngine::drawRects(class QRectF const *, int)
+ ??4QTextLine@@QAEAAV0@ABV0@@Z @ 13251 NONAME ABSENT ; class QTextLine & QTextLine::operator=(class QTextLine const &)
+ ??0QToolBarChangeEvent@@QAE@ABV0@@Z @ 13252 NONAME ABSENT ; QToolBarChangeEvent::QToolBarChangeEvent(class QToolBarChangeEvent const &)
+ ??1QBlitterPaintEngine@@UAE@XZ @ 13253 NONAME ; QBlitterPaintEngine::~QBlitterPaintEngine(void)
+ ?markRasterOverlay@QBlittablePixmapData@@QAEXPBVQRectF@@H@Z @ 13254 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRectF const *, int)
+ ??0QResizeEvent@@QAE@ABV0@@Z @ 13255 NONAME ABSENT ; QResizeEvent::QResizeEvent(class QResizeEvent const &)
+ ??0QIconEngineFactoryInterface@@QAE@XZ @ 13256 NONAME ABSENT ; QIconEngineFactoryInterface::QIconEngineFactoryInterface(void)
+ ?drawTextItem@QBlitterPaintEngine@@UAEXABVQPointF@@ABVQTextItem@@@Z @ 13257 NONAME ; void QBlitterPaintEngine::drawTextItem(class QPointF const &, class QTextItem const &)
+ ??0QPictureFormatInterface@@QAE@XZ @ 13258 NONAME ABSENT ; QPictureFormatInterface::QPictureFormatInterface(void)
+ ?trUtf8@QFlickGesture@@SA?AVQString@@PBD0@Z @ 13259 NONAME ABSENT ; class QString QFlickGesture::trUtf8(char const *, char const *)
+ ?stop@QScroller@@QAEXXZ @ 13260 NONAME ABSENT ; void QScroller::stop(void)
+ ?retrieveData@QInternalMimeData@@MBE?AVQVariant@@ABVQString@@W4Type@2@@Z @ 13261 NONAME ; class QVariant QInternalMimeData::retrieveData(class QString const &, enum QVariant::Type) const
+ ??8QGlyphs@@QBE_NABV0@@Z @ 13262 NONAME ABSENT ; bool QGlyphs::operator==(class QGlyphs const &) const
+ ?drawImage@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQImage@@0V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 13263 NONAME ; void QBlitterPaintEngine::drawImage(class QRectF const &, class QImage const &, class QRectF const &, class QFlags<enum Qt::ImageConversionFlag>)
+ ?contentPos@QScrollEvent@@QBE?AVQPointF@@XZ @ 13264 NONAME ABSENT ; class QPointF QScrollEvent::contentPos(void) const
+ ?mimeTypes@QAbstractProxyModel@@UBE?AVQStringList@@XZ @ 13265 NONAME ; class QStringList QAbstractProxyModel::mimeTypes(void) const
+ ?createState@QBlitterPaintEngine@@UBEPAVQPainterState@@PAV2@@Z @ 13266 NONAME ; class QPainterState * QBlitterPaintEngine::createState(class QPainterState *) const
+ ?removeItem@QGraphicsGridLayout@@QAEXPAVQGraphicsLayoutItem@@@Z @ 13267 NONAME ; void QGraphicsGridLayout::removeItem(class QGraphicsLayoutItem *)
+ ?clipBoundingRect@QPainter@@QBE?AVQRectF@@XZ @ 13268 NONAME ; class QRectF QPainter::clipBoundingRect(void) const
+ ?formats@QInternalMimeData@@UBE?AVQStringList@@XZ @ 13269 NONAME ; class QStringList QInternalMimeData::formats(void) const
+ ?stateChanged@QScroller@@IAEXW4State@1@@Z @ 13270 NONAME ABSENT ; void QScroller::stateChanged(enum QScroller::State)
+ ?raster@QBlitterPaintEngine@@ABEPAVQRasterPaintEngine@@XZ @ 13271 NONAME ; class QRasterPaintEngine * QBlitterPaintEngine::raster(void) const
+ ?sort@QAbstractProxyModel@@UAEXHW4SortOrder@Qt@@@Z @ 13272 NONAME ; void QAbstractProxyModel::sort(int, enum Qt::SortOrder)
+ ?d_func@QBlittable@@AAEPAVQBlittablePrivate@@XZ @ 13273 NONAME ; class QBlittablePrivate * QBlittable::d_func(void)
+ ?setDefaultScrollerProperties@QScrollerProperties@@SAXABV1@@Z @ 13274 NONAME ABSENT ; void QScrollerProperties::setDefaultScrollerProperties(class QScrollerProperties const &)
+ ??_EQPolygon@@QAE@I@Z @ 13275 NONAME ABSENT ; QPolygon::~QPolygon(unsigned int)
+ ?type@QBlitterPaintEngine@@UBE?AW4Type@QPaintEngine@@XZ @ 13276 NONAME ; enum QPaintEngine::Type QBlitterPaintEngine::type(void) const
+ ?qt_metacast@QScroller@@UAEPAXPBD@Z @ 13277 NONAME ABSENT ; void * QScroller::qt_metacast(char const *)
+ ??_EQImageReader@@QAE@I@Z @ 13278 NONAME ABSENT ; QImageReader::~QImageReader(unsigned int)
+ ?buddy@QAbstractProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13279 NONAME ; class QModelIndex QAbstractProxyModel::buddy(class QModelIndex const &) const
+ ?tr@QScroller@@SA?AVQString@@PBD0H@Z @ 13280 NONAME ABSENT ; class QString QScroller::tr(char const *, char const *, int)
+ ?fill@QImage@@QAEXABVQColor@@@Z @ 13281 NONAME ; void QImage::fill(class QColor const &)
+ ?scrollMetric@QScrollerProperties@@QBE?AVQVariant@@W4ScrollMetric@1@@Z @ 13282 NONAME ABSENT ; class QVariant QScrollerProperties::scrollMetric(enum QScrollerProperties::ScrollMetric) const
+ ?fill@QImage@@QAEXW4GlobalColor@Qt@@@Z @ 13283 NONAME ; void QImage::fill(enum Qt::GlobalColor)
+ ??4QStyleOptionGraphicsItem@@QAEAAV0@ABV0@@Z @ 13284 NONAME ABSENT ; class QStyleOptionGraphicsItem & QStyleOptionGraphicsItem::operator=(class QStyleOptionGraphicsItem const &)
+ ?canFetchMore@QAbstractProxyModel@@UBE_NABVQModelIndex@@@Z @ 13285 NONAME ; bool QAbstractProxyModel::canFetchMore(class QModelIndex const &) const
+ ??4QStyleOptionProgressBarV2@@QAEAAV0@ABV0@@Z @ 13286 NONAME ABSENT ; class QStyleOptionProgressBarV2 & QStyleOptionProgressBarV2::operator=(class QStyleOptionProgressBarV2 const &)
+ ??1QScroller@@EAE@XZ @ 13287 NONAME ABSENT ; QScroller::~QScroller(void)
+ ?setFont@QGlyphs@@QAEXABVQFont@@@Z @ 13288 NONAME ABSENT ; void QGlyphs::setFont(class QFont const &)
+ ?startPos@QScrollPrepareEvent@@QBE?AVQPointF@@XZ @ 13289 NONAME ABSENT ; class QPointF QScrollPrepareEvent::startPos(void) const
+ ?resize@QBlittablePixmapData@@UAEXHH@Z @ 13290 NONAME ; void QBlittablePixmapData::resize(int, int)
+ ?setTabsClosable@QMdiArea@@QAEX_N@Z @ 13291 NONAME ; void QMdiArea::setTabsClosable(bool)
+ ?ensureVisible@QScroller@@QAEXABVQRectF@@MM@Z @ 13292 NONAME ABSENT ; void QScroller::ensureVisible(class QRectF const &, float, float)
+ ?getText@QInputDialog@@SA?AVQString@@PAVQWidget@@ABV2@1W4EchoMode@QLineEdit@@1PA_NV?$QFlags@W4WindowType@Qt@@@@V?$QFlags@W4InputMethodHint@Qt@@@@@Z @ 13293 NONAME ; class QString QInputDialog::getText(class QWidget *, class QString const &, class QString const &, enum QLineEdit::EchoMode, class QString const &, bool *, class QFlags<enum Qt::WindowType>, class QFlags<enum Qt::InputMethodHint>)
+ ?hasWidthForHeight@QSizePolicy@@QBE_NXZ @ 13294 NONAME ; bool QSizePolicy::hasWidthForHeight(void) const
+ ?transformChanged@QBlitterPaintEngine@@UAEXXZ @ 13295 NONAME ; void QBlitterPaintEngine::transformChanged(void)
+ ??0QDragEnterEvent@@QAE@ABV0@@Z @ 13296 NONAME ABSENT ; QDragEnterEvent::QDragEnterEvent(class QDragEnterEvent const &)
+ ??0QBlittablePixmapData@@QAE@XZ @ 13297 NONAME ; QBlittablePixmapData::QBlittablePixmapData(void)
+ ??_EKey@QPixmapCache@@QAE@I@Z @ 13298 NONAME ABSENT ; QPixmapCache::Key::~Key(unsigned int)
+ ??_EQCursor@@QAE@I@Z @ 13299 NONAME ABSENT ; QCursor::~QCursor(unsigned int)
+ ?size@QBlittable@@QBE?AVQSize@@XZ @ 13300 NONAME ; class QSize QBlittable::size(void) const
+ ??0QShortcutEvent@@QAE@ABV0@@Z @ 13301 NONAME ABSENT ; QShortcutEvent::QShortcutEvent(class QShortcutEvent const &)
+ ?setBlittable@QBlittablePixmapData@@QAEXPAVQBlittable@@@Z @ 13302 NONAME ; void QBlittablePixmapData::setBlittable(class QBlittable *)
+ ?opacityChanged@QBlitterPaintEngine@@UAEXXZ @ 13303 NONAME ; void QBlitterPaintEngine::opacityChanged(void)
+ ?tr@QFlickGesture@@SA?AVQString@@PBD0H@Z @ 13304 NONAME ABSENT ; class QString QFlickGesture::tr(char const *, char const *, int)
+ ??_EQTextCursor@@QAE@I@Z @ 13305 NONAME ABSENT ; QTextCursor::~QTextCursor(unsigned int)
+ ?createExplicitFontWithName@QFontEngine@@IBE?AVQFont@@ABVQString@@@Z @ 13306 NONAME ABSENT ; class QFont QFontEngine::createExplicitFontWithName(class QString const &) const
+ ?setState@QBlitterPaintEngine@@UAEXPAVQPainterState@@@Z @ 13307 NONAME ; void QBlitterPaintEngine::setState(class QPainterState *)
+ ?clip@QBlitterPaintEngine@@UAEXABVQRegion@@W4ClipOperation@Qt@@@Z @ 13308 NONAME ; void QBlitterPaintEngine::clip(class QRegion const &, enum Qt::ClipOperation)
+ ?subPixelPositionForX@QTextureGlyphCache@@QBE?AUQFixed@@U2@@Z @ 13309 NONAME ; struct QFixed QTextureGlyphCache::subPixelPositionForX(struct QFixed) const
+ ?hasAlphaChannel@QBlittablePixmapData@@UBE_NXZ @ 13310 NONAME ; bool QBlittablePixmapData::hasAlphaChannel(void) const
+ ?setSnapPositionsX@QScroller@@QAEXABV?$QList@M@@@Z @ 13311 NONAME ABSENT ; void QScroller::setSnapPositionsX(class QList<float> const &)
+ ?numberSuffix@QTextListFormat@@QBE?AVQString@@XZ @ 13312 NONAME ; class QString QTextListFormat::numberSuffix(void) const
+ ??HQGlyphs@@ABE?AV0@ABV0@@Z @ 13313 NONAME ABSENT ; class QGlyphs QGlyphs::operator+(class QGlyphs const &) const
+ ??0QGradient@@QAE@ABV0@@Z @ 13314 NONAME ABSENT ; QGradient::QGradient(class QGradient const &)
+ ?tabsMovable@QMdiArea@@QBE_NXZ @ 13315 NONAME ; bool QMdiArea::tabsMovable(void) const
+ ??4QInputMethodEvent@@QAEAAV0@ABV0@@Z @ 13316 NONAME ABSENT ; class QInputMethodEvent & QInputMethodEvent::operator=(class QInputMethodEvent const &)
+ ?contentPos@QScrollPrepareEvent@@QBE?AVQPointF@@XZ @ 13317 NONAME ABSENT ; class QPointF QScrollPrepareEvent::contentPos(void) const
+ ?getStaticMetaObject@QScroller@@SAABUQMetaObject@@XZ @ 13318 NONAME ABSENT ; struct QMetaObject const & QScroller::getStaticMetaObject(void)
+ ?end@QBlitterPaintEngine@@UAE_NXZ @ 13319 NONAME ; bool QBlitterPaintEngine::end(void)
+ ??1QScrollerProperties@@UAE@XZ @ 13320 NONAME ABSENT ; QScrollerProperties::~QScrollerProperties(void)
+ ??0QFlickGesture@@QAE@PAVQObject@@W4MouseButton@Qt@@0@Z @ 13321 NONAME ABSENT ; QFlickGesture::QFlickGesture(class QObject *, enum Qt::MouseButton, class QObject *)
+ ?fill@QBlitterPaintEngine@@UAEXABVQVectorPath@@ABVQBrush@@@Z @ 13322 NONAME ; void QBlitterPaintEngine::fill(class QVectorPath const &, class QBrush const &)
+ ?drawPixmap@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQPixmap@@0@Z @ 13323 NONAME ; void QBlitterPaintEngine::drawPixmap(class QRectF const &, class QPixmap const &, class QRectF const &)
+ ??0QVector2D@@QAE@ABV0@@Z @ 13324 NONAME ABSENT ; QVector2D::QVector2D(class QVector2D const &)
+ ?setSnapPositionsY@QScroller@@QAEXABV?$QList@M@@@Z @ 13325 NONAME ABSENT ; void QScroller::setSnapPositionsY(class QList<float> const &)
+ ??4QStyleOptionFocusRect@@QAEAAV0@ABV0@@Z @ 13326 NONAME ABSENT ; class QStyleOptionFocusRect & QStyleOptionFocusRect::operator=(class QStyleOptionFocusRect const &)
+ ??_EQPen@@QAE@I@Z @ 13327 NONAME ABSENT ; QPen::~QPen(unsigned int)
+ ??_EQKeySequence@@QAE@I@Z @ 13328 NONAME ABSENT ; QKeySequence::~QKeySequence(unsigned int)
+ ?tr@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13329 NONAME ; class QString QInternalMimeData::tr(char const *, char const *, int)
+ ?velocity@QScroller@@QBE?AVQPointF@@XZ @ 13330 NONAME ABSENT ; class QPointF QScroller::velocity(void) const
+ ?glyphIndexes@QGlyphs@@QBE?AV?$QVector@I@@XZ @ 13331 NONAME ABSENT ; class QVector<unsigned int> QGlyphs::glyphIndexes(void) const
+ ?get@QFontPrivate@@SAPAV1@ABVQFont@@@Z @ 13332 NONAME ; class QFontPrivate * QFontPrivate::get(class QFont const &)
+ ?setScrollMetric@QScrollerProperties@@QAEXW4ScrollMetric@1@ABVQVariant@@@Z @ 13333 NONAME ABSENT ; void QScrollerProperties::setScrollMetric(enum QScrollerProperties::ScrollMetric, class QVariant const &)
+ ??4QGradient@@QAEAAV0@ABV0@@Z @ 13334 NONAME ABSENT ; class QGradient & QGradient::operator=(class QGradient const &)
+ ??0QScrollEvent@@QAE@ABVQPointF@@0W4ScrollState@0@@Z @ 13335 NONAME ABSENT ; QScrollEvent::QScrollEvent(class QPointF const &, class QPointF const &, enum QScrollEvent::ScrollState)
+ ?d_func@QFlickGesture@@AAEPAVQFlickGesturePrivate@@XZ @ 13336 NONAME ABSENT ; class QFlickGesturePrivate * QFlickGesture::d_func(void)
+ ?scrollState@QScrollEvent@@QBE?AW4ScrollState@1@XZ @ 13337 NONAME ABSENT ; enum QScrollEvent::ScrollState QScrollEvent::scrollState(void) const
+ ??0QTextTableFormat@@QAE@ABV0@@Z @ 13338 NONAME ABSENT ; QTextTableFormat::QTextTableFormat(class QTextTableFormat const &)
+ ??_EQImagePixmapCleanupHooks@@QAE@I@Z @ 13339 NONAME ABSENT ; QImagePixmapCleanupHooks::~QImagePixmapCleanupHooks(unsigned int)
+ ?fetchMore@QAbstractProxyModel@@UAEXABVQModelIndex@@@Z @ 13340 NONAME ; void QAbstractProxyModel::fetchMore(class QModelIndex const &)
+ ?glyphs@QTextLine@@ABE?AV?$QList@VQGlyphs@@@@HH@Z @ 13341 NONAME ABSENT ; class QList<class QGlyphs> QTextLine::glyphs(int, int) const
+ ?getStaticMetaObject@QFlickGesture@@SAABUQMetaObject@@XZ @ 13342 NONAME ABSENT ; struct QMetaObject const & QFlickGesture::getStaticMetaObject(void)
+ ?setViewportSize@QScrollPrepareEvent@@QAEXABVQSizeF@@@Z @ 13343 NONAME ABSENT ; void QScrollPrepareEvent::setViewportSize(class QSizeF const &)
+ ??0QStatusTipEvent@@QAE@ABV0@@Z @ 13344 NONAME ABSENT ; QStatusTipEvent::QStatusTipEvent(class QStatusTipEvent const &)
+ ??0Value@QCss@@QAE@ABU01@@Z @ 13345 NONAME ABSENT ; QCss::Value::Value(struct QCss::Value const &)
+ ?d_func@QScrollPrepareEvent@@AAEPAVQScrollPrepareEventPrivate@@XZ @ 13346 NONAME ABSENT ; class QScrollPrepareEventPrivate * QScrollPrepareEvent::d_func(void)
+ ?overshootDistance@QScrollEvent@@QBE?AVQPointF@@XZ @ 13347 NONAME ABSENT ; class QPointF QScrollEvent::overshootDistance(void) const
+ ?resolveFontFamilyAlias@QFontDatabase@@CA?AVQString@@ABV2@@Z @ 13348 NONAME ; class QString QFontDatabase::resolveFontFamilyAlias(class QString const &)
+ ?alphaRGBMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@HABVQTransform@@@Z @ 13349 NONAME ; class QImage QFontEngine::alphaRGBMapForGlyph(unsigned int, struct QFixed, int, class QTransform const &)
+ ??4QSizePolicy@@QAEAAV0@ABV0@@Z @ 13350 NONAME ABSENT ; class QSizePolicy & QSizePolicy::operator=(class QSizePolicy const &)
+ ?swap@QBitmap@@QAEXAAV1@@Z @ 13351 NONAME ; void QBitmap::swap(class QBitmap &)
+ ?hasFormat@QInternalMimeData@@UBE_NABVQString@@@Z @ 13352 NONAME ; bool QInternalMimeData::hasFormat(class QString const &) const
+ ?renderDataHelper@QInternalMimeData@@SA?AVQByteArray@@ABVQString@@PBVQMimeData@@@Z @ 13353 NONAME ; class QByteArray QInternalMimeData::renderDataHelper(class QString const &, class QMimeData const *)
+ ??_ETouchPoint@QTouchEvent@@QAE@I@Z @ 13354 NONAME ABSENT ; QTouchEvent::TouchPoint::~TouchPoint(unsigned int)
+ ??0QWindowSurface@@QAE@PAVQWidget@@_N@Z @ 13355 NONAME ; QWindowSurface::QWindowSurface(class QWidget *, bool)
+ ?fill@QBlittablePixmapData@@UAEXABVQColor@@@Z @ 13356 NONAME ; void QBlittablePixmapData::fill(class QColor const &)
+ ?metric@QBlittablePixmapData@@UBEHW4PaintDeviceMetric@QPaintDevice@@@Z @ 13357 NONAME ; int QBlittablePixmapData::metric(enum QPaintDevice::PaintDeviceMetric) const
+ ??4QItemSelection@@QAEAAV0@ABV0@@Z @ 13358 NONAME ABSENT ; class QItemSelection & QItemSelection::operator=(class QItemSelection const &)
+ ?fillRect@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQColor@@@Z @ 13359 NONAME ; void QBlitterPaintEngine::fillRect(class QRectF const &, class QColor const &)
+ ??4QStyleOptionQ3ListView@@QAEAAV0@ABV0@@Z @ 13360 NONAME ABSENT ; class QStyleOptionQ3ListView & QStyleOptionQ3ListView::operator=(class QStyleOptionQ3ListView const &)
+ ??6@YA?AVQDebug@@V0@PBVQSymbianEvent@@@Z @ 13361 NONAME ; class QDebug operator<<(class QDebug, class QSymbianEvent const *)
+ ??0QSizePolicy@@QAE@ABV0@@Z @ 13362 NONAME ABSENT ; QSizePolicy::QSizePolicy(class QSizePolicy const &)
+ ?ProcessCommandParametersL@QS60MainAppUi@@UAEHW4TApaCommand@@AAV?$TBuf@$0BAA@@@ABVTDesC8@@@Z @ 13363 NONAME ; int QS60MainAppUi::ProcessCommandParametersL(enum TApaCommand, class TBuf<256> &, class TDesC8 const &)
+ ?scrollerProperties@QScroller@@QBE?AVQScrollerProperties@@XZ @ 13364 NONAME ABSENT ; class QScrollerProperties QScroller::scrollerProperties(void) const
+ ??_EQBlittablePixmapData@@UAE@I@Z @ 13365 NONAME ; QBlittablePixmapData::~QBlittablePixmapData(unsigned int)
+ ?mimeData@QAbstractProxyModel@@UBEPAVQMimeData@@ABV?$QList@VQModelIndex@@@@@Z @ 13366 NONAME ; class QMimeData * QAbstractProxyModel::mimeData(class QList<class QModelIndex> const &) const
+ ??4QStyleOptionFrameV2@@QAEAAV0@ABV0@@Z @ 13367 NONAME ABSENT ; class QStyleOptionFrameV2 & QStyleOptionFrameV2::operator=(class QStyleOptionFrameV2 const &)
+ ??_EQScroller@@UAE@I@Z @ 13368 NONAME ABSENT ; QScroller::~QScroller(unsigned int)
+ ??1QScrollPrepareEvent@@UAE@XZ @ 13369 NONAME ABSENT ; QScrollPrepareEvent::~QScrollPrepareEvent(void)
+ ??4QVector3D@@QAEAAV0@ABV0@@Z @ 13370 NONAME ABSENT ; class QVector3D & QVector3D::operator=(class QVector3D const &)
+ ?setTabsMovable@QMdiArea@@QAEX_N@Z @ 13371 NONAME ; void QMdiArea::setTabsMovable(bool)
+ ?minimumSizeHint@QRadioButton@@UBE?AVQSize@@XZ @ 13372 NONAME ; class QSize QRadioButton::minimumSizeHint(void) const
+ ??4QStyleOptionQ3DockWindow@@QAEAAV0@ABV0@@Z @ 13373 NONAME ABSENT ; class QStyleOptionQ3DockWindow & QStyleOptionQ3DockWindow::operator=(class QStyleOptionQ3DockWindow const &)
+ ?qt_metacast@QFlickGesture@@UAEPAXPBD@Z @ 13374 NONAME ABSENT ; void * QFlickGesture::qt_metacast(char const *)
+ ??_EQFont@@QAE@I@Z @ 13375 NONAME ABSENT ; QFont::~QFont(unsigned int)
+ ?setPositions@QGlyphs@@QAEXABV?$QVector@VQPointF@@@@@Z @ 13376 NONAME ABSENT ; void QGlyphs::setPositions(class QVector<class QPointF> const &)
+ ??4QStyleOptionDockWidget@@QAEAAV0@ABV0@@Z @ 13377 NONAME ABSENT ; class QStyleOptionDockWidget & QStyleOptionDockWidget::operator=(class QStyleOptionDockWidget const &)
+ ??0QPainterState@@QAE@ABV0@@Z @ 13378 NONAME ABSENT ; QPainterState::QPainterState(class QPainterState const &)
+ ??4QStyleOptionFrame@@QAEAAV0@ABV0@@Z @ 13379 NONAME ABSENT ; class QStyleOptionFrame & QStyleOptionFrame::operator=(class QStyleOptionFrame const &)
+ ?drawRects@QBlitterPaintEngine@@UAEXPBVQRect@@H@Z @ 13380 NONAME ; void QBlitterPaintEngine::drawRects(class QRect const *, int)
+ ?fillInPendingGlyphs@QTextureGlyphCache@@QAEXXZ @ 13381 NONAME ; void QTextureGlyphCache::fillInPendingGlyphs(void)
+ ?metaObject@QFlickGesture@@UBEPBUQMetaObject@@XZ @ 13382 NONAME ABSENT ; struct QMetaObject const * QFlickGesture::metaObject(void) const
+ ?renderHintsChanged@QBlitterPaintEngine@@UAEXXZ @ 13383 NONAME ; void QBlitterPaintEngine::renderHintsChanged(void)
+ ?supportedDropActions@QAbstractProxyModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 13384 NONAME ; class QFlags<enum Qt::DropAction> QAbstractProxyModel::supportedDropActions(void) const
+ ?fillRect@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQBrush@@@Z @ 13385 NONAME ; void QBlitterPaintEngine::fillRect(class QRectF const &, class QBrush const &)
+ ?setGlyphIndexes@QGlyphs@@QAEXABV?$QVector@I@@@Z @ 13386 NONAME ABSENT ; void QGlyphs::setGlyphIndexes(class QVector<unsigned int> const &)
+ ?alphaMapBoundingBox@QFontEngine@@UAE?AUglyph_metrics_t@@IABVQTransform@@W4GlyphFormat@1@@Z @ 13387 NONAME ABSENT ; struct glyph_metrics_t QFontEngine::alphaMapBoundingBox(unsigned int, class QTransform const &, enum QFontEngine::GlyphFormat)
+ ?resendPrepareEvent@QScroller@@QAEXXZ @ 13388 NONAME ABSENT ; void QScroller::resendPrepareEvent(void)
+ ??4QTextLength@@QAEAAV0@ABV0@@Z @ 13389 NONAME ABSENT ; class QTextLength & QTextLength::operator=(class QTextLength const &)
+ ??0QHelpEvent@@QAE@ABV0@@Z @ 13390 NONAME ABSENT ; QHelpEvent::QHelpEvent(class QHelpEvent const &)
+ ??0QContextMenuEvent@@QAE@ABV0@@Z @ 13391 NONAME ABSENT ; QContextMenuEvent::QContextMenuEvent(class QContextMenuEvent const &)
+ ?d_func@QBlittable@@ABEPBVQBlittablePrivate@@XZ @ 13392 NONAME ; class QBlittablePrivate const * QBlittable::d_func(void) const
+ ?state@QBlitterPaintEngine@@QBEPBVQPainterState@@XZ @ 13393 NONAME ; class QPainterState const * QBlitterPaintEngine::state(void) const
+ ??0QScrollPrepareEvent@@QAE@ABVQPointF@@@Z @ 13394 NONAME ABSENT ; QScrollPrepareEvent::QScrollPrepareEvent(class QPointF const &)
+ ??0QWhatsThisClickedEvent@@QAE@ABV0@@Z @ 13395 NONAME ABSENT ; QWhatsThisClickedEvent::QWhatsThisClickedEvent(class QWhatsThisClickedEvent const &)
+ ??4QStyleOptionTab@@QAEAAV0@ABV0@@Z @ 13396 NONAME ABSENT ; class QStyleOptionTab & QStyleOptionTab::operator=(class QStyleOptionTab const &)
+ ??0QTabletEvent@@QAE@ABV0@@Z @ 13397 NONAME ABSENT ; QTabletEvent::QTabletEvent(class QTabletEvent const &)
+ ?scrollTo@QScroller@@QAEXABVQPointF@@H@Z @ 13398 NONAME ABSENT ; void QScroller::scrollTo(class QPointF const &, int)
+ ?ungrabGesture@QScroller@@SAXPAVQObject@@@Z @ 13399 NONAME ABSENT ; void QScroller::ungrabGesture(class QObject *)
+ ??4QItemSelectionRange@@QAEAAV0@ABV0@@Z @ 13400 NONAME ABSENT ; class QItemSelectionRange & QItemSelectionRange::operator=(class QItemSelectionRange const &)
+ ?clear@QGlyphs@@QAEXXZ @ 13401 NONAME ABSENT ; void QGlyphs::clear(void)
+ ??_EQStyleOptionViewItemV4@@QAE@I@Z @ 13402 NONAME ABSENT ; QStyleOptionViewItemV4::~QStyleOptionViewItemV4(unsigned int)
+ ??1QBlittablePixmapData@@UAE@XZ @ 13403 NONAME ; QBlittablePixmapData::~QBlittablePixmapData(void)
+ ?formatsHelper@QInternalMimeData@@SA?AVQStringList@@PBVQMimeData@@@Z @ 13404 NONAME ; class QStringList QInternalMimeData::formatsHelper(class QMimeData const *)
+ ?qt_metacast@QInternalMimeData@@UAEPAXPBD@Z @ 13405 NONAME ; void * QInternalMimeData::qt_metacast(char const *)
+ ?font@QGlyphs@@QBE?AVQFont@@XZ @ 13406 NONAME ABSENT ; class QFont QGlyphs::font(void) const
+ ?paintEngine@QBlittablePixmapData@@UBEPAVQPaintEngine@@XZ @ 13407 NONAME ; class QPaintEngine * QBlittablePixmapData::paintEngine(void) const
+ ?unsetDefaultScrollerProperties@QScrollerProperties@@SAXXZ @ 13408 NONAME ABSENT ; void QScrollerProperties::unsetDefaultScrollerProperties(void)
+ ?hasChildren@QAbstractProxyModel@@UBE_NABVQModelIndex@@@Z @ 13409 NONAME ; bool QAbstractProxyModel::hasChildren(class QModelIndex const &) const
+ ?swap@QPen@@QAEXAAV1@@Z @ 13410 NONAME ; void QPen::swap(class QPen &)
+ ?span@QAbstractProxyModel@@UBE?AVQSize@@ABVQModelIndex@@@Z @ 13411 NONAME ; class QSize QAbstractProxyModel::span(class QModelIndex const &) const
+ ??4QEglProperties@@QAEAAV0@ABV0@@Z @ 13412 NONAME ABSENT ; class QEglProperties & QEglProperties::operator=(class QEglProperties const &)
+ ??0QHoverEvent@@QAE@ABV0@@Z @ 13413 NONAME ABSENT ; QHoverEvent::QHoverEvent(class QHoverEvent const &)
+ ??0QPaintEngineState@@QAE@XZ @ 13414 NONAME ABSENT ; QPaintEngineState::QPaintEngineState(void)
+ ?setSnapPositionsY@QScroller@@QAEXMM@Z @ 13415 NONAME ABSENT ; void QScroller::setSnapPositionsY(float, float)
+ ?d_func@QScrollPrepareEvent@@ABEPBVQScrollPrepareEventPrivate@@XZ @ 13416 NONAME ABSENT ; class QScrollPrepareEventPrivate const * QScrollPrepareEvent::d_func(void) const
+ ?textureMapForGlyph@QTextureGlyphCache@@QBE?AVQImage@@IUQFixed@@@Z @ 13417 NONAME ; class QImage QTextureGlyphCache::textureMapForGlyph(unsigned int, struct QFixed) const
+ ??0QKeyEvent@@QAE@ABV0@@Z @ 13418 NONAME ABSENT ; QKeyEvent::QKeyEvent(class QKeyEvent const &)
+ ??0QIconEngine@@QAE@ABV0@@Z @ 13419 NONAME ABSENT ; QIconEngine::QIconEngine(class QIconEngine const &)
+ ??4QStyleOptionToolBoxV2@@QAEAAV0@ABV0@@Z @ 13420 NONAME ABSENT ; class QStyleOptionToolBoxV2 & QStyleOptionToolBoxV2::operator=(class QStyleOptionToolBoxV2 const &)
+ ?qt_metacall@QInternalMimeData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13421 NONAME ; int QInternalMimeData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?lineHeightType@QTextBlockFormat@@QBEHXZ @ 13422 NONAME ; int QTextBlockFormat::lineHeightType(void) const
+ ?hintingPreference@QFont@@QBE?AW4HintingPreference@1@XZ @ 13423 NONAME ; enum QFont::HintingPreference QFont::hintingPreference(void) const
+ ??0QGlyphs@@QAE@XZ @ 13424 NONAME ABSENT ; QGlyphs::QGlyphs(void)
+ ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13425 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *, int)
+ ??0QImageIOHandlerFactoryInterface@@QAE@XZ @ 13426 NONAME ABSENT ; QImageIOHandlerFactoryInterface::QImageIOHandlerFactoryInterface(void)
+ ??_EQRegion@@QAE@I@Z @ 13427 NONAME ABSENT ; QRegion::~QRegion(unsigned int)
+ ?begin@QBlitterPaintEngine@@UAE_NPAVQPaintDevice@@@Z @ 13428 NONAME ; bool QBlitterPaintEngine::begin(class QPaintDevice *)
+ ?inFontUcs4@QFontMetricsF@@QBE_NI@Z @ 13429 NONAME ; bool QFontMetricsF::inFontUcs4(unsigned int) const
+ ?viewportSize@QScrollPrepareEvent@@QBE?AVQSizeF@@XZ @ 13430 NONAME ABSENT ; class QSizeF QScrollPrepareEvent::viewportSize(void) const
+ ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQRectF@@@Z @ 13431 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRectF const &)
+ ?d_func@QBlitterPaintEngine@@AAEPAVQBlitterPaintEnginePrivate@@XZ @ 13432 NONAME ; class QBlitterPaintEnginePrivate * QBlitterPaintEngine::d_func(void)
+ ?setNumberPrefix@QTextListFormat@@QAEXABVQString@@@Z @ 13433 NONAME ; void QTextListFormat::setNumberPrefix(class QString const &)
+ ?lineHeight@QTextBlockFormat@@QBEMMM@Z @ 13434 NONAME ; float QTextBlockFormat::lineHeight(float, float) const
+ ??4QStyleOptionComplex@@QAEAAV0@ABV0@@Z @ 13435 NONAME ABSENT ; class QStyleOptionComplex & QStyleOptionComplex::operator=(class QStyleOptionComplex const &)
+ ?getItem@QInputDialog@@SA?AVQString@@PAVQWidget@@ABV2@1ABVQStringList@@H_NPA_NV?$QFlags@W4WindowType@Qt@@@@V?$QFlags@W4InputMethodHint@Qt@@@@@Z @ 13436 NONAME ; class QString QInputDialog::getItem(class QWidget *, class QString const &, class QString const &, class QStringList const &, int, bool, bool *, class QFlags<enum Qt::WindowType>, class QFlags<enum Qt::InputMethodHint>)
+ ??_EFileInfo@QZipReader@@QAE@I@Z @ 13437 NONAME ABSENT ; QZipReader::FileInfo::~FileInfo(unsigned int)
+ ?hasFeature@QWindowSurface@@QBE_NW4WindowSurfaceFeature@1@@Z @ 13438 NONAME ; bool QWindowSurface::hasFeature(enum QWindowSurface::WindowSurfaceFeature) const
+ ?qGamma_correct_back_to_linear_cs@@YAXPAVQImage@@@Z @ 13439 NONAME ; void qGamma_correct_back_to_linear_cs(class QImage *)
+ ??0QBitmap@@QAE@ABV0@@Z @ 13440 NONAME ABSENT ; QBitmap::QBitmap(class QBitmap const &)
+ ?clip@QBlitterPaintEngine@@UAEXABVQVectorPath@@W4ClipOperation@Qt@@@Z @ 13441 NONAME ; void QBlitterPaintEngine::clip(class QVectorPath const &, enum Qt::ClipOperation)
+ ??1QScrollEvent@@UAE@XZ @ 13442 NONAME ABSENT ; QScrollEvent::~QScrollEvent(void)
+ ?state@QScroller@@QBE?AW4State@1@XZ @ 13443 NONAME ABSENT ; enum QScroller::State QScroller::state(void) const
+ ?positions@QGlyphs@@QBE?AV?$QVector@VQPointF@@@@XZ @ 13444 NONAME ABSENT ; class QVector<class QPointF> QGlyphs::positions(void) const
+ ?tr@QScroller@@SA?AVQString@@PBD0@Z @ 13445 NONAME ABSENT ; class QString QScroller::tr(char const *, char const *)
+ ?canReadData@QInternalMimeData@@SA_NABVQString@@@Z @ 13446 NONAME ; bool QInternalMimeData::canReadData(class QString const &)
+ ?glyphs@QTextLayout@@QBE?AV?$QList@VQGlyphs@@@@XZ @ 13447 NONAME ABSENT ; class QList<class QGlyphs> QTextLayout::glyphs(void) const
+ ?leadingSpaceWidth@QTextEngine@@QAE?AUQFixed@@ABUQScriptLine@@@Z @ 13448 NONAME ; struct QFixed QTextEngine::leadingSpaceWidth(struct QScriptLine const &)
+ ??_EQTextFormat@@QAE@I@Z @ 13449 NONAME ABSENT ; QTextFormat::~QTextFormat(unsigned int)
+ ??4QStyleOptionTabWidgetFrame@@QAEAAV0@ABV0@@Z @ 13450 NONAME ABSENT ; class QStyleOptionTabWidgetFrame & QStyleOptionTabWidgetFrame::operator=(class QStyleOptionTabWidgetFrame const &)
+ ?trUtf8@QScroller@@SA?AVQString@@PBD0H@Z @ 13451 NONAME ABSENT ; class QString QScroller::trUtf8(char const *, char const *, int)
+ ?d_func@QFlickGesture@@ABEPBVQFlickGesturePrivate@@XZ @ 13452 NONAME ABSENT ; class QFlickGesturePrivate const * QFlickGesture::d_func(void) const
+ ??4QMouseEvent@@QAEAAV0@ABV0@@Z @ 13453 NONAME ABSENT ; class QMouseEvent & QMouseEvent::operator=(class QMouseEvent const &)
+ ??_EQPainter@@QAE@I@Z @ 13454 NONAME ABSENT ; QPainter::~QPainter(unsigned int)
+ ??4QStyleOptionTabBarBaseV2@@QAEAAV0@ABV0@@Z @ 13455 NONAME ABSENT ; class QStyleOptionTabBarBaseV2 & QStyleOptionTabBarBaseV2::operator=(class QStyleOptionTabBarBaseV2 const &)
+ ??4QInputEvent@@QAEAAV0@ABV0@@Z @ 13456 NONAME ABSENT ; class QInputEvent & QInputEvent::operator=(class QInputEvent const &)
+ ?hasScroller@QScroller@@SA_NPAVQObject@@@Z @ 13457 NONAME ABSENT ; bool QScroller::hasScroller(class QObject *)
+ ?alphaMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@ABVQTransform@@@Z @ 13458 NONAME ; class QImage QFontEngine::alphaMapForGlyph(unsigned int, struct QFixed, class QTransform const &)
+ ??_EQPainterPath@@QAE@I@Z @ 13459 NONAME ABSENT ; QPainterPath::~QPainterPath(unsigned int)
+ ??_EQGlyphs@@QAE@I@Z @ 13460 NONAME ABSENT ; QGlyphs::~QGlyphs(unsigned int)
+ ?fromImage@QBlittablePixmapData@@UAEXABVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 13461 NONAME ; void QBlittablePixmapData::fromImage(class QImage const &, class QFlags<enum Qt::ImageConversionFlag>)
+ ??0QInternalMimeData@@QAE@XZ @ 13462 NONAME ; QInternalMimeData::QInternalMimeData(void)
+ ??_EQScrollEvent@@UAE@I@Z @ 13463 NONAME ABSENT ; QScrollEvent::~QScrollEvent(unsigned int)
+ ?features@QRasterWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 13464 NONAME ; class QFlags<enum QWindowSurface::WindowSurfaceFeature> QRasterWindowSurface::features(void) const
+ ??4QGlyphs@@QAEAAV0@ABV0@@Z @ 13465 NONAME ABSENT ; class QGlyphs & QGlyphs::operator=(class QGlyphs const &)
+ ??4QQuaternion@@QAEAAV0@ABV0@@Z @ 13466 NONAME ABSENT ; class QQuaternion & QQuaternion::operator=(class QQuaternion const &)
+ ??4Symbol@QCss@@QAEAAU01@ABU01@@Z @ 13467 NONAME ABSENT ; struct QCss::Symbol & QCss::Symbol::operator=(struct QCss::Symbol const &)
+ ??0QBlittable@@QAE@ABVQSize@@V?$QFlags@W4Capability@QBlittable@@@@@Z @ 13468 NONAME ; QBlittable::QBlittable(class QSize const &, class QFlags<enum QBlittable::Capability>)
+ ??0QIconDragEvent@@QAE@ABV0@@Z @ 13469 NONAME ABSENT ; QIconDragEvent::QIconDragEvent(class QIconDragEvent const &)
+ ?scroller@QScroller@@SAPAV1@PAVQObject@@@Z @ 13470 NONAME ABSENT ; class QScroller * QScroller::scroller(class QObject *)
+ ??4QScrollerProperties@@QAEAAV0@ABV0@@Z @ 13471 NONAME ABSENT ; class QScrollerProperties & QScrollerProperties::operator=(class QScrollerProperties const &)
+ ?d_func@QScroller@@AAEPAVQScrollerPrivate@@XZ @ 13472 NONAME ABSENT ; class QScrollerPrivate * QScroller::d_func(void)
+ ?scrollerPropertiesChanged@QScroller@@IAEXABVQScrollerProperties@@@Z @ 13473 NONAME ABSENT ; void QScroller::scrollerPropertiesChanged(class QScrollerProperties const &)
+ ?markRasterOverlay@QBlittablePixmapData@@QAEXPBVQRect@@H@Z @ 13474 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRect const *, int)
+ ?tabsClosable@QMdiArea@@QBE_NXZ @ 13475 NONAME ; bool QMdiArea::tabsClosable(void) const
+ ?canStartScrollingAt@QAbstractScrollAreaPrivate@@QAE_NABVQPoint@@@Z @ 13476 NONAME ABSENT ; bool QAbstractScrollAreaPrivate::canStartScrollingAt(class QPoint const &)
+ ??0QScrollerProperties@@QAE@XZ @ 13477 NONAME ABSENT ; QScrollerProperties::QScrollerProperties(void)
+ ?setLineHeight@QTextBlockFormat@@QAEXMH@Z @ 13478 NONAME ; void QTextBlockFormat::setLineHeight(float, int)
+ ?calculateSubPixelPositionCount@QTextureGlyphCache@@IBEHI@Z @ 13479 NONAME ; int QTextureGlyphCache::calculateSubPixelPositionCount(unsigned int) const
+ ??0QTextImageFormat@@QAE@ABV0@@Z @ 13480 NONAME ABSENT ; QTextImageFormat::QTextImageFormat(class QTextImageFormat const &)
+ ??0QMoveEvent@@QAE@ABV0@@Z @ 13481 NONAME ABSENT ; QMoveEvent::QMoveEvent(class QMoveEvent const &)
+ ?glyphs@QTextFragment@@QBE?AV?$QList@VQGlyphs@@@@XZ @ 13482 NONAME ABSENT ; class QList<class QGlyphs> QTextFragment::glyphs(void) const
+ ??0QInputContextFactoryInterface@@QAE@XZ @ 13483 NONAME ABSENT ; QInputContextFactoryInterface::QInputContextFactoryInterface(void)
+ ??0QTextFrameFormat@@QAE@ABV0@@Z @ 13484 NONAME ABSENT ; QTextFrameFormat::QTextFrameFormat(class QTextFrameFormat const &)
+ ?resetInternalData@QAbstractProxyModel@@IAEXXZ @ 13485 NONAME ABSENT ; void QAbstractProxyModel::resetInternalData(void)
+ ??0Symbol@QCss@@QAE@ABU01@@Z @ 13486 NONAME ABSENT ; QCss::Symbol::Symbol(struct QCss::Symbol const &)
+ ?features@QWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 13487 NONAME ; class QFlags<enum QWindowSurface::WindowSurfaceFeature> QWindowSurface::features(void) const
+ ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQVectorPath@@@Z @ 13488 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QVectorPath const &)
+ ??4QStyleOptionFrameV3@@QAEAAV0@ABV0@@Z @ 13489 NONAME ABSENT ; class QStyleOptionFrameV3 & QStyleOptionFrameV3::operator=(class QStyleOptionFrameV3 const &)
+ ?scrollTo@QScroller@@QAEXABVQPointF@@@Z @ 13490 NONAME ABSENT ; void QScroller::scrollTo(class QPointF const &)
+ ??0QGraphicsSystem@@QAE@XZ @ 13491 NONAME ABSENT ; QGraphicsSystem::QGraphicsSystem(void)
+ ??4QStyleOptionViewItem@@QAEAAV0@ABV0@@Z @ 13492 NONAME ABSENT ; class QStyleOptionViewItem & QStyleOptionViewItem::operator=(class QStyleOptionViewItem const &)
+ ??4QStyleOptionProgressBar@@QAEAAV0@ABV0@@Z @ 13493 NONAME ABSENT ; class QStyleOptionProgressBar & QStyleOptionProgressBar::operator=(class QStyleOptionProgressBar const &)
+ ?clip@QBlitterPaintEngine@@QAEPBVQClipData@@XZ @ 13494 NONAME ; class QClipData const * QBlitterPaintEngine::clip(void)
+ ?d_func@QScroller@@ABEPBVQScrollerPrivate@@XZ @ 13495 NONAME ABSENT ; class QScrollerPrivate const * QScroller::d_func(void) const
+ ?setNumberSuffix@QTextListFormat@@QAEXABVQString@@@Z @ 13496 NONAME ; void QTextListFormat::setNumberSuffix(class QString const &)
+ ?swap@QPicture@@QAEXAAV1@@Z @ 13497 NONAME ; void QPicture::swap(class QPicture &)
+ ?swap@QPainterPath@@QAEXAAV1@@Z @ 13498 NONAME ; void QPainterPath::swap(class QPainterPath &)
+ ??4QStyleOptionRubberBand@@QAEAAV0@ABV0@@Z @ 13499 NONAME ABSENT ; class QStyleOptionRubberBand & QStyleOptionRubberBand::operator=(class QStyleOptionRubberBand const &)
+ ?minimumSizeHint@QCheckBox@@UBE?AVQSize@@XZ @ 13500 NONAME ; class QSize QCheckBox::minimumSizeHint(void) const
+ ?createExplicitFont@QFontEngine@@UBE?AVQFont@@XZ @ 13501 NONAME ABSENT ; class QFont QFontEngine::createExplicitFont(void) const
+ ?alphaMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@@Z @ 13502 NONAME ; class QImage QFontEngine::alphaMapForGlyph(unsigned int, struct QFixed)
+ ?fillTexture@QImageTextureGlyphCache@@UAEXABUCoord@QTextureGlyphCache@@IUQFixed@@@Z @ 13503 NONAME ; void QImageTextureGlyphCache::fillTexture(struct QTextureGlyphCache::Coord const &, unsigned int, struct QFixed)
+ ?swap@QIcon@@QAEXAAV1@@Z @ 13504 NONAME ; void QIcon::swap(class QIcon &)
+ ?unmarkRasterOverlay@QBlittablePixmapData@@QAEXABVQRectF@@@Z @ 13505 NONAME ; void QBlittablePixmapData::unmarkRasterOverlay(class QRectF const &)
+ ??0QDragResponseEvent@@QAE@ABV0@@Z @ 13506 NONAME ABSENT ; QDragResponseEvent::QDragResponseEvent(class QDragResponseEvent const &)
+ ??0QIconEngine@@QAE@XZ @ 13507 NONAME ABSENT ; QIconEngine::QIconEngine(void)
+ ?brushOriginChanged@QBlitterPaintEngine@@UAEXXZ @ 13508 NONAME ; void QBlitterPaintEngine::brushOriginChanged(void)
+ ?openFile@QFileOpenEvent@@QBE_NAAVQFile@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z @ 13509 NONAME ; bool QFileOpenEvent::openFile(class QFile &, class QFlags<enum QIODevice::OpenModeFlag>) const
+ ??_EQBrush@@QAE@I@Z @ 13510 NONAME ABSENT ; QBrush::~QBrush(unsigned int)
+ ??0QApplicationPrivate@@QAE@AAHPAPADW4Type@QApplication@@H@Z @ 13511 NONAME ; QApplicationPrivate::QApplicationPrivate(int &, char * *, enum QApplication::Type, int)
+ ?handleInput@QScroller@@QAE_NW4Input@1@ABVQPointF@@_J@Z @ 13512 NONAME ABSENT ; bool QScroller::handleInput(enum QScroller::Input, class QPointF const &, long long)
+ ??8QScrollerProperties@@QBE_NABV0@@Z @ 13513 NONAME ABSENT ; bool QScrollerProperties::operator==(class QScrollerProperties const &) const
+ ?inFontUcs4@QFontMetrics@@QBE_NI@Z @ 13514 NONAME ; bool QFontMetrics::inFontUcs4(unsigned int) const
+ ??_EQTableWidgetSelectionRange@@QAE@I@Z @ 13515 NONAME ABSENT ; QTableWidgetSelectionRange::~QTableWidgetSelectionRange(unsigned int)
+ ??4QStyleOptionTabBarBase@@QAEAAV0@ABV0@@Z @ 13516 NONAME ABSENT ; class QStyleOptionTabBarBase & QStyleOptionTabBarBase::operator=(class QStyleOptionTabBarBase const &)
+ ??0QTextObjectInterface@@QAE@XZ @ 13517 NONAME ABSENT ; QTextObjectInterface::QTextObjectInterface(void)
+ ?unlock@QBlittable@@QAEXXZ @ 13518 NONAME ; void QBlittable::unlock(void)
+ ?metaObject@QScroller@@UBEPBUQMetaObject@@XZ @ 13519 NONAME ABSENT ; struct QMetaObject const * QScroller::metaObject(void) const
+ ?d_func@QScrollEvent@@ABEPBVQScrollEventPrivate@@XZ @ 13520 NONAME ABSENT ; class QScrollEventPrivate const * QScrollEvent::d_func(void) const
+ ?swap@QRegion@@QAEXAAV1@@Z @ 13521 NONAME ; void QRegion::swap(class QRegion &)
+ ??0QHideEvent@@QAE@ABV0@@Z @ 13522 NONAME ABSENT ; QHideEvent::QHideEvent(class QHideEvent const &)
+ ?ensureVisible@QScroller@@QAEXABVQRectF@@MMH@Z @ 13523 NONAME ABSENT ; void QScroller::ensureVisible(class QRectF const &, float, float, int)
+ ?qt_metacall@QFlickGesture@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13524 NONAME ABSENT ; int QFlickGesture::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?setItemData@QAbstractProxyModel@@UAE_NABVQModelIndex@@ABV?$QMap@HVQVariant@@@@@Z @ 13525 NONAME ; bool QAbstractProxyModel::setItemData(class QModelIndex const &, class QMap<int, class QVariant> const &)
+ ?getStaticMetaObject@QInternalMimeData@@SAABUQMetaObject@@XZ @ 13526 NONAME ; struct QMetaObject const & QInternalMimeData::getStaticMetaObject(void)
+ ?swap@QPolygonF@@QAEXAAV1@@Z @ 13527 NONAME ; void QPolygonF::swap(class QPolygonF &)
+ ?swap@QPolygon@@QAEXAAV1@@Z @ 13528 NONAME ; void QPolygon::swap(class QPolygon &)
+ ??_EQScrollPrepareEvent@@UAE@I@Z @ 13529 NONAME ABSENT ; QScrollPrepareEvent::~QScrollPrepareEvent(unsigned int)
+ ?d_func@QBlitterPaintEngine@@ABEPBVQBlitterPaintEnginePrivate@@XZ @ 13530 NONAME ; class QBlitterPaintEnginePrivate const * QBlitterPaintEngine::d_func(void) const
+ ?pixelPerMeter@QScroller@@QBE?AVQPointF@@XZ @ 13531 NONAME ABSENT ; class QPointF QScroller::pixelPerMeter(void) const
+ ?target@QScroller@@QBEPAVQObject@@XZ @ 13532 NONAME ABSENT ; class QObject * QScroller::target(void) const
+ ?swap@QKeySequence@@QAEXAAV1@@Z @ 13533 NONAME ; void QKeySequence::swap(class QKeySequence &)
+ ??1QGlyphs@@QAE@XZ @ 13534 NONAME ABSENT ; QGlyphs::~QGlyphs(void)
+ ?lineHeight@QTextBlockFormat@@QBEMXZ @ 13535 NONAME ; float QTextBlockFormat::lineHeight(void) const
+ ?stroke@QBlitterPaintEngine@@UAEXABVQVectorPath@@ABVQPen@@@Z @ 13536 NONAME ; void QBlitterPaintEngine::stroke(class QVectorPath const &, class QPen const &)
+ ?tr@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13537 NONAME ; class QString QInternalMimeData::tr(char const *, char const *)
+ ??9QGlyphs@@QBE_NABV0@@Z @ 13538 NONAME ABSENT ; bool QGlyphs::operator!=(class QGlyphs const &) const
+ ??1QBlittable@@UAE@XZ @ 13539 NONAME ; QBlittable::~QBlittable(void)
+ ??_EQBlitterPaintEngine@@UAE@I@Z @ 13540 NONAME ; QBlitterPaintEngine::~QBlitterPaintEngine(unsigned int)
+ ??0QCloseEvent@@QAE@ABV0@@Z @ 13541 NONAME ABSENT ; QCloseEvent::QCloseEvent(class QCloseEvent const &)
+ ?grabbedGesture@QScroller@@SA?AW4GestureType@Qt@@PAVQObject@@@Z @ 13542 NONAME ABSENT ; enum Qt::GestureType QScroller::grabbedGesture(class QObject *)
+ ?buffer@QBlittablePixmapData@@UAEPAVQImage@@XZ @ 13543 NONAME ; class QImage * QBlittablePixmapData::buffer(void)
+ ??0QTextFrameLayoutData@@QAE@XZ @ 13544 NONAME ABSENT ; QTextFrameLayoutData::QTextFrameLayoutData(void)
+ ?staticMetaObject@QFlickGesture@@2UQMetaObject@@B @ 13545 NONAME ABSENT ; struct QMetaObject const QFlickGesture::staticMetaObject
+ ?finalPosition@QScroller@@QBE?AVQPointF@@XZ @ 13546 NONAME ABSENT ; class QPointF QScroller::finalPosition(void) const
+ ??4QStyleOptionTabWidgetFrameV2@@QAEAAV0@ABV0@@Z @ 13547 NONAME ABSENT ; class QStyleOptionTabWidgetFrameV2 & QStyleOptionTabWidgetFrameV2::operator=(class QStyleOptionTabWidgetFrameV2 const &)
+ ?drawStaticTextItem@QBlitterPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 13548 NONAME ; void QBlitterPaintEngine::drawStaticTextItem(class QStaticTextItem *)
+ ??0QGlyphs@@QAE@ABV0@@Z @ 13549 NONAME ABSENT ; QGlyphs::QGlyphs(class QGlyphs const &)
+ ?lock@QBlittable@@QAEPAVQImage@@XZ @ 13550 NONAME ; class QImage * QBlittable::lock(void)
+ ?setFontHintingPreference@QTextCharFormat@@QAEXW4HintingPreference@QFont@@@Z @ 13551 NONAME ; void QTextCharFormat::setFontHintingPreference(enum QFont::HintingPreference)
+ ??4QStyleOptionTabV2@@QAEAAV0@ABV0@@Z @ 13552 NONAME ABSENT ; class QStyleOptionTabV2 & QStyleOptionTabV2::operator=(class QStyleOptionTabV2 const &)
+ ??_EQInternalMimeData@@UAE@I@Z @ 13553 NONAME ; QInternalMimeData::~QInternalMimeData(unsigned int)
+ ??4QTextListFormat@@QAEAAV0@ABV0@@Z @ 13554 NONAME ABSENT ; class QTextListFormat & QTextListFormat::operator=(class QTextListFormat const &)
+ ??_EQPalette@@QAE@I@Z @ 13555 NONAME ABSENT ; QPalette::~QPalette(unsigned int)
+ ??0QFocusEvent@@QAE@ABV0@@Z @ 13556 NONAME ABSENT ; QFocusEvent::QFocusEvent(class QFocusEvent const &)
+ ??4QStyleOptionQ3ListViewItem@@QAEAAV0@ABV0@@Z @ 13557 NONAME ABSENT ; class QStyleOptionQ3ListViewItem & QStyleOptionQ3ListViewItem::operator=(class QStyleOptionQ3ListViewItem const &)
+ ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQPointF@@ABVQTextItem@@@Z @ 13558 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QPointF const &, class QTextItem const &)
+ ?trUtf8@QScroller@@SA?AVQString@@PBD0@Z @ 13559 NONAME ABSENT ; class QString QScroller::trUtf8(char const *, char const *)
+ ??_EQIcon@@QAE@I@Z @ 13560 NONAME ABSENT ; QIcon::~QIcon(unsigned int)
+ ??YQGlyphs@@AAEAAV0@ABV0@@Z @ 13561 NONAME ABSENT ; class QGlyphs & QGlyphs::operator+=(class QGlyphs const &)
+ ??9QScrollerProperties@@QBE_NABV0@@Z @ 13562 NONAME ABSENT ; bool QScrollerProperties::operator!=(class QScrollerProperties const &) const
+ ??0QTextListFormat@@QAE@ABV0@@Z @ 13563 NONAME ABSENT ; QTextListFormat::QTextListFormat(class QTextListFormat const &)
+ ?drawEllipse@QBlitterPaintEngine@@UAEXABVQRectF@@@Z @ 13564 NONAME ; void QBlitterPaintEngine::drawEllipse(class QRectF const &)
+ ??0QGuiPlatformPluginInterface@@QAE@XZ @ 13565 NONAME ABSENT ; QGuiPlatformPluginInterface::QGuiPlatformPluginInterface(void)
+ ??_EQTextLayout@@QAE@I@Z @ 13566 NONAME ABSENT ; QTextLayout::~QTextLayout(unsigned int)
+ ??0QWheelEvent@@QAE@ABV0@@Z @ 13567 NONAME ABSENT ; QWheelEvent::QWheelEvent(class QWheelEvent const &)
+ ?blittable@QBlittablePixmapData@@QBEPAVQBlittable@@XZ @ 13568 NONAME ; class QBlittable * QBlittablePixmapData::blittable(void) const
+ ?resizeCache@QTextureGlyphCache@@QAEXHH@Z @ 13569 NONAME ; void QTextureGlyphCache::resizeCache(int, int)
+ ??0QScrollerProperties@@QAE@ABV0@@Z @ 13570 NONAME ABSENT ; QScrollerProperties::QScrollerProperties(class QScrollerProperties const &)
+ ??0QWindowStateChangeEvent@@QAE@ABV0@@Z @ 13571 NONAME ABSENT ; QWindowStateChangeEvent::QWindowStateChangeEvent(class QWindowStateChangeEvent const &)
+ ?metaObject@QInternalMimeData@@UBEPBUQMetaObject@@XZ @ 13572 NONAME ; struct QMetaObject const * QInternalMimeData::metaObject(void) const
+ ?setContentPos@QScrollPrepareEvent@@QAEXABVQPointF@@@Z @ 13573 NONAME ABSENT ; void QScrollPrepareEvent::setContentPos(class QPointF const &)
+ ??_EQTextEngine@@QAE@I@Z @ 13574 NONAME ABSENT ; QTextEngine::~QTextEngine(unsigned int)
+ ??4QStyleOptionTitleBar@@QAEAAV0@ABV0@@Z @ 13575 NONAME ABSENT ; class QStyleOptionTitleBar & QStyleOptionTitleBar::operator=(class QStyleOptionTitleBar const &)
+ ??4Value@QCss@@QAEAAU01@ABU01@@Z @ 13576 NONAME ABSENT ; struct QCss::Value & QCss::Value::operator=(struct QCss::Value const &)
+ ?staticMetaObject@QScroller@@2UQMetaObject@@B @ 13577 NONAME ABSENT ; struct QMetaObject const QScroller::staticMetaObject
+ ?hasFormatHelper@QInternalMimeData@@SA_NABVQString@@PBVQMimeData@@@Z @ 13578 NONAME ; bool QInternalMimeData::hasFormatHelper(class QString const &, class QMimeData const *)
+ ?state@QBlitterPaintEngine@@QAEPAVQPainterState@@XZ @ 13579 NONAME ; class QPainterState * QBlitterPaintEngine::state(void)
+ ?penChanged@QBlitterPaintEngine@@UAEXXZ @ 13580 NONAME ; void QBlitterPaintEngine::penChanged(void)
+ ??0QFileOpenEvent@@QAE@ABVRFile@@@Z @ 13581 NONAME ; QFileOpenEvent::QFileOpenEvent(class RFile const &)
+ ?hasHeightForWidth@QWidgetPrivate@@UBE_NXZ @ 13582 NONAME ; bool QWidgetPrivate::hasHeightForWidth(void) const
+ ??0QDragLeaveEvent@@QAE@ABV0@@Z @ 13583 NONAME ABSENT ; QDragLeaveEvent::QDragLeaveEvent(class QDragLeaveEvent const &)
+ ?toImage@QBlittablePixmapData@@UBE?AVQImage@@XZ @ 13584 NONAME ; class QImage QBlittablePixmapData::toImage(void) const
+ ??_EQBlittable@@UAE@I@Z @ 13585 NONAME ; QBlittable::~QBlittable(unsigned int)
+ ??4QBitmap@@QAEAAV0@ABV0@@Z @ 13586 NONAME ABSENT ; class QBitmap & QBitmap::operator=(class QBitmap const &)
+ ??1QInternalMimeData@@UAE@XZ @ 13587 NONAME ; QInternalMimeData::~QInternalMimeData(void)
+ ??0QItemSelection@@QAE@ABV0@@Z @ 13588 NONAME ABSENT ; QItemSelection::QItemSelection(class QItemSelection const &)
+ ?qt_addBitmapToPath@@YAXMMPBEHHHPAVQPainterPath@@@Z @ 13589 NONAME ; void qt_addBitmapToPath(float, float, unsigned char const *, int, int, int, class QPainterPath *)
+ ?staticMetaObject@QInternalMimeData@@2UQMetaObject@@B @ 13590 NONAME ; struct QMetaObject const QInternalMimeData::staticMetaObject
+ ?activeScrollers@QScroller@@SA?AV?$QList@PAVQScroller@@@@XZ @ 13591 NONAME ABSENT ; class QList<class QScroller *> QScroller::activeScrollers(void)
+ ?drawGlyphs@QPainter@@QAEXABVQPointF@@ABVQGlyphs@@@Z @ 13592 NONAME ABSENT ; void QPainter::drawGlyphs(class QPointF const &, class QGlyphs const &)
+ ??4QTextFrameFormat@@QAEAAV0@ABV0@@Z @ 13593 NONAME ABSENT ; class QTextFrameFormat & QTextFrameFormat::operator=(class QTextFrameFormat const &)
+ ?staticMetaObjectExtraData@QStylePlugin@@0UQMetaObjectExtraData@@B @ 13594 NONAME ; struct QMetaObjectExtraData const QStylePlugin::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QToolBar@@0UQMetaObjectExtraData@@B @ 13595 NONAME ; struct QMetaObjectExtraData const QToolBar::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTableView@@0UQMetaObjectExtraData@@B @ 13596 NONAME ; struct QMetaObjectExtraData const QTableView::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QValidator@@0UQMetaObjectExtraData@@B @ 13597 NONAME ; struct QMetaObjectExtraData const QValidator::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPaintBufferSignalProxy@@0UQMetaObjectExtraData@@B @ 13598 NONAME ; struct QMetaObjectExtraData const QPaintBufferSignalProxy::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QSplashScreen@@0UQMetaObjectExtraData@@B @ 13599 NONAME ; struct QMetaObjectExtraData const QSplashScreen::staticMetaObjectExtraData
+ ?qt_static_metacall@QDockWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13600 NONAME ; void QDockWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QVBoxLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13601 NONAME ; void QVBoxLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QCommonStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13602 NONAME ; void QCommonStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QMenuBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13603 NONAME ; void QMenuBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsObject@@0UQMetaObjectExtraData@@B @ 13604 NONAME ; struct QMetaObjectExtraData const QGraphicsObject::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QSplitter@@0UQMetaObjectExtraData@@B @ 13605 NONAME ; struct QMetaObjectExtraData const QSplitter::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QUndoStack@@0UQMetaObjectExtraData@@B @ 13606 NONAME ; struct QMetaObjectExtraData const QUndoStack::staticMetaObjectExtraData
+ ?qt_static_metacall@QPaintBufferResource@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13607 NONAME ; void QPaintBufferResource::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QSound@@0UQMetaObjectExtraData@@B @ 13608 NONAME ; struct QMetaObjectExtraData const QSound::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QSwipeGesture@@0UQMetaObjectExtraData@@B @ 13609 NONAME ; struct QMetaObjectExtraData const QSwipeGesture::staticMetaObjectExtraData
+ ?qt_static_metacall@QSizeGrip@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13610 NONAME ; void QSizeGrip::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QSlider@@0UQMetaObjectExtraData@@B @ 13611 NONAME ; struct QMetaObjectExtraData const QSlider::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QAbstractItemView@@0UQMetaObjectExtraData@@B @ 13612 NONAME ; struct QMetaObjectExtraData const QAbstractItemView::staticMetaObjectExtraData
+ ?setCompressionPolicy@QZipWriter@@QAEXW4CompressionPolicy@1@@Z @ 13613 NONAME ; void QZipWriter::setCompressionPolicy(enum QZipWriter::CompressionPolicy)
+ ?staticMetaObjectExtraData@QPlainTextEdit@@0UQMetaObjectExtraData@@B @ 13614 NONAME ; struct QMetaObjectExtraData const QPlainTextEdit::staticMetaObjectExtraData
+ ?addFile@QZipWriter@@QAEXABVQString@@PAVQIODevice@@@Z @ 13615 NONAME ; void QZipWriter::addFile(class QString const &, class QIODevice *)
+ ?staticMetaObjectExtraData@QDateEdit@@0UQMetaObjectExtraData@@B @ 13616 NONAME ; struct QMetaObjectExtraData const QDateEdit::staticMetaObjectExtraData
+ ?qt_static_metacall@QGuiPlatformPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13617 NONAME ; void QGuiPlatformPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QFlickGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13618 NONAME ABSENT ; void QFlickGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QStyledItemDelegate@@0UQMetaObjectExtraData@@B @ 13619 NONAME ; struct QMetaObjectExtraData const QStyledItemDelegate::staticMetaObjectExtraData
+ ?qt_static_metacall@QWizard@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13620 NONAME ; void QWizard::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTextControl@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13621 NONAME ; void QTextControl::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsRotation@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13622 NONAME ; void QGraphicsRotation::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QAbstractProxyModel@@0UQMetaObjectExtraData@@B @ 13623 NONAME ; struct QMetaObjectExtraData const QAbstractProxyModel::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDialog@@0UQMetaObjectExtraData@@B @ 13624 NONAME ; struct QMetaObjectExtraData const QDialog::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPixmapDropShadowFilter@@0UQMetaObjectExtraData@@B @ 13625 NONAME ; struct QMetaObjectExtraData const QPixmapDropShadowFilter::staticMetaObjectExtraData
+ ?qt_static_metacall@QPanGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13626 NONAME ; void QPanGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QWidgetResizeHandler@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13627 NONAME ; void QWidgetResizeHandler::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsSystemPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13628 NONAME ; void QGraphicsSystemPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QProxyModel@@0UQMetaObjectExtraData@@B @ 13629 NONAME ; struct QMetaObjectExtraData const QProxyModel::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13630 NONAME ; void QGraphicsWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QSizeGrip@@0UQMetaObjectExtraData@@B @ 13631 NONAME ; struct QMetaObjectExtraData const QSizeGrip::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QImageIOPlugin@@0UQMetaObjectExtraData@@B @ 13632 NONAME ; struct QMetaObjectExtraData const QImageIOPlugin::staticMetaObjectExtraData
+ ?qt_static_metacall@QSortFilterProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13633 NONAME ; void QSortFilterProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QDrag@@0UQMetaObjectExtraData@@B @ 13634 NONAME ; struct QMetaObjectExtraData const QDrag::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QAction@@0UQMetaObjectExtraData@@B @ 13635 NONAME ; struct QMetaObjectExtraData const QAction::staticMetaObjectExtraData
+ ?qt_static_metacall@QUndoView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13636 NONAME ; void QUndoView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?creationPermissions@QZipWriter@@QBE?AV?$QFlags@W4Permission@QFile@@@@XZ @ 13637 NONAME ; class QFlags<enum QFile::Permission> QZipWriter::creationPermissions(void) const
+ ?staticMetaObjectExtraData@QTabBar@@0UQMetaObjectExtraData@@B @ 13638 NONAME ; struct QMetaObjectExtraData const QTabBar::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QColumnView@@0UQMetaObjectExtraData@@B @ 13639 NONAME ; struct QMetaObjectExtraData const QColumnView::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QProxyStyle@@0UQMetaObjectExtraData@@B @ 13640 NONAME ; struct QMetaObjectExtraData const QProxyStyle::staticMetaObjectExtraData
+ ?qt_static_metacall@QActionGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13641 NONAME ; void QActionGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QLineEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13642 NONAME ; void QLineEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ??0QZipWriter@@QAE@ABVQString@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z @ 13643 NONAME ; QZipWriter::QZipWriter(class QString const &, class QFlags<enum QIODevice::OpenModeFlag>)
+ ?staticMetaObjectExtraData@QSortFilterProxyModel@@0UQMetaObjectExtraData@@B @ 13644 NONAME ; struct QMetaObjectExtraData const QSortFilterProxyModel::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QIconEnginePlugin@@0UQMetaObjectExtraData@@B @ 13645 NONAME ; struct QMetaObjectExtraData const QIconEnginePlugin::staticMetaObjectExtraData
+ ?qt_static_metacall@QPixmapConvolutionFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13646 NONAME ; void QPixmapConvolutionFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QApplication@@0UQMetaObjectExtraData@@B @ 13647 NONAME ; struct QMetaObjectExtraData const QApplication::staticMetaObjectExtraData
+ ?qt_static_metacall@QCalendarWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13648 NONAME ; void QCalendarWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QInputContextPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13649 NONAME ; void QInputContextPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGuiPlatformPlugin@@0UQMetaObjectExtraData@@B @ 13650 NONAME ; struct QMetaObjectExtraData const QGuiPlatformPlugin::staticMetaObjectExtraData
+ ?qt_static_metacall@QTextObject@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13651 NONAME ; void QTextObject::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QStandardItemModel@@0UQMetaObjectExtraData@@B @ 13652 NONAME ; struct QMetaObjectExtraData const QStandardItemModel::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QProgressDialog@@0UQMetaObjectExtraData@@B @ 13653 NONAME ; struct QMetaObjectExtraData const QProgressDialog::staticMetaObjectExtraData
+ ?qt_static_metacall@QAbstractItemView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13654 NONAME ; void QAbstractItemView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QColumnView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13655 NONAME ; void QColumnView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QPixmapBlurFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13656 NONAME ; void QPixmapBlurFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsTransform@@0UQMetaObjectExtraData@@B @ 13657 NONAME ; struct QMetaObjectExtraData const QGraphicsTransform::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QFontDialog@@0UQMetaObjectExtraData@@B @ 13658 NONAME ; struct QMetaObjectExtraData const QFontDialog::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsBlurEffect@@0UQMetaObjectExtraData@@B @ 13659 NONAME ; struct QMetaObjectExtraData const QGraphicsBlurEffect::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsProxyWidget@@0UQMetaObjectExtraData@@B @ 13660 NONAME ; struct QMetaObjectExtraData const QGraphicsProxyWidget::staticMetaObjectExtraData
+ ?qt_static_metacall@QPictureFormatPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13661 NONAME ; void QPictureFormatPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QFileDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13662 NONAME ; void QFileDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QFlickGesture@@0UQMetaObjectExtraData@@B @ 13663 NONAME ABSENT ; struct QMetaObjectExtraData const QFlickGesture::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QWizard@@0UQMetaObjectExtraData@@B @ 13664 NONAME ; struct QMetaObjectExtraData const QWizard::staticMetaObjectExtraData
+ ?qt_static_metacall@QS60Style@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13665 NONAME ; void QS60Style::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTapGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13666 NONAME ; void QTapGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QItemDelegate@@0UQMetaObjectExtraData@@B @ 13667 NONAME ; struct QMetaObjectExtraData const QItemDelegate::staticMetaObjectExtraData
+ ?qt_static_metacall@QProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13668 NONAME ; void QProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QScrollBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13669 NONAME ; void QScrollBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QComboBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13670 NONAME ; void QComboBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QToolButton@@0UQMetaObjectExtraData@@B @ 13671 NONAME ; struct QMetaObjectExtraData const QToolButton::staticMetaObjectExtraData
+ ?qt_static_metacall@QItemSelectionModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13672 NONAME ; void QItemSelectionModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ??0QZipWriter@@QAE@PAVQIODevice@@@Z @ 13673 NONAME ; QZipWriter::QZipWriter(class QIODevice *)
+ ?staticMetaObjectExtraData@QButtonGroup@@0UQMetaObjectExtraData@@B @ 13674 NONAME ; struct QMetaObjectExtraData const QButtonGroup::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QErrorMessage@@0UQMetaObjectExtraData@@B @ 13675 NONAME ; struct QMetaObjectExtraData const QErrorMessage::staticMetaObjectExtraData
+ ?qt_static_metacall@QTableView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13676 NONAME ; void QTableView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTextEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13677 NONAME ; void QTextEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13678 NONAME ; void QDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QMessageBox@@0UQMetaObjectExtraData@@B @ 13679 NONAME ; struct QMetaObjectExtraData const QMessageBox::staticMetaObjectExtraData
+ ?qt_static_metacall@QWorkspace@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13680 NONAME ; void QWorkspace::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTextEdit@@0UQMetaObjectExtraData@@B @ 13681 NONAME ; struct QMetaObjectExtraData const QTextEdit::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDoubleValidator@@0UQMetaObjectExtraData@@B @ 13682 NONAME ; struct QMetaObjectExtraData const QDoubleValidator::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsWidget@@0UQMetaObjectExtraData@@B @ 13683 NONAME ; struct QMetaObjectExtraData const QGraphicsWidget::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QSplitterHandle@@0UQMetaObjectExtraData@@B @ 13684 NONAME ; struct QMetaObjectExtraData const QSplitterHandle::staticMetaObjectExtraData
+ ?qt_static_metacall@QPinchGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13685 NONAME ; void QPinchGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?alphaMapBoundingBox@QFontEngine@@UAE?AUglyph_metrics_t@@IUQFixed@@ABVQTransform@@W4GlyphFormat@1@@Z @ 13686 NONAME ; struct glyph_metrics_t QFontEngine::alphaMapBoundingBox(unsigned int, struct QFixed, class QTransform const &, enum QFontEngine::GlyphFormat)
+ ?qt_static_metacall@QGridLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13687 NONAME ; void QGridLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QSplitter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13688 NONAME ; void QSplitter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QStackedLayout@@0UQMetaObjectExtraData@@B @ 13689 NONAME ; struct QMetaObjectExtraData const QStackedLayout::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTapAndHoldGesture@@0UQMetaObjectExtraData@@B @ 13690 NONAME ; struct QMetaObjectExtraData const QTapAndHoldGesture::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QLCDNumber@@0UQMetaObjectExtraData@@B @ 13691 NONAME ; struct QMetaObjectExtraData const QLCDNumber::staticMetaObjectExtraData
+ ?qt_static_metacall@QDoubleSpinBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13692 NONAME ; void QDoubleSpinBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13693 NONAME ; void QValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?addDirectory@QZipWriter@@QAEXABVQString@@@Z @ 13694 NONAME ; void QZipWriter::addDirectory(class QString const &)
+ ?staticMetaObjectExtraData@QEventDispatcherS60@@0UQMetaObjectExtraData@@B @ 13695 NONAME ; struct QMetaObjectExtraData const QEventDispatcherS60::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QLineControl@@0UQMetaObjectExtraData@@B @ 13696 NONAME ; struct QMetaObjectExtraData const QLineControl::staticMetaObjectExtraData
+ ?qt_static_metacall@QStylePlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13697 NONAME ; void QStylePlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QScrollArea@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13698 NONAME ; void QScrollArea::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QProgressDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13699 NONAME ; void QProgressDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QWidget@@0UQMetaObjectExtraData@@B @ 13700 NONAME ; struct QMetaObjectExtraData const QWidget::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QRubberBand@@0UQMetaObjectExtraData@@B @ 13701 NONAME ; struct QMetaObjectExtraData const QRubberBand::staticMetaObjectExtraData
+ ?qt_static_metacall@QLineControl@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13702 NONAME ; void QLineControl::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QDockWidgetLayout@@0UQMetaObjectExtraData@@B @ 13703 NONAME ; struct QMetaObjectExtraData const QDockWidgetLayout::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTextControl@@0UQMetaObjectExtraData@@B @ 13704 NONAME ; struct QMetaObjectExtraData const QTextControl::staticMetaObjectExtraData
+ ?qt_static_metacall@QTreeView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13705 NONAME ; void QTreeView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsScene@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13706 NONAME ; void QGraphicsScene::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QApplication@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13707 NONAME ; void QApplication::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QCommandLinkButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13708 NONAME ; void QCommandLinkButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTextBlockGroup@@0UQMetaObjectExtraData@@B @ 13709 NONAME ; struct QMetaObjectExtraData const QTextBlockGroup::staticMetaObjectExtraData
+ ?qt_static_metacall@QIntValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13710 NONAME ; void QIntValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QInputContextPlugin@@0UQMetaObjectExtraData@@B @ 13711 NONAME ; struct QMetaObjectExtraData const QInputContextPlugin::staticMetaObjectExtraData
+ ?qt_static_metacall@QFontComboBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13712 NONAME ; void QFontComboBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTextDocument@@0UQMetaObjectExtraData@@B @ 13713 NONAME ; struct QMetaObjectExtraData const QTextDocument::staticMetaObjectExtraData
+ ?qt_static_metacall@QTextList@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13714 NONAME ; void QTextList::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13715 NONAME ; void QStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsObject@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13716 NONAME ; void QGraphicsObject::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QSpinBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13717 NONAME ; void QSpinBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsScale@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13718 NONAME ; void QGraphicsScale::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QPlainTextDocumentLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13719 NONAME ; void QPlainTextDocumentLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QShortcut@@0UQMetaObjectExtraData@@B @ 13720 NONAME ; struct QMetaObjectExtraData const QShortcut::staticMetaObjectExtraData
+ ?qt_static_metacall@QDial@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13721 NONAME ; void QDial::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsItemAnimation@@0UQMetaObjectExtraData@@B @ 13722 NONAME ; struct QMetaObjectExtraData const QGraphicsItemAnimation::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsProxyWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13723 NONAME ; void QGraphicsProxyWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QMenuBar@@0UQMetaObjectExtraData@@B @ 13724 NONAME ; struct QMetaObjectExtraData const QMenuBar::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsColorizeEffect@@0UQMetaObjectExtraData@@B @ 13725 NONAME ; struct QMetaObjectExtraData const QGraphicsColorizeEffect::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QScrollArea@@0UQMetaObjectExtraData@@B @ 13726 NONAME ; struct QMetaObjectExtraData const QScrollArea::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPaintBufferResource@@0UQMetaObjectExtraData@@B @ 13727 NONAME ; struct QMetaObjectExtraData const QPaintBufferResource::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTextFrame@@0UQMetaObjectExtraData@@B @ 13728 NONAME ; struct QMetaObjectExtraData const QTextFrame::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QItemSelectionModel@@0UQMetaObjectExtraData@@B @ 13729 NONAME ; struct QMetaObjectExtraData const QItemSelectionModel::staticMetaObjectExtraData
+ ?qt_static_metacall@QIconEnginePluginV2@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13730 NONAME ; void QIconEnginePluginV2::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsBlurEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13731 NONAME ; void QGraphicsBlurEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QSpinBox@@0UQMetaObjectExtraData@@B @ 13732 NONAME ; struct QMetaObjectExtraData const QSpinBox::staticMetaObjectExtraData
+ ?qt_static_metacall@QMenu@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13733 NONAME ; void QMenu::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QListWidget@@0UQMetaObjectExtraData@@B @ 13734 NONAME ; struct QMetaObjectExtraData const QListWidget::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTimeEdit@@0UQMetaObjectExtraData@@B @ 13735 NONAME ; struct QMetaObjectExtraData const QTimeEdit::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QMenu@@0UQMetaObjectExtraData@@B @ 13736 NONAME ; struct QMetaObjectExtraData const QMenu::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QFrame@@0UQMetaObjectExtraData@@B @ 13737 NONAME ; struct QMetaObjectExtraData const QFrame::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDirModel@@0UQMetaObjectExtraData@@B @ 13738 NONAME ; struct QMetaObjectExtraData const QDirModel::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QAbstractSpinBox@@0UQMetaObjectExtraData@@B @ 13739 NONAME ; struct QMetaObjectExtraData const QAbstractSpinBox::staticMetaObjectExtraData
+ ?qt_static_metacall@QProxyStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13740 NONAME ; void QProxyStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QDateTimeEdit@@0UQMetaObjectExtraData@@B @ 13741 NONAME ; struct QMetaObjectExtraData const QDateTimeEdit::staticMetaObjectExtraData
+ ?qt_static_metacall@QStyledItemDelegate@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13742 NONAME ; void QStyledItemDelegate::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QListView@@0UQMetaObjectExtraData@@B @ 13743 NONAME ; struct QMetaObjectExtraData const QListView::staticMetaObjectExtraData
+ ?qt_static_metacall@QFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13744 NONAME ; void QFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QHeaderView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13745 NONAME ; void QHeaderView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?exists@QZipWriter@@QBE_NXZ @ 13746 NONAME ; bool QZipWriter::exists(void) const
+ ?qt_static_metacall@QSyntaxHighlighter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13747 NONAME ; void QSyntaxHighlighter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QScroller@@0UQMetaObjectExtraData@@B @ 13748 NONAME ABSENT ; struct QMetaObjectExtraData const QScroller::staticMetaObjectExtraData
+ ?qt_static_metacall@QTextFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13749 NONAME ; void QTextFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QDirModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13750 NONAME ; void QDirModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QScrollBar@@0UQMetaObjectExtraData@@B @ 13751 NONAME ; struct QMetaObjectExtraData const QScrollBar::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QMovie@@0UQMetaObjectExtraData@@B @ 13752 NONAME ; struct QMetaObjectExtraData const QMovie::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsDropShadowEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13753 NONAME ; void QGraphicsDropShadowEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QSound@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13754 NONAME ; void QSound::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTextBrowser@@0UQMetaObjectExtraData@@B @ 13755 NONAME ; struct QMetaObjectExtraData const QTextBrowser::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QHeaderView@@0UQMetaObjectExtraData@@B @ 13756 NONAME ; struct QMetaObjectExtraData const QHeaderView::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPixmapBlurFilter@@0UQMetaObjectExtraData@@B @ 13757 NONAME ; struct QMetaObjectExtraData const QPixmapBlurFilter::staticMetaObjectExtraData
+ ?qt_static_metacall@QUndoStack@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13758 NONAME ; void QUndoStack::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsAnchor@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13759 NONAME ; void QGraphicsAnchor::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QPanGesture@@0UQMetaObjectExtraData@@B @ 13760 NONAME ; struct QMetaObjectExtraData const QPanGesture::staticMetaObjectExtraData
+ ?qt_static_metacall@QDataWidgetMapper@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13761 NONAME ; void QDataWidgetMapper::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTextBlockGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13762 NONAME ; void QTextBlockGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QStringListModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13763 NONAME ; void QStringListModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsTextItem@@0UQMetaObjectExtraData@@B @ 13764 NONAME ; struct QMetaObjectExtraData const QGraphicsTextItem::staticMetaObjectExtraData
+ ?qt_static_metacall@QTimeEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13765 NONAME ; void QTimeEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QToolBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13766 NONAME ; void QToolBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QCheckBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13767 NONAME ; void QCheckBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QFontComboBox@@0UQMetaObjectExtraData@@B @ 13768 NONAME ; struct QMetaObjectExtraData const QFontComboBox::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDesktopWidget@@0UQMetaObjectExtraData@@B @ 13769 NONAME ; struct QMetaObjectExtraData const QDesktopWidget::staticMetaObjectExtraData
+ ?qt_static_metacall@QSwipeGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13770 NONAME ; void QSwipeGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QFormLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13771 NONAME ; void QFormLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QAbstractButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13772 NONAME ; void QAbstractButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QClipboard@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13773 NONAME ; void QClipboard::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QWidgetResizeHandler@@0UQMetaObjectExtraData@@B @ 13774 NONAME ; struct QMetaObjectExtraData const QWidgetResizeHandler::staticMetaObjectExtraData
+ ?qt_static_metacall@QIconEnginePlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13775 NONAME ; void QIconEnginePlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTreeWidget@@0UQMetaObjectExtraData@@B @ 13776 NONAME ; struct QMetaObjectExtraData const QTreeWidget::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QFileSystemModel@@0UQMetaObjectExtraData@@B @ 13777 NONAME ; struct QMetaObjectExtraData const QFileSystemModel::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsDropShadowEffect@@0UQMetaObjectExtraData@@B @ 13778 NONAME ; struct QMetaObjectExtraData const QGraphicsDropShadowEffect::staticMetaObjectExtraData
+ ?qt_static_metacall@QPushButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13779 NONAME ; void QPushButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QClipboard@@0UQMetaObjectExtraData@@B @ 13780 NONAME ; struct QMetaObjectExtraData const QClipboard::staticMetaObjectExtraData
+ ?qt_static_metacall@QHBoxLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13781 NONAME ; void QHBoxLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QKeyEventTransition@@0UQMetaObjectExtraData@@B @ 13782 NONAME ; struct QMetaObjectExtraData const QKeyEventTransition::staticMetaObjectExtraData
+ ?qt_static_metacall@QWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13783 NONAME ; void QWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QListView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13784 NONAME ; void QListView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?status@QZipWriter@@QBE?AW4Status@1@XZ @ 13785 NONAME ; enum QZipWriter::Status QZipWriter::status(void) const
+ ?qt_static_metacall@QProgressBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13786 NONAME ; void QProgressBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QMouseEventTransition@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13787 NONAME ; void QMouseEventTransition::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTextBrowser@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13788 NONAME ; void QTextBrowser::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QMessageBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13789 NONAME ; void QMessageBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QPaintBufferSignalProxy@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13790 NONAME ; void QPaintBufferSignalProxy::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QWizardPage@@0UQMetaObjectExtraData@@B @ 13791 NONAME ; struct QMetaObjectExtraData const QWizardPage::staticMetaObjectExtraData
+ ?qt_static_metacall@QMdiSubWindow@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13792 NONAME ; void QMdiSubWindow::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QFocusFrame@@0UQMetaObjectExtraData@@B @ 13793 NONAME ; struct QMetaObjectExtraData const QFocusFrame::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDockWidget@@0UQMetaObjectExtraData@@B @ 13794 NONAME ; struct QMetaObjectExtraData const QDockWidget::staticMetaObjectExtraData
+ ?qt_static_metacall@QShortcut@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13795 NONAME ; void QShortcut::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTextDocument@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13796 NONAME ; void QTextDocument::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QFileSystemModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13797 NONAME ; void QFileSystemModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QCompleter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13798 NONAME ; void QCompleter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QIntValidator@@0UQMetaObjectExtraData@@B @ 13799 NONAME ; struct QMetaObjectExtraData const QIntValidator::staticMetaObjectExtraData
+ ?qt_static_metacall@QDrag@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13800 NONAME ; void QDrag::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QRegExpValidator@@0UQMetaObjectExtraData@@B @ 13801 NONAME ; struct QMetaObjectExtraData const QRegExpValidator::staticMetaObjectExtraData
+ ?qt_static_metacall@QTabWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13802 NONAME ; void QTabWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QButtonGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13803 NONAME ; void QButtonGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QAction@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13804 NONAME ; void QAction::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QPixmapConvolutionFilter@@0UQMetaObjectExtraData@@B @ 13805 NONAME ; struct QMetaObjectExtraData const QPixmapConvolutionFilter::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QIconEnginePluginV2@@0UQMetaObjectExtraData@@B @ 13806 NONAME ; struct QMetaObjectExtraData const QIconEnginePluginV2::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QLabel@@0UQMetaObjectExtraData@@B @ 13807 NONAME ; struct QMetaObjectExtraData const QLabel::staticMetaObjectExtraData
+ ?qt_static_metacall@QInputDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13808 NONAME ; void QInputDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QMdiArea@@0UQMetaObjectExtraData@@B @ 13809 NONAME ; struct QMetaObjectExtraData const QMdiArea::staticMetaObjectExtraData
+ ?qt_static_metacall@QRadioButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13810 NONAME ; void QRadioButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QS60Style@@0UQMetaObjectExtraData@@B @ 13811 NONAME ; struct QMetaObjectExtraData const QS60Style::staticMetaObjectExtraData
+ ?qt_static_metacall@QToolBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13812 NONAME ; void QToolBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QDateEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13813 NONAME ; void QDateEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QAbstractScrollArea@@0UQMetaObjectExtraData@@B @ 13814 NONAME ; struct QMetaObjectExtraData const QAbstractScrollArea::staticMetaObjectExtraData
+ ?qt_static_metacall@QGroupBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13815 NONAME ; void QGroupBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?isWritable@QZipWriter@@QBE_NXZ @ 13816 NONAME ; bool QZipWriter::isWritable(void) const
+ ?qt_static_metacall@QToolButton@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13817 NONAME ; void QToolButton::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsRotation@@0UQMetaObjectExtraData@@B @ 13818 NONAME ; struct QMetaObjectExtraData const QGraphicsRotation::staticMetaObjectExtraData
+ ?qt_static_metacall@QDateTimeEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13819 NONAME ; void QDateTimeEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QPlainTextDocumentLayout@@0UQMetaObjectExtraData@@B @ 13820 NONAME ; struct QMetaObjectExtraData const QPlainTextDocumentLayout::staticMetaObjectExtraData
+ ?addFile@QZipWriter@@QAEXABVQString@@ABVQByteArray@@@Z @ 13821 NONAME ; void QZipWriter::addFile(class QString const &, class QByteArray const &)
+ ?staticMetaObjectExtraData@QComboBox@@0UQMetaObjectExtraData@@B @ 13822 NONAME ; struct QMetaObjectExtraData const QComboBox::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsColorizeEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13823 NONAME ; void QGraphicsColorizeEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QPixmapDropShadowFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13824 NONAME ; void QPixmapDropShadowFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QAbstractTextDocumentLayout@@0UQMetaObjectExtraData@@B @ 13825 NONAME ; struct QMetaObjectExtraData const QAbstractTextDocumentLayout::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QCheckBox@@0UQMetaObjectExtraData@@B @ 13826 NONAME ; struct QMetaObjectExtraData const QCheckBox::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QCalendarWidget@@0UQMetaObjectExtraData@@B @ 13827 NONAME ; struct QMetaObjectExtraData const QCalendarWidget::staticMetaObjectExtraData
+ ?qt_static_metacall@QWidgetAction@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13828 NONAME ; void QWidgetAction::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?device@QZipWriter@@QBEPAVQIODevice@@XZ @ 13829 NONAME ; class QIODevice * QZipWriter::device(void) const
+ ?staticMetaObjectExtraData@QBoxLayout@@0UQMetaObjectExtraData@@B @ 13830 NONAME ; struct QMetaObjectExtraData const QBoxLayout::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QRadioButton@@0UQMetaObjectExtraData@@B @ 13831 NONAME ; struct QMetaObjectExtraData const QRadioButton::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGridLayout@@0UQMetaObjectExtraData@@B @ 13832 NONAME ; struct QMetaObjectExtraData const QGridLayout::staticMetaObjectExtraData
+ ?qt_static_metacall@QDoubleValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13833 NONAME ; void QDoubleValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QKeyEventTransition@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13834 NONAME ; void QKeyEventTransition::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QMainWindow@@0UQMetaObjectExtraData@@B @ 13835 NONAME ; struct QMetaObjectExtraData const QMainWindow::staticMetaObjectExtraData
+ ?qt_static_metacall@QTextTable@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13836 NONAME ; void QTextTable::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsView@@0UQMetaObjectExtraData@@B @ 13837 NONAME ; struct QMetaObjectExtraData const QGraphicsView::staticMetaObjectExtraData
+ ?qt_static_metacall@QErrorMessage@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13838 NONAME ; void QErrorMessage::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QToolBox@@0UQMetaObjectExtraData@@B @ 13839 NONAME ; struct QMetaObjectExtraData const QToolBox::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTreeView@@0UQMetaObjectExtraData@@B @ 13840 NONAME ; struct QMetaObjectExtraData const QTreeView::staticMetaObjectExtraData
+ ?qt_static_metacall@QSlider@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13841 NONAME ; void QSlider::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QStringListModel@@0UQMetaObjectExtraData@@B @ 13842 NONAME ; struct QMetaObjectExtraData const QStringListModel::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QProgressBar@@0UQMetaObjectExtraData@@B @ 13843 NONAME ; struct QMetaObjectExtraData const QProgressBar::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTextList@@0UQMetaObjectExtraData@@B @ 13844 NONAME ; struct QMetaObjectExtraData const QTextList::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsTransform@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13845 NONAME ; void QGraphicsTransform::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QFormLayout@@0UQMetaObjectExtraData@@B @ 13846 NONAME ; struct QMetaObjectExtraData const QFormLayout::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGesture@@0UQMetaObjectExtraData@@B @ 13847 NONAME ; struct QMetaObjectExtraData const QGesture::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsAnchor@@0UQMetaObjectExtraData@@B @ 13848 NONAME ; struct QMetaObjectExtraData const QGraphicsAnchor::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTextObject@@0UQMetaObjectExtraData@@B @ 13849 NONAME ; struct QMetaObjectExtraData const QTextObject::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13850 NONAME ; void QGraphicsView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsOpacityEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13851 NONAME ; void QGraphicsOpacityEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QAbstractSlider@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13852 NONAME ; void QAbstractSlider::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QTreeWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13853 NONAME ; void QTreeWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QAbstractItemDelegate@@0UQMetaObjectExtraData@@B @ 13854 NONAME ; struct QMetaObjectExtraData const QAbstractItemDelegate::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QStatusBar@@0UQMetaObjectExtraData@@B @ 13855 NONAME ; struct QMetaObjectExtraData const QStatusBar::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QActionGroup@@0UQMetaObjectExtraData@@B @ 13856 NONAME ; struct QMetaObjectExtraData const QActionGroup::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDataWidgetMapper@@0UQMetaObjectExtraData@@B @ 13857 NONAME ; struct QMetaObjectExtraData const QDataWidgetMapper::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDial@@0UQMetaObjectExtraData@@B @ 13858 NONAME ; struct QMetaObjectExtraData const QDial::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QMdiSubWindow@@0UQMetaObjectExtraData@@B @ 13859 NONAME ; struct QMetaObjectExtraData const QMdiSubWindow::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsEffect@@0UQMetaObjectExtraData@@B @ 13860 NONAME ; struct QMetaObjectExtraData const QGraphicsEffect::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPictureFormatPlugin@@0UQMetaObjectExtraData@@B @ 13861 NONAME ; struct QMetaObjectExtraData const QPictureFormatPlugin::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsScale@@0UQMetaObjectExtraData@@B @ 13862 NONAME ; struct QMetaObjectExtraData const QGraphicsScale::staticMetaObjectExtraData
+ ?qt_static_metacall@QStandardItemModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13863 NONAME ; void QStandardItemModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QDockWidgetLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13864 NONAME ; void QDockWidgetLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QPinchGesture@@0UQMetaObjectExtraData@@B @ 13865 NONAME ; struct QMetaObjectExtraData const QPinchGesture::staticMetaObjectExtraData
+ ?qt_static_metacall@QLabel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13866 NONAME ; void QLabel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTableWidget@@0UQMetaObjectExtraData@@B @ 13867 NONAME ; struct QMetaObjectExtraData const QTableWidget::staticMetaObjectExtraData
+ ?close@QZipWriter@@QAEXXZ @ 13868 NONAME ; void QZipWriter::close(void)
+ ?qt_static_metacall@QStatusBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13869 NONAME ; void QStatusBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QCommandLinkButton@@0UQMetaObjectExtraData@@B @ 13870 NONAME ; struct QMetaObjectExtraData const QCommandLinkButton::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPushButton@@0UQMetaObjectExtraData@@B @ 13871 NONAME ; struct QMetaObjectExtraData const QPushButton::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QWidgetAction@@0UQMetaObjectExtraData@@B @ 13872 NONAME ; struct QMetaObjectExtraData const QWidgetAction::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QDoubleSpinBox@@0UQMetaObjectExtraData@@B @ 13873 NONAME ; struct QMetaObjectExtraData const QDoubleSpinBox::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTextTable@@0UQMetaObjectExtraData@@B @ 13874 NONAME ; struct QMetaObjectExtraData const QTextTable::staticMetaObjectExtraData
+ ?qt_static_metacall@QSplashScreen@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13875 NONAME ; void QSplashScreen::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QStackedLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13876 NONAME ; void QStackedLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QCompleter@@0UQMetaObjectExtraData@@B @ 13877 NONAME ; struct QMetaObjectExtraData const QCompleter::staticMetaObjectExtraData
+ ?qt_static_metacall@QAbstractScrollArea@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13878 NONAME ; void QAbstractScrollArea::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QDesktopWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13879 NONAME ; void QDesktopWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QAbstractSpinBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13880 NONAME ; void QAbstractSpinBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsEffectSource@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13881 NONAME ; void QGraphicsEffectSource::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?addSymLink@QZipWriter@@QAEXABVQString@@0@Z @ 13882 NONAME ; void QZipWriter::addSymLink(class QString const &, class QString const &)
+ ?staticMetaObjectExtraData@QGraphicsEffectSource@@0UQMetaObjectExtraData@@B @ 13883 NONAME ; struct QMetaObjectExtraData const QGraphicsEffectSource::staticMetaObjectExtraData
+ ?qt_static_metacall@QScroller@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13884 NONAME ABSENT ; void QScroller::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QStyle@@0UQMetaObjectExtraData@@B @ 13885 NONAME ; struct QMetaObjectExtraData const QStyle::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QTabWidget@@0UQMetaObjectExtraData@@B @ 13886 NONAME ; struct QMetaObjectExtraData const QTabWidget::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QPixmapFilter@@0UQMetaObjectExtraData@@B @ 13887 NONAME ; struct QMetaObjectExtraData const QPixmapFilter::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGraphicsOpacityEffect@@0UQMetaObjectExtraData@@B @ 13888 NONAME ; struct QMetaObjectExtraData const QGraphicsOpacityEffect::staticMetaObjectExtraData
+ ?qt_static_metacall@QBoxLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13889 NONAME ; void QBoxLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QAbstractTextDocumentLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13890 NONAME ; void QAbstractTextDocumentLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsSystemPlugin@@0UQMetaObjectExtraData@@B @ 13891 NONAME ; struct QMetaObjectExtraData const QGraphicsSystemPlugin::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QMouseEventTransition@@0UQMetaObjectExtraData@@B @ 13892 NONAME ; struct QMetaObjectExtraData const QMouseEventTransition::staticMetaObjectExtraData
+ ?qt_static_metacall@QTabBar@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13893 NONAME ; void QTabBar::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?compressionPolicy@QZipWriter@@QBE?AW4CompressionPolicy@1@XZ @ 13894 NONAME ; enum QZipWriter::CompressionPolicy QZipWriter::compressionPolicy(void) const
+ ?qt_static_metacall@QWindowsStyle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13895 NONAME ; void QWindowsStyle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QUndoGroup@@0UQMetaObjectExtraData@@B @ 13896 NONAME ; struct QMetaObjectExtraData const QUndoGroup::staticMetaObjectExtraData
+ ?qt_static_metacall@QStackedWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13897 NONAME ; void QStackedWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QColorDialog@@0UQMetaObjectExtraData@@B @ 13898 NONAME ; struct QMetaObjectExtraData const QColorDialog::staticMetaObjectExtraData
+ ?qt_static_metacall@QMdiArea@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13899 NONAME ; void QMdiArea::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QGraphicsScene@@0UQMetaObjectExtraData@@B @ 13900 NONAME ; struct QMetaObjectExtraData const QGraphicsScene::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QGroupBox@@0UQMetaObjectExtraData@@B @ 13901 NONAME ; struct QMetaObjectExtraData const QGroupBox::staticMetaObjectExtraData
+ ?qt_static_metacall@QInternalMimeData@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13902 NONAME ; void QInternalMimeData::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QAbstractSlider@@0UQMetaObjectExtraData@@B @ 13903 NONAME ; struct QMetaObjectExtraData const QAbstractSlider::staticMetaObjectExtraData
+ ?qt_static_metacall@QTapAndHoldGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13904 NONAME ; void QTapAndHoldGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QFocusFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13905 NONAME ; void QFocusFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QHBoxLayout@@0UQMetaObjectExtraData@@B @ 13906 NONAME ; struct QMetaObjectExtraData const QHBoxLayout::staticMetaObjectExtraData
+ ?qt_static_metacall@QSessionManager@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13907 NONAME ; void QSessionManager::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QSyntaxHighlighter@@0UQMetaObjectExtraData@@B @ 13908 NONAME ; struct QMetaObjectExtraData const QSyntaxHighlighter::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QLineEdit@@0UQMetaObjectExtraData@@B @ 13909 NONAME ; struct QMetaObjectExtraData const QLineEdit::staticMetaObjectExtraData
+ ?qt_static_metacall@QWizardPage@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13910 NONAME ; void QWizardPage::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QColorDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13911 NONAME ; void QColorDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QInputDialog@@0UQMetaObjectExtraData@@B @ 13912 NONAME ; struct QMetaObjectExtraData const QInputDialog::staticMetaObjectExtraData
+ ?qt_static_metacall@QPixmapColorizeFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13913 NONAME ; void QPixmapColorizeFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QListWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13914 NONAME ; void QListWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QAbstractProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13915 NONAME ; void QAbstractProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QVBoxLayout@@0UQMetaObjectExtraData@@B @ 13916 NONAME ; struct QMetaObjectExtraData const QVBoxLayout::staticMetaObjectExtraData
+ ?qt_static_metacall@QAbstractItemDelegate@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13917 NONAME ; void QAbstractItemDelegate::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QCommonStyle@@0UQMetaObjectExtraData@@B @ 13918 NONAME ; struct QMetaObjectExtraData const QCommonStyle::staticMetaObjectExtraData
+ ?qt_static_metacall@QPixmapFilter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13919 NONAME ; void QPixmapFilter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QLayout@@0UQMetaObjectExtraData@@B @ 13920 NONAME ; struct QMetaObjectExtraData const QLayout::staticMetaObjectExtraData
+ ?qt_static_metacall@QLayout@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13921 NONAME ; void QLayout::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QWindowsStyle@@0UQMetaObjectExtraData@@B @ 13922 NONAME ; struct QMetaObjectExtraData const QWindowsStyle::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QStackedWidget@@0UQMetaObjectExtraData@@B @ 13923 NONAME ; struct QMetaObjectExtraData const QStackedWidget::staticMetaObjectExtraData
+ ?qt_static_metacall@QGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13924 NONAME ; void QGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QMovie@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13925 NONAME ; void QMovie::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QPixmapColorizeFilter@@0UQMetaObjectExtraData@@B @ 13926 NONAME ; struct QMetaObjectExtraData const QPixmapColorizeFilter::staticMetaObjectExtraData
+ ?qt_static_metacall@QTableWidget@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13927 NONAME ; void QTableWidget::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QRubberBand@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13928 NONAME ; void QRubberBand::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QPlainTextEdit@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13929 NONAME ; void QPlainTextEdit::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QAbstractButton@@0UQMetaObjectExtraData@@B @ 13930 NONAME ; struct QMetaObjectExtraData const QAbstractButton::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QInternalMimeData@@0UQMetaObjectExtraData@@B @ 13931 NONAME ; struct QMetaObjectExtraData const QInternalMimeData::staticMetaObjectExtraData
+ ??1QZipWriter@@QAE@XZ @ 13932 NONAME ; QZipWriter::~QZipWriter(void)
+ ?staticMetaObjectExtraData@QDialogButtonBox@@0UQMetaObjectExtraData@@B @ 13933 NONAME ; struct QMetaObjectExtraData const QDialogButtonBox::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QUndoView@@0UQMetaObjectExtraData@@B @ 13934 NONAME ; struct QMetaObjectExtraData const QUndoView::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsTextItem@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13935 NONAME ; void QGraphicsTextItem::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?setCreationPermissions@QZipWriter@@QAEXV?$QFlags@W4Permission@QFile@@@@@Z @ 13936 NONAME ; void QZipWriter::setCreationPermissions(class QFlags<enum QFile::Permission>)
+ ?staticMetaObjectExtraData@QInputContext@@0UQMetaObjectExtraData@@B @ 13937 NONAME ; struct QMetaObjectExtraData const QInputContext::staticMetaObjectExtraData
+ ?qt_static_metacall@QInputContext@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13938 NONAME ; void QInputContext::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QEventDispatcherS60@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13939 NONAME ; void QEventDispatcherS60::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QFileDialog@@0UQMetaObjectExtraData@@B @ 13940 NONAME ; struct QMetaObjectExtraData const QFileDialog::staticMetaObjectExtraData
+ ?qt_static_metacall@QUndoGroup@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13941 NONAME ; void QUndoGroup::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QDialogButtonBox@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13942 NONAME ; void QDialogButtonBox::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QImageIOPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13943 NONAME ; void QImageIOPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QLCDNumber@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13944 NONAME ; void QLCDNumber::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QFontDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13945 NONAME ; void QFontDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QMainWindow@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13946 NONAME ; void QMainWindow::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QRegExpValidator@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13947 NONAME ; void QRegExpValidator::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QSplitterHandle@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13948 NONAME ; void QSplitterHandle::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?qt_static_metacall@QGraphicsEffect@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13949 NONAME ; void QGraphicsEffect::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QTapGesture@@0UQMetaObjectExtraData@@B @ 13950 NONAME ; struct QMetaObjectExtraData const QTapGesture::staticMetaObjectExtraData
+ ?qt_static_metacall@QItemDelegate@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13951 NONAME ; void QItemDelegate::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?staticMetaObjectExtraData@QWorkspace@@0UQMetaObjectExtraData@@B @ 13952 NONAME ; struct QMetaObjectExtraData const QWorkspace::staticMetaObjectExtraData
+ ?staticMetaObjectExtraData@QSessionManager@@0UQMetaObjectExtraData@@B @ 13953 NONAME ; struct QMetaObjectExtraData const QSessionManager::staticMetaObjectExtraData
+ ?qt_static_metacall@QGraphicsItemAnimation@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13954 NONAME ; void QGraphicsItemAnimation::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?setCursorMoveStyle@QLineControl@@QAEXW4MoveStyle@QTextCursor@@@Z @ 13955 NONAME ABSENT ; void QLineControl::setCursorMoveStyle(enum QTextCursor::MoveStyle)
+ ?staticMetaObjectExtraData@QIdentityProxyModel@@0UQMetaObjectExtraData@@B @ 13956 NONAME ; struct QMetaObjectExtraData const QIdentityProxyModel::staticMetaObjectExtraData
+ ?defaultCursorMoveStyle@QTextDocument@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 13957 NONAME ABSENT ; enum QTextCursor::MoveStyle QTextDocument::defaultCursorMoveStyle(void) const
+ ?offsetInLigature@QTextEngine@@QAE?AUQFixed@@PBUQScriptItem@@HHH@Z @ 13958 NONAME ; struct QFixed QTextEngine::offsetInLigature(struct QScriptItem const *, int, int, int)
+ ?qt_metacall@QIdentityProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13959 NONAME ; int QIdentityProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?mapSelectionFromSource@QIdentityProxyModel@@UBE?AVQItemSelection@@ABV2@@Z @ 13960 NONAME ; class QItemSelection QIdentityProxyModel::mapSelectionFromSource(class QItemSelection const &) const
+ ?qt_static_metacall@QIdentityProxyModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13961 NONAME ; void QIdentityProxyModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+ ?mapSelectionToSource@QIdentityProxyModel@@UBE?AVQItemSelection@@ABV2@@Z @ 13962 NONAME ; class QItemSelection QIdentityProxyModel::mapSelectionToSource(class QItemSelection const &) const
+ ??1QIdentityProxyModel@@UAE@XZ @ 13963 NONAME ; QIdentityProxyModel::~QIdentityProxyModel(void)
+ ??_EQIdentityProxyModel@@UAE@I@Z @ 13964 NONAME ; QIdentityProxyModel::~QIdentityProxyModel(unsigned int)
+ ?removeRows@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13965 NONAME ; bool QIdentityProxyModel::removeRows(int, int, class QModelIndex const &)
+ ?previousLogicalPosition@QTextEngine@@QBEHH@Z @ 13966 NONAME ; int QTextEngine::previousLogicalPosition(int) const
+ ?metaObject@QIdentityProxyModel@@UBEPBUQMetaObject@@XZ @ 13967 NONAME ; struct QMetaObject const * QIdentityProxyModel::metaObject(void) const
+ ?cursorMoveStyle@QLineControl@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 13968 NONAME ABSENT ; enum QTextCursor::MoveStyle QLineControl::cursorMoveStyle(void) const
+ ?removeColumns@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13969 NONAME ; bool QIdentityProxyModel::removeColumns(int, int, class QModelIndex const &)
+ ?alignLine@QTextEngine@@QAE?AUQFixed@@ABUQScriptLine@@@Z @ 13970 NONAME ; struct QFixed QTextEngine::alignLine(struct QScriptLine const &)
+ ?qt_s60_setPartialScreenAutomaticTranslation@@YAX_N@Z @ 13971 NONAME ; void qt_s60_setPartialScreenAutomaticTranslation(bool)
+ ?parent@QIdentityProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13972 NONAME ; class QModelIndex QIdentityProxyModel::parent(class QModelIndex const &) const
+ ?insertColumns@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13973 NONAME ; bool QIdentityProxyModel::insertColumns(int, int, class QModelIndex const &)
+ ?dropMimeData@QIdentityProxyModel@@UAE_NPBVQMimeData@@W4DropAction@Qt@@HHABVQModelIndex@@@Z @ 13974 NONAME ; bool QIdentityProxyModel::dropMimeData(class QMimeData const *, enum Qt::DropAction, int, int, class QModelIndex const &)
+ ?visualCursorMovement@QTextEngine@@QBE_NXZ @ 13975 NONAME ; bool QTextEngine::visualCursorMovement(void) const
+ ??0QRadialGradient@@QAE@MMMMMM@Z @ 13976 NONAME ; QRadialGradient::QRadialGradient(float, float, float, float, float, float)
+ ?setSourceModel@QIdentityProxyModel@@UAEXPAVQAbstractItemModel@@@Z @ 13977 NONAME ; void QIdentityProxyModel::setSourceModel(class QAbstractItemModel *)
+ ?getStaticMetaObject@QIdentityProxyModel@@SAABUQMetaObject@@XZ @ 13978 NONAME ; struct QMetaObject const & QIdentityProxyModel::getStaticMetaObject(void)
+ ?index@QIdentityProxyModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 13979 NONAME ; class QModelIndex QIdentityProxyModel::index(int, int, class QModelIndex const &) const
+ ?setInstantInvalidatePropagation@QGraphicsLayout@@SAX_N@Z @ 13980 NONAME ; void QGraphicsLayout::setInstantInvalidatePropagation(bool)
+ ?paintingActive@QVolatileImage@@QBE_NXZ @ 13981 NONAME ; bool QVolatileImage::paintingActive(void) const
+ ?insertRows@QIdentityProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 13982 NONAME ; bool QIdentityProxyModel::insertRows(int, int, class QModelIndex const &)
+ ?positionAfterVisualMovement@QTextEngine@@QAEHHW4MoveOperation@QTextCursor@@@Z @ 13983 NONAME ; int QTextEngine::positionAfterVisualMovement(int, enum QTextCursor::MoveOperation)
+ ?setCenterRadius@QRadialGradient@@QAEXM@Z @ 13984 NONAME ; void QRadialGradient::setCenterRadius(float)
+ ?leftCursorPosition@QTextLayout@@QBEHH@Z @ 13985 NONAME ; int QTextLayout::leftCursorPosition(int) const
+ ?focalRadius@QRadialGradient@@QBEMXZ @ 13986 NONAME ; float QRadialGradient::focalRadius(void) const
+ ?qt_metacast@QIdentityProxyModel@@UAEPAXPBD@Z @ 13987 NONAME ; void * QIdentityProxyModel::qt_metacast(char const *)
+ ?qt_draw_decoration_for_glyphs@@YAXPAVQPainter@@PBIPBUQFixedPoint@@HPAVQFontEngine@@ABVQFont@@ABVQTextCharFormat@@@Z @ 13988 NONAME ; void qt_draw_decoration_for_glyphs(class QPainter *, unsigned int const *, struct QFixedPoint const *, int, class QFontEngine *, class QFont const &, class QTextCharFormat const &)
+ ??0QRadialGradient@@QAE@ABVQPointF@@M0M@Z @ 13989 NONAME ; QRadialGradient::QRadialGradient(class QPointF const &, float, class QPointF const &, float)
+ ?centerRadius@QRadialGradient@@QBEMXZ @ 13990 NONAME ; float QRadialGradient::centerRadius(void) const
+ ?qt_isExtendedRadialGradient@@YA_NABVQBrush@@@Z @ 13991 NONAME ; bool qt_isExtendedRadialGradient(class QBrush const &)
+ ?mapToSource@QIdentityProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13992 NONAME ; class QModelIndex QIdentityProxyModel::mapToSource(class QModelIndex const &) const
+ ?d_func@QIdentityProxyModel@@AAEPAVQIdentityProxyModelPrivate@@XZ @ 13993 NONAME ; class QIdentityProxyModelPrivate * QIdentityProxyModel::d_func(void)
+ ?insertionPointsForLine@QTextEngine@@QAEXHAAV?$QVector@H@@@Z @ 13994 NONAME ; void QTextEngine::insertionPointsForLine(int, class QVector<int> &)
+ ?cloneWithSize@QFontEngine@@UBEPAV1@M@Z @ 13995 NONAME ; class QFontEngine * QFontEngine::cloneWithSize(float) const
+ ?setCursorMoveStyle@QLineEdit@@QAEXW4MoveStyle@QTextCursor@@@Z @ 13996 NONAME ABSENT ; void QLineEdit::setCursorMoveStyle(enum QTextCursor::MoveStyle)
+ ??0QIdentityProxyModel@@IAE@AAVQIdentityProxyModelPrivate@@PAVQObject@@@Z @ 13997 NONAME ; QIdentityProxyModel::QIdentityProxyModel(class QIdentityProxyModelPrivate &, class QObject *)
+ ?lineNumberForTextPosition@QTextEngine@@QAEHH@Z @ 13998 NONAME ; int QTextEngine::lineNumberForTextPosition(int)
+ ?instantInvalidatePropagation@QGraphicsLayout@@SA_NXZ @ 13999 NONAME ; bool QGraphicsLayout::instantInvalidatePropagation(void)
+ ?beginningOfLine@QTextEngine@@AAEHH@Z @ 14000 NONAME ; int QTextEngine::beginningOfLine(int)
+ ??0QIdentityProxyModel@@QAE@PAVQObject@@@Z @ 14001 NONAME ; QIdentityProxyModel::QIdentityProxyModel(class QObject *)
+ ?rightCursorPosition@QTextLayout@@QBEHH@Z @ 14002 NONAME ; int QTextLayout::rightCursorPosition(int) const
+ ?d_func@QIdentityProxyModel@@ABEPBVQIdentityProxyModelPrivate@@XZ @ 14003 NONAME ; class QIdentityProxyModelPrivate const * QIdentityProxyModel::d_func(void) const
+ ?columnCount@QIdentityProxyModel@@UBEHABVQModelIndex@@@Z @ 14004 NONAME ; int QIdentityProxyModel::columnCount(class QModelIndex const &) const
+ ?cursorMoveStyle@QLineEdit@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 14005 NONAME ABSENT ; enum QTextCursor::MoveStyle QLineEdit::cursorMoveStyle(void) const
+ ?trUtf8@QIdentityProxyModel@@SA?AVQString@@PBD0H@Z @ 14006 NONAME ; class QString QIdentityProxyModel::trUtf8(char const *, char const *, int)
+ ?setDefaultCursorMoveStyle@QTextDocument@@QAEXW4MoveStyle@QTextCursor@@@Z @ 14007 NONAME ABSENT ; void QTextDocument::setDefaultCursorMoveStyle(enum QTextCursor::MoveStyle)
+ ?actionText@QUndoCommand@@QBE?AVQString@@XZ @ 14008 NONAME ; class QString QUndoCommand::actionText(void) const
+ ?tr@QIdentityProxyModel@@SA?AVQString@@PBD0H@Z @ 14009 NONAME ; class QString QIdentityProxyModel::tr(char const *, char const *, int)
+ ?mapFromSource@QIdentityProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 14010 NONAME ; class QModelIndex QIdentityProxyModel::mapFromSource(class QModelIndex const &) const
+ ?nextLogicalPosition@QTextEngine@@QBEHH@Z @ 14011 NONAME ; int QTextEngine::nextLogicalPosition(int) const
+ ?setCursorMoveStyle@QTextLayout@@QAEXW4MoveStyle@QTextCursor@@@Z @ 14012 NONAME ABSENT ; void QTextLayout::setCursorMoveStyle(enum QTextCursor::MoveStyle)
+ ?doItemsLayout@QTableView@@UAEXXZ @ 14013 NONAME ; void QTableView::doItemsLayout(void)
+ ?setFocalRadius@QRadialGradient@@QAEXM@Z @ 14014 NONAME ; void QRadialGradient::setFocalRadius(float)
+ ?qt_painterPathFromVectorPath@@YA?AVQPainterPath@@ABVQVectorPath@@@Z @ 14015 NONAME ; class QPainterPath qt_painterPathFromVectorPath(class QVectorPath const &)
+ ?tr@QIdentityProxyModel@@SA?AVQString@@PBD0@Z @ 14016 NONAME ; class QString QIdentityProxyModel::tr(char const *, char const *)
+ ?match@QIdentityProxyModel@@UBE?AV?$QList@VQModelIndex@@@@ABVQModelIndex@@HABVQVariant@@HV?$QFlags@W4MatchFlag@Qt@@@@@Z @ 14017 NONAME ; class QList<class QModelIndex> QIdentityProxyModel::match(class QModelIndex const &, int, class QVariant const &, int, class QFlags<enum Qt::MatchFlag>) const
+ ?staticMetaObject@QIdentityProxyModel@@2UQMetaObject@@B @ 14018 NONAME ; struct QMetaObject const QIdentityProxyModel::staticMetaObject
+ ?rowCount@QIdentityProxyModel@@UBEHABVQModelIndex@@@Z @ 14019 NONAME ; int QIdentityProxyModel::rowCount(class QModelIndex const &) const
+ ?trUtf8@QIdentityProxyModel@@SA?AVQString@@PBD0@Z @ 14020 NONAME ; class QString QIdentityProxyModel::trUtf8(char const *, char const *)
+ ?cursorMoveStyle@QTextLayout@@QBE?AW4MoveStyle@QTextCursor@@XZ @ 14021 NONAME ABSENT ; enum QTextCursor::MoveStyle QTextLayout::cursorMoveStyle(void) const
+ ?endOfLine@QTextEngine@@AAEHH@Z @ 14022 NONAME ; int QTextEngine::endOfLine(int)
+ ?setCursorMoveStyle@QTextLayout@@QAEXW4CursorMoveStyle@Qt@@@Z @ 14023 NONAME ; void QTextLayout::setCursorMoveStyle(enum Qt::CursorMoveStyle)
+ ?defaultCursorMoveStyle@QTextDocument@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14024 NONAME ; enum Qt::CursorMoveStyle QTextDocument::defaultCursorMoveStyle(void) const
+ ?cursorMoveStyle@QTextLayout@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14025 NONAME ; enum Qt::CursorMoveStyle QTextLayout::cursorMoveStyle(void) const
+ ?setDefaultCursorMoveStyle@QTextDocument@@QAEXW4CursorMoveStyle@Qt@@@Z @ 14026 NONAME ; void QTextDocument::setDefaultCursorMoveStyle(enum Qt::CursorMoveStyle)
+ ?setCursorMoveStyle@QLineControl@@QAEXW4CursorMoveStyle@Qt@@@Z @ 14027 NONAME ; void QLineControl::setCursorMoveStyle(enum Qt::CursorMoveStyle)
+ ?cursorMoveStyle@QLineEdit@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14028 NONAME ; enum Qt::CursorMoveStyle QLineEdit::cursorMoveStyle(void) const
+ ?forceToRaster@QSymbianGraphicsSystemEx@@UAEXPAVQWidget@@@Z @ 14029 NONAME ; void QSymbianGraphicsSystemEx::forceToRaster(class QWidget *)
+ ?releaseCachedGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 14030 NONAME ; void QSymbianGraphicsSystemEx::releaseCachedGpuResources(void)
+ ?setCursorMoveStyle@QLineEdit@@QAEXW4CursorMoveStyle@Qt@@@Z @ 14031 NONAME ; void QLineEdit::setCursorMoveStyle(enum Qt::CursorMoveStyle)
+ ?platformExtension@QGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 14032 NONAME ; class QGraphicsSystemEx * QGraphicsSystem::platformExtension(void)
+ ?releaseAllGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 14033 NONAME ; void QSymbianGraphicsSystemEx::releaseAllGpuResources(void)
+ ?cursorMoveStyle@QLineControl@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14034 NONAME ; enum Qt::CursorMoveStyle QLineControl::cursorMoveStyle(void) const
+ ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 14035 NONAME ABSENT ; bool QSymbianGraphicsSystemEx::hasBCM2727(void)
+ ?hasStaticContentsSupport@QWindowSurface@@QBE_NXZ @ 14036 NONAME ABSENT ; bool QWindowSurface::hasStaticContentsSupport(void) const
+ ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 14037 NONAME ABSENT ; bool QWindowSurface::hasPartialUpdateSupport(void) const
+ ??0QSymbianGraphicsSystemEx@@QAE@XZ @ 14038 NONAME ABSENT ; QSymbianGraphicsSystemEx::QSymbianGraphicsSystemEx(void)
+ ?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 14039 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void)
+ ?getClusterLength@QTextEngine@@AAEHPAGPBUHB_CharAttributes@@HHHPAH@Z @ 14040 NONAME ; int QTextEngine::getClusterLength(unsigned short *, struct HB_CharAttributes const *, int, int, int, int *)
+ ?positionInLigature@QTextEngine@@QAEHPBUQScriptItem@@HUQFixed@@1H_N@Z @ 14041 NONAME ; int QTextEngine::positionInLigature(struct QScriptItem const *, int, struct QFixed, struct QFixed, int, bool)
+ ?supportsTransformations@QPaintEngineEx@@UBE_NMABVQTransform@@@Z @ 14042 NONAME ; bool QPaintEngineEx::supportsTransformations(float, class QTransform const &) const
+ ?drawStaticTextItem@QPaintEngineEx@@UAEXPAVQStaticTextItem@@@Z @ 14043 NONAME ; void QPaintEngineEx::drawStaticTextItem(class QStaticTextItem *)
diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def
index dd9dfaeaf5..5bc8403be7 100644
--- a/src/s60installs/bwins/QtNetworku.def
+++ b/src/s60installs/bwins/QtNetworku.def
@@ -1237,9 +1237,9 @@ EXPORTS
?qt_static_metacall@QBearerEnginePlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1236 NONAME ; void QBearerEnginePlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
?staticMetaObjectExtraData@QNetworkConfigurationManager@@0UQMetaObjectExtraData@@B @ 1237 NONAME ; struct QMetaObjectExtraData const QNetworkConfigurationManager::staticMetaObjectExtraData
?qt_static_metacall@QTcpSocket@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1238 NONAME ; void QTcpSocket::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
- ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@GABVQString@@W4QueryType@0@@Z @ 1239 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, unsigned short, class QString const &, enum QNetworkProxyQuery::QueryType)
+ ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@ABVQUrl@@W4QueryType@0@@Z @ 1239 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, class QUrl const &, enum QNetworkProxyQuery::QueryType)
??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@ABVQString@@H1W4QueryType@0@@Z @ 1240 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, class QString const &, int, class QString const &, enum QNetworkProxyQuery::QueryType)
?networkConfiguration@QNetworkProxyQuery@@QBE?AVQNetworkConfiguration@@XZ @ 1241 NONAME ; class QNetworkConfiguration QNetworkProxyQuery::networkConfiguration(void) const
?setNetworkConfiguration@QNetworkProxyQuery@@QAEXABVQNetworkConfiguration@@@Z @ 1242 NONAME ; void QNetworkProxyQuery::setNetworkConfiguration(class QNetworkConfiguration const &)
- ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@ABVQUrl@@W4QueryType@0@@Z @ 1243 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, class QUrl const &, enum QNetworkProxyQuery::QueryType)
+ ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@GABVQString@@W4QueryType@0@@Z @ 1243 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, unsigned short, class QString const &, enum QNetworkProxyQuery::QueryType)
diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def
index 745bc9b7ab..f1edc231be 100644
--- a/src/s60installs/bwins/QtOpenGLu.def
+++ b/src/s60installs/bwins/QtOpenGLu.def
@@ -818,7 +818,7 @@ EXPORTS
?glGenFramebuffers@QGLFunctions@@QAEXHPAI@Z @ 817 NONAME ; void QGLFunctions::glGenFramebuffers(int, unsigned int *)
?glVertexAttrib3fv@QGLFunctions@@QAEXIPBM@Z @ 818 NONAME ; void QGLFunctions::glVertexAttrib3fv(unsigned int, float const *)
?glGetVertexAttribPointerv@QGLFunctions@@QAEXIIPAPAX@Z @ 819 NONAME ; void QGLFunctions::glGetVertexAttribPointerv(unsigned int, unsigned int, void * *)
- ?snippetNameStr@QGLEngineSharedShaders@@SA?AVQByteArray@@W4SnippetName@1@@Z @ 820 NONAME ABSENT ; class QByteArray QGLEngineSharedShaders::snippetNameStr(enum QGLEngineSharedShaders::SnippetName)
+ ?snippetNameStr@QGLEngineSharedShaders@@SA?AVQByteArray@@W4SnippetName@1@@Z @ 820 NONAME ; class QByteArray QGLEngineSharedShaders::snippetNameStr(enum QGLEngineSharedShaders::SnippetName)
?glUniformMatrix4fv@QGLFunctions@@QAEXHHEPBM@Z @ 821 NONAME ; void QGLFunctions::glUniformMatrix4fv(int, int, unsigned char, float const *)
?setContext@QGLTextureGlyphCache@@QAEXPBVQGLContext@@@Z @ 822 NONAME ; void QGLTextureGlyphCache::setContext(class QGLContext const *)
?glDeleteBuffers@QGLFunctions@@QAEXHPBI@Z @ 823 NONAME ; void QGLFunctions::glDeleteBuffers(int, unsigned int const *)
@@ -876,4 +876,3 @@ EXPORTS
?qt_static_metacall@QGLShaderProgram@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 875 NONAME ; void QGLShaderProgram::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
?platformExtension@QGLGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 876 NONAME ; class QGraphicsSystemEx * QGLGraphicsSystem::platformExtension(void)
?releaseCachedGpuResources@QGLGraphicsSystem@@UAEXXZ @ 877 NONAME ; void QGLGraphicsSystem::releaseCachedGpuResources(void)
-
diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def
index c9fc813dc2..eb4c7bce98 100644
--- a/src/s60installs/bwins/QtOpenVGu.def
+++ b/src/s60installs/bwins/QtOpenVGu.def
@@ -185,4 +185,5 @@ EXPORTS
?releaseNativeImageHandle@QVGPixmapData@@QAEXXZ @ 184 NONAME ; void QVGPixmapData::releaseNativeImageHandle(void)
?forceToImage@QVGPixmapData@@IAEX_N@Z @ 185 NONAME ; void QVGPixmapData::forceToImage(bool)
?features@QVGWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 186 NONAME ; class QFlags<enum QWindowSurface::WindowSurfaceFeature> QVGWindowSurface::features(void) const
+ ?supportsTransformations@QVGPaintEngine@@UBE_NMABVQTransform@@@Z @ 187 NONAME ; bool QVGPaintEngine::supportsTransformations(float, class QTransform const &) const
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 6c4e837e8d..c754d917a3 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -43,7 +43,7 @@ EXPORTS
_Z21qt_regexp_toCanonicalRK7QStringN7QRegExp13PatternSyntaxE @ 42 NONAME
_Z23qUnregisterResourceDataiPKhS0_S0_ @ 43 NONAME
_Z23qt_qFindChildren_helperPK7QObjectRK7QStringPK7QRegExpRK11QMetaObjectP5QListIPvE @ 44 NONAME
- _Z23qt_resolveS60PluginFunci @ 45 NONAME
+ _Z23qt_resolveS60PluginFunci @ 45 NONAME ABSENT
_Z23qt_symbian_throwIfErrori @ 46 NONAME
_Z24qGlobalPostedEventsCountv @ 47 NONAME
_Z24qcoreStateMachineHandlerv @ 48 NONAME
@@ -1294,7 +1294,7 @@ EXPORTS
_ZN23QEventDispatcherSymbian24reactivateSocketNotifierEP15QSocketNotifier @ 1293 NONAME
_ZN23QEventDispatcherSymbian24sendDeferredSocketEventsEv @ 1294 NONAME
_ZN23QEventDispatcherSymbian24unregisterSocketNotifierEP15QSocketNotifier @ 1295 NONAME
- _ZN23QEventDispatcherSymbian31reactivateDeferredActiveObjectsEv @ 1296 NONAME
+ _ZN23QEventDispatcherSymbian31reactivateDeferredActiveObjectsEv @ 1296 NONAME ABSENT
_ZN23QEventDispatcherSymbian5flushEv @ 1297 NONAME
_ZN23QEventDispatcherSymbian6wakeUpEv @ 1298 NONAME
_ZN23QEventDispatcherSymbian9interruptEv @ 1299 NONAME
@@ -3713,7 +3713,7 @@ EXPORTS
_ZrsR11QDataStreamR12QEasingCurve @ 3712 NONAME
_Z26qt_symbian_SetupThreadHeapiR24SStdEpocThreadCreateInfo @ 3713 NONAME
_ZN24QAbstractDeclarativeData17objectNameChangedE @ 3714 NONAME DATA 4
- _ZN23QEventDispatcherSymbian36queueDeferredActiveObjectsCompletionEv @ 3715 NONAME
+ _ZN23QEventDispatcherSymbian36queueDeferredActiveObjectsCompletionEv @ 3715 NONAME ABSENT
_ZN23QCoreApplicationPrivate18symbianCommandLineEv @ 3716 NONAME
_ZNK11QMetaMethod8revisionEv @ 3717 NONAME
_ZNK13QMetaProperty8revisionEv @ 3718 NONAME
@@ -3850,11 +3850,11 @@ EXPORTS
_ZN11QTranslator18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 3849 NONAME
_ZN11QTranslator25staticMetaObjectExtraDataE @ 3850 NONAME DATA 8
_ZN11QTranslator4loadERK7QLocaleRK7QStringS5_S5_S5_ @ 3851 NONAME
- _ZN13QActiveObject18maybeQueueForLaterEv @ 3852 NONAME
+ _ZN13QActiveObject18maybeQueueForLaterEv @ 3852 NONAME ABSENT
_ZN13QActiveObject21maybeDeferSocketEventEv @ 3853 NONAME
_ZN13QActiveObject21reactivateAndCompleteEv @ 3854 NONAME
- _ZN13QActiveObject4waitE5QListIP7CActiveEi @ 3855 NONAME
- _ZN13QActiveObject4waitEP7CActivei @ 3856 NONAME
+ _ZN13QActiveObject4waitE5QListIP7CActiveEi @ 3855 NONAME ABSENT
+ _ZN13QActiveObject4waitEP7CActivei @ 3856 NONAME ABSENT
_ZN13QActiveObjectC2EiP23QEventDispatcherSymbian @ 3857 NONAME
_ZN13QActiveObjectD0Ev @ 3858 NONAME
_ZN13QActiveObjectD1Ev @ 3859 NONAME
@@ -4154,4 +4154,12 @@ EXPORTS
_ZTVN12QtConcurrent16ThreadEngineBaseE @ 4153 NONAME
_ZTVN12QtConcurrent18UnhandledExceptionE @ 4154 NONAME
_ZTVN12QtConcurrent9ExceptionE @ 4155 NONAME
+ _Z15qIsEffectiveTLDRK7QString @ 4156 NONAME
+ _Z15qTopLevelDomainRK7QString @ 4157 NONAME
+ _ZN5QUuid11fromRfc4122ERK10QByteArray @ 4158 NONAME
+ _ZN5QUuidC1ERK10QByteArray @ 4159 NONAME
+ _ZN5QUuidC2ERK10QByteArray @ 4160 NONAME
+ _ZNK4QUrl14topLevelDomainEv @ 4161 NONAME
+ _ZNK5QUuid11toByteArrayEv @ 4162 NONAME
+ _ZNK5QUuid9toRfc4122Ev @ 4163 NONAME
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index f0b9ea8c00..b40ac381dd 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -1966,25 +1966,45 @@ EXPORTS
_ZN15QPacketProtocol16waitForReadyReadEi @ 1965 NONAME
_ZN23QDeclarativeDebugServer14waitForMessageEP24QDeclarativeDebugService @ 1966 NONAME
_ZN24QDeclarativeDebugService14waitForMessageEv @ 1967 NONAME
- _ZN27QDeclarativeObserverService10gotMessageERK10QByteArray @ 1968 NONAME
- _ZN27QDeclarativeObserverService10removeViewEP16QDeclarativeView @ 1969 NONAME
- _ZN27QDeclarativeObserverService11qt_metacallEN11QMetaObject4CallEiPPv @ 1970 NONAME
- _ZN27QDeclarativeObserverService11qt_metacastEPKc @ 1971 NONAME
- _ZN27QDeclarativeObserverService11sendMessageERK10QByteArray @ 1972 NONAME
- _ZN27QDeclarativeObserverService13statusChangedEN24QDeclarativeDebugService6StatusE @ 1973 NONAME
- _ZN27QDeclarativeObserverService15messageReceivedERK10QByteArray @ 1974 NONAME
- _ZN27QDeclarativeObserverService16staticMetaObjectE @ 1975 NONAME DATA 16
- _ZN27QDeclarativeObserverService18loadObserverPluginEv @ 1976 NONAME
- _ZN27QDeclarativeObserverService18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 1977 NONAME
- _ZN27QDeclarativeObserverService19getStaticMetaObjectEv @ 1978 NONAME
- _ZN27QDeclarativeObserverService25staticMetaObjectExtraDataE @ 1979 NONAME DATA 8
- _ZN27QDeclarativeObserverService7addViewEP16QDeclarativeView @ 1980 NONAME
- _ZN27QDeclarativeObserverService8instanceEv @ 1981 NONAME
- _ZN27QDeclarativeObserverServiceC1Ev @ 1982 NONAME
- _ZN27QDeclarativeObserverServiceC2Ev @ 1983 NONAME
+ _ZN27QDeclarativeObserverService10gotMessageERK10QByteArray @ 1968 NONAME ABSENT
+ _ZN27QDeclarativeObserverService10removeViewEP16QDeclarativeView @ 1969 NONAME ABSENT
+ _ZN27QDeclarativeObserverService11qt_metacallEN11QMetaObject4CallEiPPv @ 1970 NONAME ABSENT
+ _ZN27QDeclarativeObserverService11qt_metacastEPKc @ 1971 NONAME ABSENT
+ _ZN27QDeclarativeObserverService11sendMessageERK10QByteArray @ 1972 NONAME ABSENT
+ _ZN27QDeclarativeObserverService13statusChangedEN24QDeclarativeDebugService6StatusE @ 1973 NONAME ABSENT
+ _ZN27QDeclarativeObserverService15messageReceivedERK10QByteArray @ 1974 NONAME ABSENT
+ _ZN27QDeclarativeObserverService16staticMetaObjectE @ 1975 NONAME DATA 16 ABSENT
+ _ZN27QDeclarativeObserverService18loadObserverPluginEv @ 1976 NONAME ABSENT
+ _ZN27QDeclarativeObserverService18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 1977 NONAME ABSENT
+ _ZN27QDeclarativeObserverService19getStaticMetaObjectEv @ 1978 NONAME ABSENT
+ _ZN27QDeclarativeObserverService25staticMetaObjectExtraDataE @ 1979 NONAME DATA 8 ABSENT
+ _ZN27QDeclarativeObserverService7addViewEP16QDeclarativeView @ 1980 NONAME ABSENT
+ _ZN27QDeclarativeObserverService8instanceEv @ 1981 NONAME ABSENT
+ _ZN27QDeclarativeObserverServiceC1Ev @ 1982 NONAME ABSENT
+ _ZN27QDeclarativeObserverServiceC2Ev @ 1983 NONAME ABSENT
_ZN28QDeclarativeDebuggingEnablerC1Ev @ 1984 NONAME
_ZN28QDeclarativeDebuggingEnablerC2Ev @ 1985 NONAME
- _ZNK27QDeclarativeObserverService10metaObjectEv @ 1986 NONAME
- _ZTI27QDeclarativeObserverService @ 1987 NONAME
- _ZTV27QDeclarativeObserverService @ 1988 NONAME
+ _ZNK27QDeclarativeObserverService10metaObjectEv @ 1986 NONAME ABSENT
+ _ZTI27QDeclarativeObserverService @ 1987 NONAME ABSENT
+ _ZTV27QDeclarativeObserverService @ 1988 NONAME ABSENT
+ _ZN18QDeclarativePixmap10flushCacheEv @ 1989 NONAME
+ _ZN28QDeclarativeInspectorService10gotMessageERK10QByteArray @ 1990 NONAME
+ _ZN28QDeclarativeInspectorService10removeViewEP16QDeclarativeView @ 1991 NONAME
+ _ZN28QDeclarativeInspectorService11qt_metacallEN11QMetaObject4CallEiPPv @ 1992 NONAME
+ _ZN28QDeclarativeInspectorService11qt_metacastEPKc @ 1993 NONAME
+ _ZN28QDeclarativeInspectorService11sendMessageERK10QByteArray @ 1994 NONAME
+ _ZN28QDeclarativeInspectorService13statusChangedEN24QDeclarativeDebugService6StatusE @ 1995 NONAME
+ _ZN28QDeclarativeInspectorService15messageReceivedERK10QByteArray @ 1996 NONAME
+ _ZN28QDeclarativeInspectorService16staticMetaObjectE @ 1997 NONAME DATA 16
+ _ZN28QDeclarativeInspectorService18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 1998 NONAME
+ _ZN28QDeclarativeInspectorService19getStaticMetaObjectEv @ 1999 NONAME
+ _ZN28QDeclarativeInspectorService19loadInspectorPluginEv @ 2000 NONAME
+ _ZN28QDeclarativeInspectorService25staticMetaObjectExtraDataE @ 2001 NONAME DATA 8
+ _ZN28QDeclarativeInspectorService7addViewEP16QDeclarativeView @ 2002 NONAME
+ _ZN28QDeclarativeInspectorService8instanceEv @ 2003 NONAME
+ _ZN28QDeclarativeInspectorServiceC1Ev @ 2004 NONAME
+ _ZN28QDeclarativeInspectorServiceC2Ev @ 2005 NONAME
+ _ZNK28QDeclarativeInspectorService10metaObjectEv @ 2006 NONAME
+ _ZTI28QDeclarativeInspectorService @ 2007 NONAME
+ _ZTV28QDeclarativeInspectorService @ 2008 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index ecdec9d2ad..4ca71e905f 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12104,7 +12104,7 @@ EXPORTS
_ZN15QStaticTextItem13setFontEngineEP11QFontEngine @ 12103 NONAME
_ZN15QStaticTextItemD1Ev @ 12104 NONAME
_ZN15QStaticTextItemD2Ev @ 12105 NONAME
- _ZN19QEventDispatcherS6031reactivateDeferredActiveObjectsEv @ 12106 NONAME
+ _ZN19QEventDispatcherS6031reactivateDeferredActiveObjectsEv @ 12106 NONAME ABSENT
_ZN20QGraphicsItemPrivate11setSubFocusEP13QGraphicsItemS1_ @ 12107 NONAME
_ZN20QGraphicsItemPrivate13clearSubFocusEP13QGraphicsItemS1_ @ 12108 NONAME
_ZN12QLineControl21resetCursorBlinkTimerEv @ 12109 NONAME
@@ -12749,4 +12749,8 @@ EXPORTS
_ZTI17QGraphicsSystemEx @ 12748 NONAME
_ZTI24QSymbianGraphicsSystemEx @ 12749 NONAME
_ZTV24QSymbianGraphicsSystemEx @ 12750 NONAME
+ _ZN11QTextEngine16getClusterLengthEPtPK17HB_CharAttributesiiiPi @ 12751 NONAME
+ _ZN11QTextEngine18positionInLigatureEPK11QScriptItemi6QFixedS3_ib @ 12752 NONAME
+ _ZN14QPaintEngineEx18drawStaticTextItemEP15QStaticTextItem @ 12753 NONAME
+ _ZNK14QPaintEngineEx23supportsTransformationsEfRK10QTransform @ 12754 NONAME
diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def
index 2b67d2c3e6..695829cfdd 100644
--- a/src/s60installs/eabi/QtOpenGLu.def
+++ b/src/s60installs/eabi/QtOpenGLu.def
@@ -763,9 +763,9 @@ EXPORTS
_ZTI27QGLContextGroupResourceBase @ 762 NONAME ABSENT
_ZTV22QGLContextResourceBase @ 763 NONAME ABSENT
_ZTV27QGLContextGroupResourceBase @ 764 NONAME ABSENT
- _ZThn104_N20QGLTextureGlyphCacheD0Ev @ 765 NONAME ABSENT
- _ZThn104_N20QGLTextureGlyphCacheD1Ev @ 766 NONAME ABSENT
- _ZThn8_NK16QGLWindowSurface8featuresEv @ 767 NONAME ABSENT
+ _ZThn104_N20QGLTextureGlyphCacheD0Ev @ 765 NONAME
+ _ZThn104_N20QGLTextureGlyphCacheD1Ev @ 766 NONAME
+ _ZThn8_NK16QGLWindowSurface8featuresEv @ 767 NONAME
_ZN14QGLSignalProxy18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 768 NONAME
_ZN14QGLSignalProxy25staticMetaObjectExtraDataE @ 769 NONAME DATA 8
_ZN16QGLShaderProgram18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 770 NONAME
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index d6b36e0fe3..bddabd5821 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -40,7 +40,7 @@ file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll
// Phonon MMF backend
file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll
-data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
// graphicssystems
file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll
@@ -49,46 +49,42 @@ file=ABI_DIR\BUILD_DIR\qglgraphicssystem.dll SHARED_LIB_DIR\qglgraphicssystem.dl
// bearer
file=ABI_DIR\BUILD_DIR\qsymbianbearer.dll SHARED_LIB_DIR\qsymbianbearer.dll
-// S60 version compatibility plugins for 5.0 (3.1 and 3.2 devices are never likely to have this in ROM,
-// so don't bother including those plugins
-file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll
-
// imageformats stubs
-data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
// codecs stubs
-data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
// iconengines stubs
-data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
// qml import plugins
file=ABI_DIR\BUILD_DIR\qmlfolderlistmodelplugin.dll SHARED_LIB_DIR\qmlfolderlistmodelplugin.dll
file=ABI_DIR\BUILD_DIR\qmlgesturesplugin.dll SHARED_LIB_DIR\qmlgesturesplugin.dll
file=ABI_DIR\BUILD_DIR\qmlparticlesplugin.dll SHARED_LIB_DIR\qmlparticlesplugin.dll
-data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin
-data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin
-data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin
-data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir
-data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir
-data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir
// graphicssystems
-data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
-data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin
// bearer stub
-data=\epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin
// Stub sis file
data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 02c3da0d9f..0d257fb6db 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -10,10 +10,10 @@ symbian: {
TARGET = "Qt$${QT_LIBINFIX}"
isEmpty(QT_LIBINFIX) {
- TARGET.UID3 = 0x2001E61C
+ TARGET.UID3 = 0x2001e61c
} else {
# Always use experimental UID for infixed configuration to avoid UID clash
- TARGET.UID3 = 0xE001E61C
+ TARGET.UID3 = 0xe001e61c
}
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
@@ -40,37 +40,24 @@ symbian: {
bearerStubZ = $${PWD}/qsymbianbearer.qtplugin
}
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ contains(S60_VERSION, 5.0) {
qts60plugindeployment = \
"IF package(0x2003A678) OR package(0x20022E6D)" \
- " \"$$pluginLocations/qts60plugin_5_0$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0$${QT_LIBINFIX}.dll\"" \
" \"$$bearerPluginLocation/qsymbianbearer$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qsymbianbearer$${QT_LIBINFIX}.dll\"" \
"ELSEIF package(0x1028315F)" \
- " \"$$pluginLocations/qts60plugin_5_0$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0$${QT_LIBINFIX}.dll\"" \
" \"$$bearerPluginLocation/qsymbianbearer$${QT_LIBINFIX}_3_2.dll\" - \"c:\\sys\\bin\\qsymbianbearer$${QT_LIBINFIX}.dll\"" \
- "ELSEIF package(0x102752AE)" \
- " \"$$pluginLocations/qts60plugin_3_2$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_3_2$${QT_LIBINFIX}.dll\"" \
- " \"$$bearerPluginLocation/qsymbianbearer$${QT_LIBINFIX}_3_2.dll\" - \"c:\\sys\\bin\\qsymbianbearer$${QT_LIBINFIX}.dll\"" \
- "ELSEIF package(0x102032BE)" \
- " \"$$pluginLocations/qts60plugin_3_1$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_3_1$${QT_LIBINFIX}.dll\"" \
- " \"$$bearerPluginLocation/qsymbianbearer$${QT_LIBINFIX}_3_1.dll\" - \"c:\\sys\\bin\\qsymbianbearer$${QT_LIBINFIX}.dll\"" \
"ELSE" \
- " \"$$pluginLocations/qts60plugin_5_0$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0$${QT_LIBINFIX}.dll\"" \
" \"$$bearerPluginLocation/qsymbianbearer$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qsymbianbearer$${QT_LIBINFIX}.dll\"" \
"ENDIF" \
" \"$$bearerStubZ\" - \"c:$$replace(QT_PLUGINS_BASE_DIR,/,\\)\\bearer\\qsymbianbearer$${QT_LIBINFIX}.qtplugin\""
+ qtlibraries.pkg_postrules += qts60plugindeployment
} else {
# No need to deploy plugins for older platform versions when building on Symbian3 or later
- qts60plugindeployment = \
- " \"$$pluginLocations/qts60plugin_5_0$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0$${QT_LIBINFIX}.dll\""
-
bearer_plugin.files = $$QT_BUILD_TREE/plugins/bearer/qsymbianbearer$${QT_LIBINFIX}.dll
bearer_plugin.path = c:$$QT_PLUGINS_BASE_DIR/bearer
DEPLOYMENT += bearer_plugin
}
- qtlibraries.pkg_postrules += qts60plugindeployment
-
qtlibraries.path = c:/sys/bin
vendorinfo = \
@@ -86,7 +73,7 @@ symbian: {
qtlibraries.pkg_prerules += "; Dependencies of Qt libraries"
# It is expected that Symbian^3 and newer phones will have sufficiently new OpenC already installed
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ contains(S60_VERSION, 5.0) {
qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
@@ -116,7 +103,7 @@ symbian: {
# Support backup & restore for Qt libraries
qtbackup.files = backup_registration.xml
- qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+ qtbackup.path = c:/private/10202d56/import/packages/$$replace(TARGET.UID3, 0x,)
DEPLOYMENT += qtlibraries \
qtbackup \
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index a3a965ea46..1c4f110fc6 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -3820,7 +3820,7 @@ QStringList QScriptEngine::importedExtensions() const
which did not support member template functions. It is advised
to use the other form in new code.
- \sa QScriptEngine::toScriptValue(), qscriptvalue_cast
+ \sa QScriptEngine::toScriptValue(), qscriptvalue_cast()
*/
/*!
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index ce42e40bdc..c615a30b48 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -1006,7 +1006,8 @@ QString QSqlTableModel::orderByClause() const
}
/*!
- Returns the index of the field \a fieldName.
+ Returns the index of the field \a fieldName, or -1 if no corresponding field
+ exists in the model.
*/
int QSqlTableModel::fieldIndex(const QString &fieldName) const
{
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index 4b260e8597..22c7c3774c 100644
--- a/src/testlib/qbenchmarkvalgrind.cpp
+++ b/src/testlib/qbenchmarkvalgrind.cpp
@@ -225,6 +225,12 @@ bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppA
return finishedOk;
}
+#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+// the callgrind macros below generate warnings
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#endif
+
void QBenchmarkCallgrindMeasurer::start()
{
CALLGRIND_ZERO_STATS;
@@ -237,6 +243,11 @@ qint64 QBenchmarkCallgrindMeasurer::checkpoint()
return result;
}
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+// the callgrind macros above generate warnings
+# pragma GCC diagnostic pop
+#endif
+
qint64 QBenchmarkCallgrindMeasurer::stop()
{
return checkpoint();
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
index 184fbb987f..298c6997b1 100644
--- a/tests/arthur/common/paintcommands.cpp
+++ b/tests/arthur/common/paintcommands.cpp
@@ -48,6 +48,7 @@
#include <qtextstream.h>
#include <qtextlayout.h>
#include <qdebug.h>
+#include <QStaticText>
#ifdef QT3_SUPPORT
#include <q3painter.h>
@@ -464,6 +465,10 @@ void PaintCommands::staticInit()
"^drawText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
"drawText <x> <y> <text>",
"drawText 10 10 \"my text\"");
+ DECL_PAINTCOMMAND("drawStaticText", command_drawStaticText,
+ "^drawStaticText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
+ "drawStaticText <x> <y> <text>",
+ "drawStaticText 10 10 \"my text\"");
DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap,
"^drawTiledPixmap\\s+([\\w.:\\/]*)"
"\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)"
@@ -1404,6 +1409,21 @@ void PaintCommands::command_drawText(QRegExp re)
m_painter->drawText(x, y, txt);
}
+void PaintCommands::command_drawStaticText(QRegExp re)
+{
+ if (!m_shouldDrawText)
+ return;
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ QString txt = caps.at(3);
+
+ if (m_verboseMode)
+ printf(" -(lance) drawStaticText(%d, %d, %s)\n", x, y, qPrintable(txt));
+
+ m_painter->drawStaticText(x, y, QStaticText(txt));
+}
+
/***************************************************************************************************/
void PaintCommands::command_noop(QRegExp)
{
diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h
index 6cc0889093..04492ea7ce 100644
--- a/tests/arthur/common/paintcommands.h
+++ b/tests/arthur/common/paintcommands.h
@@ -209,6 +209,7 @@ private:
void command_drawRoundedRect(QRegExp re);
void command_drawRoundRect(QRegExp re);
void command_drawText(QRegExp re);
+ void command_drawStaticText(QRegExp re);
void command_drawTiledPixmap(QRegExp re);
void command_path_addEllipse(QRegExp re);
void command_path_addPolygon(QRegExp re);
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index 98e15e8b0e..72c32cb858 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -78,5 +78,7 @@ contains(QT_CONFIG, private_tests) {
qpacketprotocol
}
+contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin
+
# Tests which should run in Pulse
PULSE_TESTS = $$SUBDIRS
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index 3a626bf3cb..541d9a101e 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -58,7 +58,6 @@
Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor)
Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine)
-
class tst_qdeclarativeanchors : public QObject
{
Q_OBJECT
@@ -291,7 +290,7 @@ void tst_qdeclarativeanchors::basicAnchorsRTL()
QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(view->rootObject());
foreach(QObject *child, rootItem->children()) {
- bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->property("mirrored").toBool();
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->mirrored();
QCOMPARE(mirrored, false);
}
@@ -299,7 +298,7 @@ void tst_qdeclarativeanchors::basicAnchorsRTL()
mirrorAnchors(qobject_cast<QDeclarativeItem*>(child));
foreach(QObject *child, rootItem->children()) {
- bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->property("mirrored").toBool();
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->mirrored();
QCOMPARE(mirrored, true);
}
diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro
new file mode 100644
index 0000000000..800c033f37
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+
+QT += declarative
+
+CONFIG += console
+CONFIG -= app_bundle
+
+DESTDIR = ./
+
+INSTALLS =
+
+SOURCES += main.cpp
diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp
new file mode 100644
index 0000000000..f5b830efef
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QDebug>
+#include <QDeclarativeComponent>
+#include <QDeclarativeEngine>
+#include <QStringList>
+#include <QtDeclarative/private/qdeclarativedebughelper_p.h>
+#include <QtDeclarative/private/qdeclarativedebugservice_p.h>
+
+int main(int argc, char *argv[])
+{
+ QDeclarativeDebugHelper::enableDebugging();
+
+ QApplication app(argc, argv);
+
+ const QUrl path = QUrl::fromLocalFile(app.arguments().last());
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, path);
+
+ if (!component.isReady()) {
+ qWarning() << component.errorString();
+ return -1;
+ }
+
+ QObject *obj = component.create();
+
+// printf("%u\n", QDeclarativeDebugService::idForObject(obj));
+// fflush(stdout);
+
+ return app.exec();
+}
diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js
new file mode 100644
index 0000000000..f96f8e9611
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js
@@ -0,0 +1,28 @@
+function function2InScript(a)
+{
+ logger("return function2InScript");
+ root.result = a;
+}
+
+function functionInScript(a, b)
+{
+ logger("enter functionInScript");
+ var names = ["Clark Kent", "Peter Parker", "Bruce Wayne"];
+ var aliases = ["Superman", "Spiderman", "Batman"];
+ var details = {
+ category: "Superheroes",
+ names: names,
+ aliases: aliases
+ };
+ function2InScript(a + b);
+ logger("return functionInScript");
+ return details;
+}
+
+function logger(msg)
+{
+ //console.log(msg);
+ return true;
+}
+
+//DO NOT CHANGE CODE ABOVE THIS LINE
diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml
new file mode 100644
index 0000000000..f062bb96f8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+import "backtrace1.js" as Script
+
+Item {
+ id: root
+
+ property int result:0
+
+ Component.onCompleted:
+ {
+ root.result = 10;
+ Script.functionInScript(4,5);
+ root.name = "nemo";
+ Script.logger(root.simpleBinding);
+ }
+
+ //DO NOT CHANGE CODE ABOVE
+ //ADD CODE FROM HERE
+
+ property string name
+ property int simpleBinding: result
+
+ VisualItemModel {
+ id: itemModel
+ Rectangle { height: 30; width: 80; color: "red" }
+ Rectangle { height: 30; width: 80; color: "green" }
+ Rectangle { height: 30; width: 80; color: "blue" }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: itemModel
+
+ Component.onCompleted:
+ {
+ Script.logger("List Loaded");
+ }
+ }
+
+}
+
diff --git a/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro b/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro
new file mode 100644
index 0000000000..720de192ba
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+
+SUBDIRS = tst_qdeclarativedebugjs.pro \
+ app
diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
new file mode 100644
index 0000000000..a40bcc0383
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
@@ -0,0 +1,1341 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/private/qdeclarativedebugclient_p.h>
+#include <QtDeclarative/private/qdeclarativedebugservice_p.h>
+#include <QtDeclarative/private/qdeclarativedebug_p.h>
+#include <QtDeclarative/private/qjsdebuggeragent_p.h>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtCore/QProcess>
+#include "../../../shared/util.h"
+#include "../shared/debugutil_p.h"
+
+class QJSDebugClient : public QDeclarativeDebugClient
+{
+ Q_OBJECT
+public:
+ QJSDebugClient(QDeclarativeDebugConnection *connection) : QDeclarativeDebugClient(QLatin1String("JSDebugger"), connection) {}
+
+ void ping();
+ void exec(const QByteArray &debuggerId, const QString &expr);
+ void setBreakpoints(const QSet<JSAgentBreakpointData> &breakpoints);
+ void setWatchExpressions(const QStringList &watchExpressions);
+ void stepOver();
+ void stepInto();
+ void interrupt();
+ void stepOut();
+ void continueExecution();
+ void expandObjectById(const QByteArray& objectName, quint64 objectId);
+ void setProperty(const QByteArray& id, qint64 objectId, const QString &property, const QString &value);
+ void activateFrame(int frameId);
+
+ // info from last exec
+ JSAgentWatchData exec_data;
+ QByteArray exec_iname;
+
+ QByteArray object_name;
+ QList<JSAgentWatchData> object_children;
+
+ int frame_id;
+
+ // info from last stop
+ QList<JSAgentStackData> break_stackFrames;
+ QList<JSAgentWatchData> break_watches;
+ QList<JSAgentWatchData> break_locals;
+ bool break_becauseOfException;
+ QString break_error;
+
+signals:
+ void statusHasChanged();
+
+ void pong();
+ void result();
+ void stopped();
+ void expanded();
+ void watchTriggered();
+
+protected:
+ virtual void statusChanged(Status status);
+ virtual void messageReceived(const QByteArray &data);
+
+private:
+ int m_ping;
+};
+
+class QJSDebugProcess : public QObject
+{
+ Q_OBJECT
+public:
+ QJSDebugProcess();
+ ~QJSDebugProcess();
+
+ void start(const QStringList &arguments);
+ bool waitForStarted();
+
+private slots:
+ void processAppOutput();
+
+private:
+ QProcess m_process;
+ QTimer m_timer;
+ QEventLoop m_eventLoop;
+ bool m_started;
+};
+
+class tst_QDeclarativeDebugJS : public QObject
+{
+ Q_OBJECT
+private:
+ QDeclarativeDebugConnection *m_conn;
+ QDeclarativeEngine *m_engine;
+ QJSDebugClient *m_client;
+
+private slots:
+ void pingPong();
+ void exec();
+ void setBreakpoint();
+ void stepOver();
+ void stepInto();
+ void interrupt();
+ void stepOut();
+ void continueExecution();
+ void expandObject();
+ void setProperty();
+ void setProperty2();
+ void watchExpression();
+ void activateFrame();
+ void setBreakpoint2();
+ void stepOver2();
+ void stepInto2();
+ void interrupt2();
+ void stepOut2();
+ void continueExecution2();
+ void expandObject2();
+ void setProperty3();
+ void setProperty4();
+ void activateFrame2();
+ void verifyQMLOptimizerDisabled();
+};
+
+
+void QJSDebugClient::ping()
+{
+ m_ping++;
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "PING";
+ rs << cmd;
+ rs << m_ping;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::exec(const QByteArray &debuggerId, const QString &expr)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "EXEC";
+ rs << cmd;
+ rs << debuggerId;
+ rs << expr;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::setBreakpoints(const QSet<JSAgentBreakpointData> &breakpoints)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "BREAKPOINTS";
+ rs << cmd
+ << breakpoints;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::setWatchExpressions(const QStringList &watchExpressions)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "WATCH_EXPRESSIONS";
+ rs << cmd
+ << watchExpressions;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::stepOver()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "STEPOVER";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::stepInto()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "STEPINTO";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::interrupt()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "INTERRUPT";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::stepOut()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "STEPOUT";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::continueExecution()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "CONTINUE";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::expandObjectById(const QByteArray& objectName, quint64 objectId)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "EXPAND";
+ rs << cmd
+ << objectName
+ << objectId;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::setProperty(const QByteArray& id, qint64 objectId, const QString &property, const QString &value)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "SET_PROPERTY";
+ rs << cmd
+ << id
+ << objectId
+ << property
+ << value;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::activateFrame(int frameId)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "ACTIVATE_FRAME";
+ rs << cmd
+ << frameId;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::statusChanged(Status /*status*/)
+{
+ emit statusHasChanged();
+}
+
+void QJSDebugClient::messageReceived(const QByteArray &data)
+{
+ QByteArray rwData = data;
+ QDataStream stream(&rwData, QIODevice::ReadOnly);
+
+ QByteArray command;
+ stream >> command;
+
+ if (command == "STOPPED") {
+ stream >> break_stackFrames >> break_watches >> break_locals >> break_becauseOfException >> break_error;
+ if (!break_becauseOfException) {
+ break_error.clear();
+ }
+ emit stopped();
+ } else if (command == "RESULT") {
+ stream >> exec_iname;
+ stream >> exec_data;
+ emit result();
+ } else if (command == "EXPANDED") {
+ stream >> object_name >> object_children;
+ emit expanded();
+ } else if (command == "LOCALS") {
+ stream >> frame_id >> break_locals;
+ if (!stream.atEnd()) { // compatibility with jsdebuggeragent from 2.1, 2.2
+ stream >> break_watches;
+ }
+ emit watchTriggered();
+ } else if (command == "PONG") {
+ int ping;
+ stream >> ping;
+ QCOMPARE(ping, m_ping);
+ emit pong();
+ } else {
+ QFAIL("Unknown message :" + command);
+ }
+ QVERIFY(stream.atEnd());
+}
+
+QJSDebugProcess::QJSDebugProcess()
+ : m_started(false)
+{
+ m_process.setProcessChannelMode(QProcess::MergedChannels);
+ connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processAppOutput()));
+ connect(&m_timer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit()));
+ m_timer.setSingleShot(true);
+ m_timer.setInterval(5000);
+ QStringList environment = QProcess::systemEnvironment();
+ environment.append("QML_DISABLE_OPTIMIZER=1");
+ m_process.setEnvironment(environment);
+}
+
+QJSDebugProcess::~QJSDebugProcess()
+{
+ if (m_process.state() != QProcess::NotRunning) {
+ m_process.kill();
+ m_process.waitForFinished(5000);
+ }
+}
+
+void QJSDebugProcess::start(const QStringList &arguments)
+{
+ QString currentDir = QFileInfo(__FILE__).absoluteDir().absolutePath();
+ m_process.start(currentDir + "/app/app", arguments);
+ m_timer.start();
+}
+
+bool QJSDebugProcess::waitForStarted()
+{
+ m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+
+ return m_started;
+}
+
+void QJSDebugProcess::processAppOutput()
+{
+ const QString appOutput = m_process.readAll();
+ static QRegExp newline("[\n\r]{1,2}");
+ QStringList lines = appOutput.split(newline);
+ foreach (const QString &line, lines) {
+ if (line.isEmpty())
+ continue;
+ if (line.startsWith("Qml debugging is enabled")) // ignore
+ continue;
+ if (line.startsWith("QDeclarativeDebugServer:")) {
+ if (line.contains("Waiting for connection ")) {
+ m_started = true;
+ m_eventLoop.quit();
+ continue;
+ }
+ if (line.contains("Connection established")) {
+ continue;
+ }
+ }
+ qDebug() << line;
+ }
+}
+
+inline QString TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return fileInfo.absoluteDir().filePath("data/" + filename);
+}
+
+void tst_QDeclarativeDebugJS::pingPong()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QJSDebugClient client(&connection);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ client.ping();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(pong())));
+}
+
+void tst_QDeclarativeDebugJS::exec()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QJSDebugClient client(&connection);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ // Evaluate script without context
+ client.exec("queryid", "1+1");
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(result())));
+ QCOMPARE(client.exec_iname, QByteArray("queryid"));
+ QCOMPARE(client.exec_data.exp, QByteArray("1+1"));
+ QCOMPARE(client.exec_data.name, QByteArray("1+1"));
+ QCOMPARE(client.exec_data.hasChildren, false);
+ QCOMPARE(client.exec_data.type, QByteArray("Number"));
+ QCOMPARE(client.exec_data.value, QByteArray("2"));
+
+ // TODO: Test access to context after breakpoint is hit
+}
+
+
+void tst_QDeclarativeDebugJS::setBreakpoint()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ //TEST LINE
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp1.fileUrl);
+ QCOMPARE(data.lineNumber, bp1.lineNumber);
+
+}
+
+void tst_QDeclarativeDebugJS::stepOver()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOver();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp1.fileUrl);
+ QCOMPARE(data.lineNumber, bp1.lineNumber +1);
+}
+
+void tst_QDeclarativeDebugJS::stepInto()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepInto();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("functionInScript");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::interrupt()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.interrupt();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("functionInScript");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::stepOut()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1,bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOut();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ JSAgentStackData data = client.break_stackFrames.at(0);
+
+ QCOMPARE(data.fileUrl, bp2.fileUrl);
+ QCOMPARE(data.lineNumber, bp2.lineNumber);
+
+}
+
+void tst_QDeclarativeDebugJS::continueExecution()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.continueExecution();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp2.fileUrl);
+ QCOMPARE(data.lineNumber, bp2.lineNumber);
+}
+
+void tst_QDeclarativeDebugJS::expandObject()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ //TEST LINE
+ client.expandObjectById(data.name,data.objectId);
+ }
+ }
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+
+}
+
+void tst_QDeclarativeDebugJS::setProperty()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, data.objectId, "total", "names.length");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(0).value,QByteArray("Superheroes"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(3).name,QByteArray("total"));
+ QCOMPARE(client.object_children.at(3).type,QByteArray("Number"));
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::setProperty2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, data.objectId, "category", data.name + ".category = 'comic characters'");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(0).value,QByteArray("comic characters"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::watchExpression()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ QByteArray watchExpression("root.result = 20");
+ QStringList watchList;
+ watchList.append(QString(watchExpression));
+
+ //TEST LINE
+ client.setWatchExpressions(watchList);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentWatchData data = client.break_watches.at(0);
+ QCOMPARE(data.exp, watchExpression);
+ QCOMPARE(data.value.toInt(), 20);
+ QCOMPARE(data.type, QByteArray("Number"));
+}
+
+void tst_QDeclarativeDebugJS::activateFrame()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 3;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.activateFrame(2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(watchTriggered())));
+
+ QCOMPARE(client.break_locals.at(1).name,QByteArray("names"));
+ QCOMPARE(client.break_locals.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.break_locals.at(2).name,QByteArray("a"));
+ QCOMPARE(client.break_locals.at(2).type,QByteArray("Number"));
+ QCOMPARE(client.break_locals.at(2).value,QByteArray("4"));
+ QCOMPARE(client.break_locals.at(3).name,QByteArray("b"));
+ QCOMPARE(client.break_locals.at(3).type,QByteArray("Number"));
+ QCOMPARE(client.break_locals.at(3).value,QByteArray("5"));
+
+ // foreach ( JSAgentWatchData data, client.break_locals)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+
+}
+
+void tst_QDeclarativeDebugJS::setBreakpoint2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 40;
+
+ //TEST LINE
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(!QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+}
+
+void tst_QDeclarativeDebugJS::stepOver2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOver();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepOver();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp1.fileUrl);
+ QCOMPARE(data.lineNumber, bp1.lineNumber +2);
+}
+
+void tst_QDeclarativeDebugJS::stepInto2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("logger");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::interrupt2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.interrupt();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.interrupt();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("logger");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::stepOut2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1,bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOut();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepOut();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+
+ QCOMPARE(data.fileUrl, bp2.fileUrl);
+ QCOMPARE(data.lineNumber, bp2.lineNumber);
+
+}
+
+void tst_QDeclarativeDebugJS::continueExecution2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2, bp3;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 12;
+
+ bp3.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp3.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2 << bp3);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp3.fileUrl);
+ QCOMPARE(data.lineNumber, bp3.lineNumber);
+}
+
+void tst_QDeclarativeDebugJS::expandObject2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.expandObjectById(QByteArray("details"),123);
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+ QCOMPARE(client.object_name,QByteArray("details"));
+
+ QEXPECT_FAIL("", "", Continue);
+ QCOMPARE(client.object_children.length(),0);
+
+}
+
+void tst_QDeclarativeDebugJS::setProperty3()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, 123, "total", "names.length");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.length(),3);
+
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::setProperty4()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, 123, "category", data.name + ".category = 'comic characters'");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(0).value,QByteArray("Superheroes"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::activateFrame2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 4;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.activateFrame(5);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(watchTriggered())));
+
+ QCOMPARE(client.break_locals.length(),0);
+
+ // foreach ( JSAgentWatchData data, client.break_locals)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+
+}
+
+void tst_QDeclarativeDebugJS::verifyQMLOptimizerDisabled()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 21;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+}
+QTEST_MAIN(tst_QDeclarativeDebugJS)
+
+#include "tst_qdeclarativedebugjs.moc"
diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro
new file mode 100644
index 0000000000..8aea1b5e10
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro
@@ -0,0 +1,26 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative network script
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/debugutil_p.h
+
+SOURCES += tst_qdeclarativedebugjs.cpp \
+ ../shared/debugutil.cpp
+
+INCLUDEPATH += ../shared
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+OTHER_FILES = data/backtrace1.js data/backtrace1.qml
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml
new file mode 100644
index 0000000000..785a27dd79
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Component {
+ Item {
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml
new file mode 100644
index 0000000000..361bcbcb56
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+NestedComponentRoot {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index d6e6a4a6b5..7f186b3537 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -135,6 +135,7 @@ private slots:
void reservedWords_data();
void reservedWords();
void inlineAssignmentsOverrideBindings();
+ void nestedComponentRoots();
void basicRemote_data();
void basicRemote();
@@ -1425,6 +1426,12 @@ void tst_qdeclarativelanguage::inlineAssignmentsOverrideBindings()
delete o;
}
+// QTBUG-19354
+void tst_qdeclarativelanguage::nestedComponentRoots()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nestedComponentRoots.qml"));
+}
+
// Import tests (QT-558)
void tst_qdeclarativelanguage::importsBuiltin_data()
{
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
index d75960c13a..0d581d4bdf 100644
--- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -174,7 +174,7 @@ void tst_qdeclarativeqt::rect()
QCOMPARE(qvariant_cast<QRectF>(object->property("test2")), QRectF(-10, 13, 100, 109.6));
QCOMPARE(qvariant_cast<QRectF>(object->property("test3")), QRectF());
QCOMPARE(qvariant_cast<QRectF>(object->property("test4")), QRectF());
- QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF());
+ QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF(10, 13, 100, -109));
delete object;
}
diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js b/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js
deleted file mode 100644
index 8decbf03a4..0000000000
--- a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.js
+++ /dev/null
@@ -1,11 +0,0 @@
-
-function function2InScript(a)
-{
- mainRectangle.foo = a;
-}
-
-
-function functionInScript(a , b)
-{
- function2InScript(a + b);
-}
diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml b/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml
deleted file mode 100644
index 9096c32a8e..0000000000
--- a/tests/auto/declarative/qdeclarativescriptdebugging/data/backtrace1.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 1.0
-import Qt.test 1.0
-import "backtrace1.js" as Script
-
-Rectangle {
- id: mainRectangle
-
- property string foo: "Default";
- width: 200
- height: 200
-
-
- MyTestObject {
-
- function append(a, b) {
- return a + " " + b;
- }
-
-
- id: testObject;
- someProperty: append("Hello", mainRectangle.foo)
-
- onSignaled: {
- Script.functionInScript(value , "b");
- }
- }
-}
diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro
deleted file mode 100644
index 171f308778..0000000000
--- a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative script
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_qdeclarativescriptdebugging.cpp
-INCLUDEPATH += ../shared
-
-# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
-# LIBS += -lgcov
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-
-CONFIG += parallel_test
-
diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp b/tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp
deleted file mode 100644
index 4301174184..0000000000
--- a/tests/auto/declarative/qdeclarativescriptdebugging/tst_qdeclarativescriptdebugging.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <qtest.h>
-#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeitem.h>
-#include <QtDeclarative/qdeclarativecontext.h>
-#include <QtCore/QDir>
-#include <QtScript/QScriptEngineAgent>
-#include <private/qdeclarativeengine_p.h>
-
-class MyTestObject : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString someProperty READ someProperty WRITE setSomeProperty NOTIFY somePropertyChanged)
-
-public:
- QString someProperty() { return _someProperty; }
- void setSomeProperty(const QString &p) { _someProperty = p; }
- QString _someProperty;
-
- void emitSignal(const QString &value) { emit signaled(value); }
-
-signals:
- void signaled(const QString &value);
- void somePropertyChanged();
-};
-
-
-class BtAgent : public QScriptEngineAgent {
-public:
- BtAgent(QScriptEngine *engine) : QScriptEngineAgent(engine)
- { count = 0; engine->setAgent(this); }
-
- QStringList bt;
- int count;
- int breakpoint;
- void positionChange(qint64 , int lineNumber, int )
- {
- if(lineNumber == breakpoint) {
- count++;
- bt = engine()->currentContext()->backtrace();
- }
- }
-};
-
-
-
-/*
-This test covers evaluation of ECMAScript expressions and bindings from within
-QML. This does not include static QML language issues.
-
-Static QML language issues are covered in qmllanguage
-*/
-inline QUrl TEST_FILE(const QString &filename)
-{
- QFileInfo fileInfo(__FILE__);
- return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename));
-}
-
-inline QUrl TEST_FILE(const char *filename)
-{
- return TEST_FILE(QLatin1String(filename));
-}
-
-class tst_qdeclarativescriptdebugging : public QObject
-{
- Q_OBJECT
-public:
- tst_qdeclarativescriptdebugging() {}
-
-private slots:
- void initTestCase();
- void backtrace1();
-};
-
-void tst_qdeclarativescriptdebugging::initTestCase()
-{
- qmlRegisterType<MyTestObject>("Qt.test", 1,0, "MyTestObject");
-}
-
-void tst_qdeclarativescriptdebugging::backtrace1()
-{
- {
- QDeclarativeEngine engine;
- QUrl file = TEST_FILE("backtrace1.qml");
- QDeclarativeComponent component(&engine, file);
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
- QVERIFY(item);
- MyTestObject *obj = item->findChild<MyTestObject *>();
- QVERIFY(obj);
- QCOMPARE(obj->someProperty(), QString("Hello Default"));
-
- QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(&engine);
- BtAgent agent(&ep->scriptEngine);
- agent.breakpoint = 16;
-
- obj->emitSignal("blah");
- QCOMPARE(obj->someProperty(), QString("Hello blahb"));
- QCOMPARE(agent.count, 1);
-
- QStringList expected;
- expected << "append(a = 'Hello', b = 'blahb') at @PREFIX@/backtrace1.qml:16"
- << "$someProperty() at @PREFIX@/backtrace1.qml:21"
- << "function2InScript(a = 'blahb') at @PREFIX@/backtrace1.js:4"
- << "functionInScript(a = 'blah', b = 'b') at @PREFIX@/backtrace1.js:10"
- << "onSignaled() at @PREFIX@/backtrace1.qml:24"
- << "<global>() at -1";
- expected.replaceInStrings("@PREFIX@", file.toString().section('/', 0, -2));
- QCOMPARE(agent.bt, expected);
- }
-}
-
-
-QTEST_MAIN(tst_qdeclarativescriptdebugging)
-
-#include "tst_qdeclarativescriptdebugging.moc"
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 1720c330b3..19b7a76c1c 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -2431,15 +2431,20 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QSignalSpy cursorRectangleSpy(&input, SIGNAL(cursorRectangleChanged()));
+ int cursorRectangleChanges = 0;
+
// test the text is scrolled so the preedit is visible.
ic.sendPreeditText(preeditText.mid(0, 3), 1);
QVERIFY(input.positionAt(0) != 0);
QVERIFY(input.cursorRectangle().left() < input.boundingRect().width());
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
// test the text is scrolled back when the preedit is removed.
ic.sendEvent(QInputMethodEvent());
QCOMPARE(input.positionAt(0), 0);
QCOMPARE(input.positionAt(input.width()), 5);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
// some tolerance for different fonts.
#ifdef Q_OS_LINUX
@@ -2455,26 +2460,31 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
ic.sendPreeditText(preeditText, i + 1);
QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error);
QVERIFY(input.positionToRectangle(0).x() < x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
x = input.positionToRectangle(0).x();
}
for (int i = 1; i >= 0; --i) {
ic.sendPreeditText(preeditText, i + 1);
QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error);
QVERIFY(input.positionToRectangle(0).x() > x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
x = input.positionToRectangle(0).x();
}
// Test incrementing the preedit cursor doesn't cause further
// scrolling when right most text is visible.
ic.sendPreeditText(preeditText, preeditText.length() - 3);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
x = input.positionToRectangle(0).x();
for (int i = 2; i >= 0; --i) {
ic.sendPreeditText(preeditText, preeditText.length() - i);
QCOMPARE(input.positionToRectangle(0).x(), x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
}
for (int i = 1; i < 3; ++i) {
ic.sendPreeditText(preeditText, preeditText.length() - i);
QCOMPARE(input.positionToRectangle(0).x(), x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
}
// Test disabling auto scroll.
diff --git a/tests/auto/declarative/qmlshadersplugin/main.qml b/tests/auto/declarative/qmlshadersplugin/main.qml
new file mode 100644
index 0000000000..fc80b39803
--- /dev/null
+++ b/tests/auto/declarative/qmlshadersplugin/main.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ Rectangle {
+ width: 300
+ height: 300
+
+ Text {
+ id: textLabel
+ text: "Hello World"
+ anchors.centerIn: parent
+ font.pixelSize: 48
+ }
+
+ ShaderEffectItem {
+ objectName: "effectItem"
+ property variant source: ShaderEffectSource { objectName: "effectSource"; sourceItem: textLabel; hideSource: true }
+ property real wiggleAmount: 0.01
+ anchors.fill: textLabel
+
+ SequentialAnimation on wiggleAmount {
+ loops: Animation.Infinite
+ NumberAnimation { to: -0.01; duration: 500 }
+ NumberAnimation { to: 0.01; duration: 500 }
+ }
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wiggleAmount;
+ void main(void)
+ {
+ highp vec2 wiggledTexCoord = qt_TexCoord0;
+ wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount;
+ gl_FragColor = texture2D(source, wiggledTexCoord.st);
+ }
+ "
+ }
+ }
diff --git a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro
new file mode 100644
index 0000000000..aa0e07a048
--- /dev/null
+++ b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+
+QT += opengl declarative
+SOURCES += tst_qmlshadersplugin.cpp
+
+SOURCES += \
+ ../../../../src/imports/shaders/shadereffectitem.cpp \
+ ../../../../src/imports/shaders/shadereffectsource.cpp \
+ ../../../../src/imports/shaders/shadereffect.cpp \
+ ../../../../src/imports/shaders/shadereffectbuffer.cpp \
+ ../../../../src/imports/shaders/scenegraph/qsggeometry.cpp
+
+HEADERS += \
+ ../../../../src/imports/shaders/shadereffectitem.h \
+ ../../../../src/imports/shaders/shadereffectsource.h \
+ ../../../../src/imports/shaders/shadereffect.h \
+ ../../../../src/imports/shaders/shadereffectbuffer.h \
+ ../../../../src/imports/shaders/scenegraph/qsggeometry.h
diff --git a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp
new file mode 100644
index 0000000000..a904a88946
--- /dev/null
+++ b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp
@@ -0,0 +1,205 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 <qtest.h>
+#include <QtDeclarative>
+#include "../../../../src/imports/shaders/shadereffectitem.h"
+#include "../../../../src/imports/shaders/shadereffectsource.h"
+#include "../../../../src/imports/shaders/shadereffect.h"
+
+static const char qt_default_vertex_code[] =
+ "uniform highp mat4 qt_ModelViewProjectionMatrix;\n"
+ "attribute highp vec4 qt_Vertex;\n"
+ "attribute highp vec2 qt_MultiTexCoord0;\n"
+ "varying highp vec2 qt_TexCoord0;\n"
+ "void main(void)\n"
+ "{\n"
+ "qt_TexCoord0 = qt_MultiTexCoord0;\n"
+ "gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n"
+ "}\n";
+
+static const char qt_default_fragment_code[] =
+ "varying highp vec2 qt_TexCoord0;\n"
+ "uniform lowp sampler2D source;\n"
+ "void main(void)\n"
+ "{\n"
+ "gl_FragColor = texture2D(source, qt_TexCoord0.st);\n"
+ "}\n";
+
+class tst_qmlshadersplugin : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void shaderEffectItemAPI();
+ void shaderEffectSourceAPI();
+ void combined();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qmlshadersplugin::initTestCase()
+{
+ const char *uri ="Qt.labs.shaders";
+ qmlRegisterType<ShaderEffectItem>(uri, 1, 0, "ShaderEffectItem");
+ qmlRegisterType<ShaderEffectSource>(uri, 1, 0, "ShaderEffectSource");
+}
+
+
+void tst_qmlshadersplugin::shaderEffectItemAPI()
+{
+ // Creation
+ QString componentStr = "import QtQuick 1.0\n"
+ "import Qt.labs.shaders 1.0\n"
+ "ShaderEffectItem {\n"
+ "property variant source\n"
+ "width: 200; height: 300\n"
+ "}";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+
+ QObject *obj = component.create();
+ QTest::qWait(100);
+ QVERIFY(obj != 0);
+
+ // Default values
+ QCOMPARE(obj->property("width").toDouble(), 200.);
+ QCOMPARE(obj->property("height").toDouble(), 300.);
+ QCOMPARE(obj->property("fragmentShader").toString(), QString(""));
+ QCOMPARE(obj->property("vertexShader").toString(), QString(""));
+ QCOMPARE(obj->property("blending").toBool(), true);
+ QCOMPARE(obj->property("meshResolution").toSize(), QSize(1, 1));
+ QCOMPARE(obj->property("visible").toBool(), true);
+
+ // Seting the values
+ QVERIFY(obj->setProperty("fragmentShader", QString(qt_default_fragment_code)));
+ QVERIFY(obj->setProperty("vertexShader", QString(qt_default_vertex_code)));
+ QVERIFY(obj->setProperty("blending", false));
+ QVERIFY(obj->setProperty("meshResolution", QSize(20, 10)));
+ QVERIFY(obj->setProperty("visible", false));
+
+ QCOMPARE(obj->property("fragmentShader").toString(), QString(qt_default_fragment_code));
+ QCOMPARE(obj->property("vertexShader").toString(), QString(qt_default_vertex_code));
+ QCOMPARE(obj->property("blending").toBool(), false);
+ QCOMPARE(obj->property("meshResolution").toSize(), QSize(20, 10));
+ QCOMPARE(obj->property("visible").toBool(), false);
+
+ delete obj;
+}
+
+void tst_qmlshadersplugin::shaderEffectSourceAPI()
+{
+ // Creation
+ QString componentStr = "import QtQuick 1.0\n"
+ "import Qt.labs.shaders 1.0\n"
+ "ShaderEffectSource {}";
+ QDeclarativeComponent shaderEffectSourceComponent(&engine);
+ shaderEffectSourceComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+
+ QObject *obj = shaderEffectSourceComponent.create();
+ QTest::qWait(100);
+ QVERIFY(obj != 0);
+
+ // Default values
+ QCOMPARE(obj->property("sourceRect").toRect(), QRect(0, 0, 0, 0));
+ QCOMPARE(obj->property("textureSize").toSize(), QSize(0, 0));
+ QCOMPARE(obj->property("live").toBool(), true);
+ QCOMPARE(obj->property("hideSource").toBool(), false);
+ QCOMPARE(obj->property("wrapMode").toUInt(), static_cast<unsigned int>(ShaderEffectSource::ClampToEdge));
+
+ // Seting the values
+ componentStr = "import QtQuick 1.0\n"
+ "Item {}";
+ QDeclarativeComponent itemComponent(&engine);
+ itemComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *> (itemComponent.create());
+ QVERIFY(item != 0);
+
+ QVERIFY(obj->setProperty("sourceItem", QVariant::fromValue(item)));
+ QVERIFY(obj->setProperty("sourceRect", QRect(10, 20, 30, 40)));
+ QVERIFY(obj->setProperty("textureSize", QSize(50, 100)));
+ QVERIFY(obj->setProperty("live", false));
+ QVERIFY(obj->setProperty("hideSource", true));
+ QVERIFY(obj->setProperty("wrapMode", static_cast<unsigned int>(ShaderEffectSource::Repeat)));
+
+ QCOMPARE(obj->property("sourceItem"), QVariant::fromValue(item));
+ QCOMPARE(obj->property("sourceRect").toRect(), QRect(10, 20, 30, 40));
+ QCOMPARE(obj->property("textureSize").toSize(), QSize(50, 100));
+ QCOMPARE(obj->property("live").toBool(), false);
+ QCOMPARE(obj->property("hideSource").toBool(), true);
+ QCOMPARE(obj->property("wrapMode").toUInt(), static_cast<unsigned int>(ShaderEffectSource::Repeat));
+
+ delete item;
+ delete obj;
+}
+
+void tst_qmlshadersplugin::combined()
+{
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+
+ QDeclarativeView view;
+ view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ view.setAttribute(Qt::WA_OpaquePaintEvent);
+ view.setAttribute(Qt::WA_NoSystemBackground);
+ view.setViewport(glWidget);
+ view.setSource(QUrl::fromLocalFile("main.qml"));
+ view.show();
+ QTest::qWait(1000);
+
+ QObject *item = view.rootObject()->findChild<QDeclarativeItem*>("effectItem");
+ QVERIFY(item != 0);
+
+ QObject *src = view.rootObject()->findChild<QDeclarativeItem*>("effectSource");
+ QVERIFY(src != 0);
+
+ QCOMPARE(item->property("source"), QVariant::fromValue(src));
+}
+
+QTEST_MAIN(tst_qmlshadersplugin)
+
+#include "tst_qmlshadersplugin.moc"
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png
index bc65634324..4c4d17c9e3 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png
index be041d8219..d7b5943f34 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png
index 0efb20af0e..75a6c49b35 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png
index 6525dbb867..ae89849bf3 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png
index 5b8d209f8e..7b7db05640 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png
index cf012baff4..7c1442f40e 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png
index 57e77a41ea..c01c980450 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png
index 24d26bdeff..8806e4c749 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png
index a540734804..b331119bd8 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png
index 17da64369c..76e3c6f4d8 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png
index e03cfe4be9..141753cd91 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png
index 1b808efd3e..8b6329d95f 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
index 666d27230f..38f205133e 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png
index 823199c7ae..d85498b455 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png
index 7e841649a8..75478566ad 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png
index 7e841649a8..84430bb7ac 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png
index 6119f92d7c..026d06c34a 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png
index 6119f92d7c..026d06c34a 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png
index f2e61178f5..16202c49a7 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png
index 2f4c84af35..38b9668a37 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png
index ae786a24d8..801ec2be37 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png
index 93c16dc925..ddd6cc5803 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png
index acec1ee522..4679774be1 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png
index f380c08651..51018b4336 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png
index 18142dd247..f5ed905f9e 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png
index c7f59b8470..500572457b 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png
index be676c0fc7..e47b47954a 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png
index df2fe2feeb..0d3c672804 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png
index b4e1d3a153..56d98ff0a5 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png
index 4177b9eb08..1ab1eb5bb0 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png
index 36e5d35858..68921f6588 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png
index 34f8e387b9..c9450c7c80 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png
index 0b4ca4ef01..5049c3f81e 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png
index 251beb672e..ee6e16a3e1 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png
index 5cd2d7d469..d9d22520a4 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png
index 5cd2d7d469..d9d22520a4 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png
index bf6a44e7f2..cf99d98c15 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png
index 1089578575..e3937f03db 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png
index c9113def81..2fe33379c2 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png
index 47b47443ff..97b99134d5 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png
index c518204a6e..08e059f865 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png
index 9f1c26a15a..bbc5ba24df 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png
index cd8d0a51e9..465b64e8ed 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png
index 8f5f872b22..d9d22520a4 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png
index a61ba5a3fe..61606b2bd0 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png
index 2a28c968aa..a4b28fcd32 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png
index d1ddaa6f89..5be6bbb867 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png
index 493c5cde57..a220f6545c 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png
index 2b2ce59597..6946707f64 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png
index 044eea485f..4eeb8ec79f 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png
index f0748b2138..4eeb8ec79f 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png
index 8d74b8deeb..59fc0fc492 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png
index 8a642d275e..2747b50831 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png
index 5698741e39..74efe73bb1 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png
index 7f56f34fbf..02f6e17b09 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png
index 8d74b8deeb..59fc0fc492 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png
index 8effaefd8e..56f6ecea8b 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png
index 8effaefd8e..56f6ecea8b 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png
index 8effaefd8e..56f6ecea8b 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png
index b79af19f96..f8bc3b4602 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png
index ef15fdfe6c..e156cd5eab 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png
index 99d451c486..d624a719d1 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png
index 5f632d0d18..57a1599c59 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png
index 060be223b0..d327d5b74b 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png
index d373aef317..c1e3dce7ef 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png
index 0ea21f3b9b..7829e03b43 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png
Binary files differ
diff --git a/tests/auto/lancelot/scripts/statictext.qps b/tests/auto/lancelot/scripts/statictext.qps
new file mode 100644
index 0000000000..b62b623462
--- /dev/null
+++ b/tests/auto/lancelot/scripts/statictext.qps
@@ -0,0 +1,122 @@
+drawStaticText -5 5 "Text that is drawn outside the bounds..."
+
+translate 20 20
+begin_block text_drawing
+save
+ setFont "sansserif" 10 normal
+ drawStaticText 0 20 "sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawStaticText 0 40 "sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawStaticText 0 60 "sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawStaticText 0 80 "sansserif 10pt, bold italic"
+
+
+ translate 0 100
+ setPen #7fff0000
+
+ setFont "sansserif" 10 normal
+ drawStaticText 0 20 "alpha sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawStaticText 0 40 "alpha sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawStaticText 0 60 "alpha sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawStaticText 0 80 "alpha sansserif 10pt, bold italic"
+
+
+ translate 0 100
+ setPen black
+ save
+ scale 0.9 0.9
+
+ setFont "sansserif" 10 normal
+ drawStaticText 0 20 "scaled sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawStaticText 0 40 "scaled sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawStaticText 0 60 "scaled sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawStaticText 0 80 "scaled sansserif 10pt, bold italic"
+ restore
+
+ translate 0 100
+ setPen black
+ save
+ translate 200 90
+ rotate 185
+
+ setFont "sansserif" 10 normal
+ drawStaticText 0 20 "scaled sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawStaticText 0 40 "scaled sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawStaticText 0 60 "scaled sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawStaticText 0 80 "scaled sansserif 10pt, bold italic"
+ restore
+
+ translate 0 100
+ gradient_appendStop 0 red
+ gradient_appendStop 0.5 #00ff00
+ gradient_appendStop 1 blue
+ gradient_setLinear 0 0 200 0
+ setPen brush
+
+ setFont "sansserif" 10 normal
+ drawStaticText 0 0 "gradient sansserif 10pt, normal"
+
+ setFont "sansserif" 12 normal
+ drawStaticText 0 20 "gradient sansserif 12pt, normal"
+
+ setFont "sansserif" 10 bold
+ drawStaticText 0 40 "gradient sansserif 12pt, bold"
+
+ setFont "sansserif" 10 bold italic
+ drawStaticText 0 60 "gradient sansserif 10pt, bold italic"
+restore
+end_block
+
+translate 250 0
+drawStaticText 25 520 "clipped to rectangle"
+save
+ setPen #3f000000
+ setBrush nobrush
+ drawRect 20 0 100 500
+ setClipRect 20 0 100 500
+ setPen black
+ repeat_block text_drawing
+restore
+
+translate 150 0
+drawStaticText 25 520 "clipped to path"
+save
+ path_moveTo clip 20 0
+ path_cubicTo clip 0 200 40 400 20 400
+ path_lineTo clip 30 500
+ path_lineTo clip 30 0
+ path_lineTo clip 40 0
+ path_lineTo clip 40 500
+ path_lineTo clip 120 500
+ path_lineTo clip 120 0
+ path_lineTo clip 20 0
+ setPen #3f000000
+ setBrush nobrush
+ drawPath clip
+ setClipPath clip
+ setPen black
+ repeat_block text_drawing
+restore
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index 92e3a8beea..109afbce64 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -238,6 +238,7 @@ private slots:
void navigateControllers();
void navigateLabels();
void text();
+ void textAttributes();
void setText();
void hideShowTest();
@@ -1563,6 +1564,60 @@ void tst_QAccessibility::text()
#endif // !QT3_SUPPORT
}
+void tst_QAccessibility::textAttributes()
+{
+ QTextEdit textEdit;
+ int startOffset;
+ int endOffset;
+ QString attributes;
+ QString text("<html><head></head><body>"
+ "Hello, <b>this</b> is an <i><b>example</b> text</i>."
+ "<span style=\"font-family: monospace\">Multiple fonts are used.</span>"
+ "Multiple <span style=\"font-size: 8pt\">text sizes</span> are used."
+ "Let's give some color to <span style=\"color:#f0f1f2; background-color:#14f01e\">Qt</span>."
+ "</body></html>");
+
+ textEdit.setText(text);
+ QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&textEdit);
+
+ QAccessibleTextInterface *textInterface=interface->textInterface();
+
+ QVERIFY(textInterface);
+ QCOMPARE(textInterface->characterCount(), 112);
+
+ attributes = textInterface->attributes(10, &startOffset, &endOffset);
+ QCOMPARE(startOffset, 7);
+ QCOMPARE(endOffset, 11);
+ attributes.prepend(';');
+ QVERIFY(attributes.contains(QLatin1String(";font-weight:bold;")));
+
+ attributes = textInterface->attributes(18, &startOffset, &endOffset);
+ QCOMPARE(startOffset, 18);
+ QCOMPARE(endOffset, 25);
+ attributes.prepend(';');
+ QVERIFY(attributes.contains(QLatin1String(";font-weight:bold;")));
+ QVERIFY(attributes.contains(QLatin1String(";font-style:italic;")));
+
+ attributes = textInterface->attributes(34, &startOffset, &endOffset);
+ QCOMPARE(startOffset, 31);
+ QCOMPARE(endOffset, 55);
+ attributes.prepend(';');
+ QVERIFY(attributes.contains(QLatin1String(";font-family:\"monospace\";")));
+
+ attributes = textInterface->attributes(65, &startOffset, &endOffset);
+ QCOMPARE(startOffset, 64);
+ QCOMPARE(endOffset, 74);
+ attributes.prepend(';');
+ QVERIFY(attributes.contains(QLatin1String(";font-size:8pt;")));
+
+ attributes = textInterface->attributes(110, &startOffset, &endOffset);
+ QCOMPARE(startOffset, 109);
+ QCOMPARE(endOffset, 111);
+ attributes.prepend(';');
+ QVERIFY(attributes.contains(QLatin1String(";background-color:rgb(20,240,30);")));
+ QVERIFY(attributes.contains(QLatin1String(";color:rgb(240,241,242);")));
+}
+
void tst_QAccessibility::setText()
{
#if !defined(QT3_SUPPORT)
@@ -2645,6 +2700,8 @@ void tst_QAccessibility::textEditTest()
{
{
QTextEdit edit;
+ int startOffset;
+ int endOffset;
QString text = "hello world\nhow are you today?\n";
edit.setText(text);
edit.show();
@@ -2654,6 +2711,12 @@ void tst_QAccessibility::textEditTest()
QCOMPARE(iface->childCount(), 6);
QCOMPARE(iface->text(QAccessible::Value, 4), QString("hello world"));
QCOMPARE(iface->text(QAccessible::Value, 5), QString("how are you today?"));
+ QCOMPARE(iface->textInterface()->textAtOffset(8, QAccessible2::WordBoundary, &startOffset, &endOffset), QString("world"));
+ QCOMPARE(startOffset, 6);
+ QCOMPARE(endOffset, 11);
+ QCOMPARE(iface->textInterface()->textAtOffset(14, QAccessible2::LineBoundary, &startOffset, &endOffset), QString("how are you today?"));
+ QCOMPARE(startOffset, 12);
+ QCOMPARE(endOffset, 30);
QCOMPARE(iface->text(QAccessible::Value, 6), QString());
QCOMPARE(iface->textInterface()->characterCount(), 31);
QFontMetrics fm(edit.font());
diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro
index f696f195de..fc3daa3af6 100644
--- a/tests/auto/qcssparser/qcssparser.pro
+++ b/tests/auto/qcssparser/qcssparser.pro
@@ -10,7 +10,7 @@ requires(contains(QT_CONFIG,private_tests))
wince*|symbian: {
addFiles.files = testdata
addFiles.path = .
- timesFont.files = C:/Windows/Fonts/times.ttf
+ timesFont.files = c:/windows/fonts/times.ttf
timesFont.path = .
DEPLOYMENT += addFiles timesFont
}
diff --git a/tests/auto/qdatetime/qdatetime.pro b/tests/auto/qdatetime/qdatetime.pro
index 08a321ef75..a3f309179e 100644
--- a/tests/auto/qdatetime/qdatetime.pro
+++ b/tests/auto/qdatetime/qdatetime.pro
@@ -1,5 +1,4 @@
load(qttest_p4)
-
SOURCES += tst_qdatetime.cpp
QT = core
@@ -10,6 +9,5 @@ win32-msvc|win32-msvc9x {
QMAKE_CFLAGS_RELEASE -= -O1
QMAKE_CXXFLAGS_RELEASE -= -O1
}
-
-
CONFIG += parallel_test
+HEADERS = tst_qdatetime.loc
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 95995e857b..5462250588 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -155,9 +155,16 @@ Q_DECLARE_METATYPE(QTime)
tst_QDateTime::tst_QDateTime()
{
+#ifdef Q_OS_SYMBIAN
+ // Symbian's timezone server cannot handle DST correctly for dates before year 1997
+ uint x1 = QDateTime(QDate(2000, 1, 1), QTime()).toTime_t();
+ uint x2 = QDateTime(QDate(2000, 6, 1), QTime()).toTime_t();
+ europeanTimeZone = (x1 == 946681200 && x2 == 959810400);
+#else
uint x1 = QDateTime(QDate(1990, 1, 1), QTime()).toTime_t();
uint x2 = QDateTime(QDate(1990, 6, 1), QTime()).toTime_t();
europeanTimeZone = (x1 == 631148400 && x2 == 644191200);
+#endif
}
tst_QDateTime::~tst_QDateTime()
diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp
index b31f8cd76c..7a8c441914 100644
--- a/tests/auto/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/qeventloop/tst_qeventloop.cpp
@@ -602,10 +602,12 @@ public slots:
QTcpSocket *serverSocket = server->nextPendingConnection();
serverSocket->write(data, size);
serverSocket->flush();
- QTest::qSleep(200); //allow the TCP/IP stack time to loopback the data, so our socket is ready to read
- QCoreApplication::processEvents(QEventLoop::ExcludeSocketNotifiers);
+ QEventLoop loop;
+ QTimer::singleShot(200, &loop, SLOT(quit())); //allow the TCP/IP stack time to loopback the data, so our socket is ready to read
+ loop.exec(QEventLoop::ExcludeSocketNotifiers);
testResult = dataArrived;
- QCoreApplication::processEvents(); //check the deferred event is processed
+ QTimer::singleShot(200, &loop, SLOT(quit()));
+ loop.exec(); //check the deferred event is processed
serverSocket->close();
QThread::currentThread()->exit(0);
}
@@ -631,6 +633,9 @@ public:
void tst_QEventLoop::processEventsExcludeSocket()
{
+#if defined(Q_WS_QWS)
+ QSKIP("Socket message seems to be leaking through QEventLoop::exec(ExcludeSocketNotifiers) on qws (QTBUG-19699)", SkipAll);
+#endif
SocketTestThread thread;
thread.start();
QVERIFY(thread.wait());
diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp
index cfafa78684..711ffc0b53 100644
--- a/tests/auto/qfont/tst_qfont.cpp
+++ b/tests/auto/qfont/tst_qfont.cpp
@@ -77,6 +77,7 @@ private slots:
void insertAndRemoveSubstitutions();
void serializeSpacing();
void lastResortFont();
+ void styleName();
};
// Testing get/set functions
@@ -612,5 +613,17 @@ void tst_QFont::lastResortFont()
QVERIFY(!font.lastResortFont().isEmpty());
}
+void tst_QFont::styleName()
+{
+#if !defined(Q_WS_MAC)
+ QSKIP("Only tested on Mac", SkipAll);
+#else
+ QFont font("Helvetica Neue");
+ font.setStyleName("UltraLight");
+
+ QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight"));
+#endif
+}
+
QTEST_MAIN(tst_QFont)
#include "tst_qfont.moc"
diff --git a/tests/auto/qglyphrun/tst_qglyphrun.cpp b/tests/auto/qglyphrun/tst_qglyphrun.cpp
index 3ea84e3a4d..a18a2ac8dd 100644
--- a/tests/auto/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/qglyphrun/tst_qglyphrun.cpp
@@ -72,6 +72,8 @@ private slots:
void drawUnderlinedText();
void drawRightToLeft();
void detach();
+ void setRawData();
+ void setRawDataAndGetAsVector();
private:
int m_testFontId;
@@ -284,6 +286,83 @@ void tst_QGlyphRun::drawExistingGlyphs()
QCOMPARE(textLayoutDraw, drawGlyphs);
}
+void tst_QGlyphRun::setRawData()
+{
+ QGlyphRun glyphRun;
+ glyphRun.setRawFont(QRawFont::fromFont(m_testFont));
+ glyphRun.setGlyphIndexes(QVector<quint32>() << 2 << 2 << 2);
+ glyphRun.setPositions(QVector<QPointF>() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20));
+
+ QPixmap baseline(100, 50);
+ baseline.fill(Qt::white);
+ {
+ QPainter p(&baseline);
+ p.drawGlyphRun(QPointF(3, 2), glyphRun);
+ }
+
+ QGlyphRun baselineCopied = glyphRun;
+
+ quint32 glyphIndexArray[3] = { 2, 2, 2 };
+ QPointF glyphPositionArray[3] = { QPointF(2, 3), QPointF(20, 3), QPointF(10, 20) };
+
+ glyphRun.setRawData(glyphIndexArray, glyphPositionArray, 3);
+
+ QPixmap rawDataGlyphs(100, 50);
+ rawDataGlyphs.fill(Qt::white);
+ {
+ QPainter p(&rawDataGlyphs);
+ p.drawGlyphRun(QPointF(3, 2), glyphRun);
+ }
+
+ quint32 otherGlyphIndexArray[1] = { 2 };
+ QPointF otherGlyphPositionArray[1] = { QPointF(2, 3) };
+
+ glyphRun.setRawData(otherGlyphIndexArray, otherGlyphPositionArray, 1);
+
+ QPixmap baselineCopiedPixmap(100, 50);
+ baselineCopiedPixmap.fill(Qt::white);
+ {
+ QPainter p(&baselineCopiedPixmap);
+ p.drawGlyphRun(QPointF(3, 2), baselineCopied);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ baseline.save("setRawData_baseline.png");
+ rawDataGlyphs.save("setRawData_rawDataGlyphs.png");
+ baselineCopiedPixmap.save("setRawData_baselineCopiedPixmap.png");
+#endif
+
+ QCOMPARE(rawDataGlyphs, baseline);
+ QCOMPARE(baselineCopiedPixmap, baseline);
+}
+
+void tst_QGlyphRun::setRawDataAndGetAsVector()
+{
+ QVector<quint32> glyphIndexArray;
+ glyphIndexArray << 3 << 2 << 1 << 4;
+
+ QVector<QPointF> glyphPositionArray;
+ glyphPositionArray << QPointF(1, 2) << QPointF(3, 4) << QPointF(5, 6) << QPointF(7, 8);
+
+ QGlyphRun glyphRun;
+ glyphRun.setRawData(glyphIndexArray.constData(), glyphPositionArray.constData(), 4);
+
+ QVector<quint32> glyphIndexes = glyphRun.glyphIndexes();
+ QVector<QPointF> glyphPositions = glyphRun.positions();
+
+ QCOMPARE(glyphIndexes.size(), 4);
+ QCOMPARE(glyphPositions.size(), 4);
+
+ QCOMPARE(glyphIndexes, glyphIndexArray);
+ QCOMPARE(glyphPositions, glyphPositionArray);
+
+ QGlyphRun otherGlyphRun;
+ otherGlyphRun.setGlyphIndexes(glyphIndexArray);
+ otherGlyphRun.setPositions(glyphPositionArray);
+
+ QCOMPARE(glyphRun, otherGlyphRun);
+}
+
void tst_QGlyphRun::drawNonExistentGlyphs()
{
QVector<quint32> glyphIndexes;
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 9b7b228764..3665b1095e 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -6413,6 +6413,7 @@ void tst_QGraphicsItem::boundingRegion_data()
QTest::newRow("(0, 0, 10, 10) | 0.0 | identity | {(0, 0, 10, 10)}") << QLineF(0, 0, 10, 10) << qreal(0.0) << QTransform()
<< QRegion(QRect(0, 0, 10, 10));
+#if 0
{
QRegion r;
r += QRect(0, 0, 6, 2);
@@ -6430,6 +6431,7 @@ void tst_QGraphicsItem::boundingRegion_data()
r += QRect(6, 9, 4, 1);
QTest::newRow("(0, 0, 10, 10) | 1.0 | identity | {(0, 0, 10, 10)}") << QLineF(0, 0, 10, 10) << qreal(1.0) << QTransform() << r;
}
+#endif
QTest::newRow("(0, 0, 10, 0) | 0.0 | identity | {(0, 0, 10, 10)}") << QLineF(0, 0, 10, 0) << qreal(0.0) << QTransform()
<< QRegion(QRect(0, 0, 10, 1));
QTest::newRow("(0, 0, 10, 0) | 0.5 | identity | {(0, 0, 10, 1)}") << QLineF(0, 0, 10, 0) << qreal(0.5) << QTransform()
@@ -8029,7 +8031,16 @@ void tst_QGraphicsItem::sorting()
QGraphicsView view(&scene);
view.setResizeAnchor(QGraphicsView::NoAnchor);
view.setTransformationAnchor(QGraphicsView::NoAnchor);
+#ifdef Q_OS_SYMBIAN
+ // Adjust area in devices where scrollbars are thicker than 25 pixels as they will
+ // obstruct painting otherwise.
+ int scrollWidth = qMax(25, view.verticalScrollBar()->width());
+ int scrollHeight = qMax(25, view.horizontalScrollBar()->height());
+
+ view.resize(95 + scrollWidth, 75 + scrollHeight);
+#else
view.resize(120, 100);
+#endif
view.setFrameStyle(0);
view.show();
#ifdef Q_WS_X11
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index c4d5272688..a6ffea3c8e 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -565,7 +565,7 @@ void tst_QHeaderView::sectionSize()
QFETCH(int, lastVisibleSectionSize);
QFETCH(int, persistentSectionSize);
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
// We test on a device with doubled pixels. Therefore we need to specify
// different boundaries.
initialDefaultSize = qMax(view->minimumSectionSize(), 30);
@@ -678,6 +678,16 @@ void tst_QHeaderView::visualIndexAt()
QFETCH(QList<int>, coordinate);
QFETCH(QList<int>, visual);
+#ifdef Q_OS_SYMBIAN
+ // Some Symbian devices have larger minimum section size than what is expected.
+ // Need to do this here instead of visualIndexAt_data() as view pointer doesn't
+ // seem to be valid there.
+ int minSize = view->minimumSectionSize();
+ if (minSize > 30) {
+ coordinate.clear();
+ coordinate << -1 << 0 << minSize + 1 << (minSize * 3) + 1 << 99999;
+ }
+#endif
view->setStretchLastSection(true);
topLevel->show();
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 72048d9a00..d548a51a33 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -515,6 +515,10 @@ void tst_QMenuBar::activatedCount_noQt3()
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
#endif
+#ifdef Q_OS_SYMBIAN
+ QSKIP("On Symbian OS, native key events are needed to test menu action activation", SkipAll);
+#endif
+
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar_noQt3();
@@ -1573,6 +1577,12 @@ void tst_QMenuBar::task256322_highlight()
file2->setText("file2");
QAction *nothing = win.menuBar()->addAction("nothing");
+#ifdef Q_WS_S60
+ // Set minimum width to ensure that menu items are not added to the menu extension.
+ // Minimum width 360 is the minimal screen width in any supported Symbian device.
+ win.menuBar()->setMinimumWidth(360);
+#endif
+
win.show();
QTest::qWait(200);
diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index d29ef77347..57bf5836a7 100644
--- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -62,7 +62,6 @@ public slots:
void cleanup();
private slots:
- void usedInThread(); // this test must be first, or it will falsely pass
void allConfigurations();
void defaultConfiguration();
void configurationFromIdentifier();
@@ -330,49 +329,6 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier()
QVERIFY(!invalid.isValid());
}
-class QNCMTestThread : public QThread
-{
-protected:
- virtual void run()
- {
- QNetworkConfigurationManager manager;
- preScanConfigs = manager.allConfigurations();
- QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
- manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
- configs = manager.allConfigurations();
- }
-public:
- QList<QNetworkConfiguration> configs;
- QList<QNetworkConfiguration> preScanConfigs;
-};
-
-// regression test for QTBUG-18795
-void tst_QNetworkConfigurationManager::usedInThread()
-{
-#if defined Q_OS_MAC && !defined (QT_NO_COREWLAN)
- QSKIP("QTBUG-19070 Mac CoreWlan plugin is broken", SkipAll);
-#else
- QNCMTestThread thread;
- connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- thread.start();
- QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread
- QVERIFY(!QTestEventLoop::instance().timeout());
- qDebug() << "prescan:" << thread.preScanConfigs.count();
- qDebug() << "postscan:" << thread.configs.count();
-
- QNetworkConfigurationManager manager;
- QList<QNetworkConfiguration> preScanConfigs = manager.allConfigurations();
- QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
- manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
- QList<QNetworkConfiguration> configs = manager.allConfigurations();
- QCOMPARE(thread.configs, configs);
- //Don't compare pre scan configs, because these may be cached and therefore give different results
- //which makes the test unstable. The post scan results should have all configurations every time
- //QCOMPARE(thread.preScanConfigs, preScanConfigs);
-#endif
-}
QTEST_MAIN(tst_QNetworkConfigurationManager)
#include "tst_qnetworkconfigurationmanager.moc"
diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index 136d4d8de7..45464caa17 100644
--- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -41,12 +41,10 @@
#include <QtTest/QTest>
-#include <QtTest/QTestEventLoop>
#include <qcoreapplication.h>
#include <qdebug.h>
#include <qnetworkproxy.h>
-#include <QThread>
#include <QNetworkConfiguration>
#include <QNetworkConfigurationManager>
#include <QNetworkSession>
@@ -78,7 +76,6 @@ public:
};
private slots:
- void systemProxyForQueryCalledFromThread();
void systemProxyForQuery() const;
#ifndef QT_NO_BEARERMANAGEMENT
void fromConfigurations();
@@ -138,32 +135,6 @@ void tst_QNetworkProxyFactory::systemProxyForQuery() const
QFAIL("One or more system proxy lookup failures occurred.");
}
-class QSPFQThread : public QThread
-{
-protected:
- virtual void run()
- {
- proxies = QNetworkProxyFactory::systemProxyForQuery(query);
- }
-public:
- QNetworkProxyQuery query;
- QList<QNetworkProxy> proxies;
-};
-
-//regression test for QTBUG-18799
-void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread()
-{
- QUrl url(QLatin1String("http://qt.nokia.com"));
- QNetworkProxyQuery query(url);
- QSPFQThread thread;
- thread.query = query;
- connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- thread.start();
- QTestEventLoop::instance().enterLoop(5);
- QVERIFY(thread.isFinished());
- QCOMPARE(thread.proxies, QNetworkProxyFactory::systemProxyForQuery(query));
-}
-
#ifndef QT_NO_BEARERMANAGEMENT
//Purpose of this test is just to check systemProxyForQuery doesn't hang or crash
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 501074fd0d..948d14a16b 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -1315,7 +1315,7 @@ void tst_QPainter::drawRect2()
p.end();
QRect stroke = getPaintedSize(image, Qt::white);
- QCOMPARE(stroke, fill.adjusted(0, 0, 1, 1));
+ QCOMPARE(stroke.adjusted(1, 1, 0, 0), fill.adjusted(0, 0, 1, 1));
}
}
@@ -1412,13 +1412,13 @@ void tst_QPainter::drawPath_data()
{
QPainterPath p;
p.addRect(2.25, 2.25, 10, 10);
- QTest::newRow("non-aligned rect") << p << QRect(2, 2, 10, 10) << 10 * 10;
+ QTest::newRow("non-aligned rect") << p << QRect(3, 3, 10, 10) << 10 * 10;
}
{
QPainterPath p;
p.addRect(2.25, 2.25, 10.5, 10.5);
- QTest::newRow("non-aligned rect 2") << p << QRect(2, 2, 11, 11) << 11 * 11;
+ QTest::newRow("non-aligned rect 2") << p << QRect(3, 3, 10, 10) << 10 * 10;
}
{
diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro
index a003338583..65c4e8ffb7 100644
--- a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro
+++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro
@@ -1,5 +1,6 @@
TEMPLATE = lib
CONFIG += static plugin
+CONFIG -= create_prl # not needed, and complicates debug/release
SOURCES = staticplugin.cpp
RESOURCES = staticplugin.qrc
QT = core script
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 29845d9f9a..e14c9db83f 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -361,7 +361,7 @@ bool tst_QStaticText::supportsTransformations() const
QPaintEngine::Type type = engine->type();
if (type == QPaintEngine::OpenGL
-#if !defined(Q_WS_WIN) && !defined(Q_WS_X11)
+#if !defined(Q_WS_WIN) && !defined(Q_WS_X11) && !defined(Q_WS_MAC)
|| type == QPaintEngine::Raster
#endif
)
@@ -601,7 +601,7 @@ void tst_QStaticText::setPenPlainText()
QStaticText staticText("XXXXX");
staticText.setTextFormat(Qt::PlainText);
- p.drawStaticText(0, fm.ascent(), staticText);
+ p.drawStaticText(0, 0, staticText);
}
QImage img = image.toImage();
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp
index 11fd986df2..c19b168e9e 100644
--- a/tests/auto/qstring/tst_qstring.cpp
+++ b/tests/auto/qstring/tst_qstring.cpp
@@ -4334,7 +4334,7 @@ void tst_QString::localeAwareCompare_data()
void tst_QString::localeAwareCompare()
{
#ifdef Q_OS_SYMBIAN
- QSKIP("QTBUG-16921: There is no way to set up the system locale, so this test is not reliable in Symbian.");
+ QSKIP("QTBUG-16921: There is no way to set up the system locale, so this test is not reliable in Symbian.", SkipSingle);
#else
#ifdef Q_OS_WIN
# ifndef Q_OS_WINCE
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 17990199ad..a4fc1a9dd6 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -1608,7 +1608,12 @@ class ChangeEventWidget : public QWidget
static bool recurse = false;
if (!recurse) {
recurse = true;
+
+#ifdef Q_OS_SYMBIAN
+ QStyle *style = new QWindowsStyle();
+#else
QStyle *style = new QMotifStyle;
+#endif
style->setParent(this);
setStyle(style);
recurse = false;
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index 1129219b1f..68252ef6ae 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -182,6 +182,8 @@ private slots:
void copiedFontSize();
+ void htmlExportImportBlockCount();
+
private:
void backgroundImage_checkExpectedHtml(const QTextDocument &doc);
@@ -1582,7 +1584,7 @@ void tst_QTextDocument::toHtml()
expectedOutput.replace("OPENDEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;");
expectedOutput.replace("DEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"");
- expectedOutput.replace("EMPTYBLOCK", "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n");
+ expectedOutput.replace("EMPTYBLOCK", "<p style=\"-qt-paragraph-type:empty; height:1em; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n");
if (expectedOutput.endsWith(QLatin1Char('\n')))
expectedOutput.chop(1);
expectedOutput.append(htmlTail);
@@ -2760,5 +2762,27 @@ void tst_QTextDocument::copiedFontSize()
QCOMPARE(cursorOutput.charFormat().font().pixelSize(), 24);
}
+void tst_QTextDocument::htmlExportImportBlockCount()
+{
+ QTextDocument document;
+ {
+ QTextCursor cursor(&document);
+ cursor.insertText("Foo");
+ cursor.insertBlock();
+ cursor.insertBlock();
+ cursor.insertBlock();
+ cursor.insertBlock();
+ cursor.insertText("Bar");
+ }
+
+ QCOMPARE(document.blockCount(), 5);
+ QString html = document.toHtml();
+
+ document.clear();
+ document.setHtml(html);
+
+ QCOMPARE(document.blockCount(), 5);
+}
+
QTEST_MAIN(tst_QTextDocument)
#include "tst_qtextdocument.moc"
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index b6adc2b8a0..2414ab3e37 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -127,6 +127,8 @@ private slots:
void textWithSurrogates_qtbug15679();
void textWidthWithStackedTextEngine();
void textWidthWithLineSeparator();
+ void cursorInLigatureWithMultipleLines();
+ void xToCursorForLigatures();
private:
QFont testFont;
@@ -1460,5 +1462,45 @@ void tst_QTextLayout::textWidthWithLineSeparator()
QCOMPARE(line1.naturalTextWidth(), line2.naturalTextWidth());
}
+void tst_QTextLayout::cursorInLigatureWithMultipleLines()
+{
+#if !defined(Q_WS_MAC)
+ QSKIP("This test can not be run on Mac", SkipAll);
+#endif
+ QTextLayout layout("first line finish", QFont("Times", 20));
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ line.setLineWidth(70);
+ line = layout.createLine();
+ layout.endLayout();
+
+ // The second line will be "finish", with "fi" as a ligature
+ QVERIFY(line.cursorToX(0) != line.cursorToX(1));
+}
+
+void tst_QTextLayout::xToCursorForLigatures()
+{
+#if !defined(Q_WS_MAC)
+ QSKIP("This test can not be run on Mac", SkipAll);
+#endif
+ QTextLayout layout("fi", QFont("Times", 20));
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ QVERIFY(line.xToCursor(0) != line.xToCursor(line.naturalTextWidth() / 2));
+
+ // U+0061 U+0308
+ QTextLayout layout2(QString::fromUtf8("\x61\xCC\x88"), QFont("Times", 20));
+
+ layout2.beginLayout();
+ line = layout2.createLine();
+ layout2.endLayout();
+
+ qreal width = line.naturalTextWidth();
+ QVERIFY(line.xToCursor(0) == line.xToCursor(width / 2) ||
+ line.xToCursor(width) == line.xToCursor(width / 2));
+}
+
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
index 427a505e23..a4aa312f3a 100644
--- a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
@@ -231,7 +231,7 @@ void tst_QToolButton::task176137_autoRepeatOfAction()
void tst_QToolButton::sendMouseClick()
{
- QTest::mouseClick(w, Qt::LeftButton, 0, QPoint(7,7));
+ QTest::mouseClick(w, Qt::LeftButton, 0);
}
QTEST_MAIN(tst_QToolButton)
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp
index dc878c4818..7d2cdfb926 100644
--- a/tests/auto/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp
@@ -50,6 +50,8 @@
#include <qlineedit.h>
#include <QScrollBar>
#include <QStyledItemDelegate>
+#include <QDesktopWidget>
+#include <QApplication>
#include "../../shared/util.h"
@@ -3102,10 +3104,21 @@ void tst_QTreeWidget::task206367_duplication()
QWidget topLevel;
QTreeWidget treeWidget(&topLevel);
topLevel.show();
+#ifndef Q_WS_S60
treeWidget.resize(200, 200);
+#endif
treeWidget.setSortingEnabled(true);
QTreeWidgetItem* rootItem = new QTreeWidgetItem( &treeWidget, QStringList("root") );
+#ifdef Q_WS_S60
+ // Ensure that eight items fit into tree widget. In Symbian VGA devices 8 rows of
+ // data will take more than 200 pixels.
+ int calculatedHeight = treeWidget.visualItemRect(treeWidget.topLevelItem(0)).height() +
+ 2 * QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, 0);
+ calculatedHeight *= 8; // eight 'rows': header, root and 2 items with 2 children
+ treeWidget.resize(200, qMax(200, calculatedHeight));
+#endif
+
for (int nFile = 0; nFile < 2; nFile++ ) {
QTreeWidgetItem* itemFile = new QTreeWidgetItem(rootItem, QStringList(QString::number(nFile)));
for (int nRecord = 0; nRecord < 2; nRecord++)
@@ -3211,6 +3224,13 @@ void tst_QTreeWidget::task239150_editorWidth()
{
//we check that an item with no text will get an editor with a correct size
QTreeWidget tree;
+#ifdef Q_OS_SYMBIAN
+ //By default widgets are 640*360 in Symbian. Call to create_sys() sets the real size of the widget.
+ //Therefore, with VGA Symbian devices, we need to update the widget width to match screen width.
+ //As VGA devices have larger font, longer texts wouldn't otherwise fit into tree widget.
+ if (QApplication::desktop() && QApplication::desktop()->availableGeometry().width() > tree.width())
+ tree.resize(QApplication::desktop()->availableGeometry().size());
+#endif
QStyleOptionFrameV2 opt;
opt.init(&tree);
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index ae27c4ac94..b78679b5fb 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -3170,8 +3170,8 @@ void tst_QUrl::nameprep_testsuite_data()
#ifdef QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE
-extern void qt_nameprep(QString *source, int from);
-extern bool qt_check_std3rules(const QChar *, int);
+Q_CORE_EXPORT extern void qt_nameprep(QString *source, int from);
+Q_CORE_EXPORT extern bool qt_check_std3rules(const QChar *, int);
QT_END_NAMESPACE
#endif
diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro
index cb02a35c27..73e40b2ff9 100644
--- a/tests/benchmarks/declarative/declarative.pro
+++ b/tests/benchmarks/declarative/declarative.pro
@@ -10,6 +10,6 @@ SUBDIRS += \
script \
qmltime
-contains(QT_CONFIG, opengl): SUBDIRS += painting
+contains(QT_CONFIG, opengl): SUBDIRS += painting qmlshadersplugin
include(../trusted-benchmarks.pri)
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml
new file mode 100644
index 0000000000..ee4c029622
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: gaussianBlur
+ property variant source: 0
+ property real radius: 8;
+ property real deviation: Math.sqrt(-((radius+1) * (radius+1)) / (2 * Math.log(1.0 / 255.0)))
+ property bool live: true
+
+ ShaderEffectItem {
+ id: cache
+ anchors.fill: parent
+ visible: !gaussianBlur.live
+ property variant source: ShaderEffectSource { sourceItem: verticalBlur; live: false; hideSource: true }
+ }
+
+ GaussianDirectionalBlur {
+ id: verticalBlur
+ anchors.fill: parent
+
+ deltaX: 0.0
+ deltaY: 1.0/parent.height
+
+ source: ShaderEffectSource { sourceItem: horizontalBlur; hideSource: true }
+ deviation: gaussianBlur.deviation
+ radius: gaussianBlur.radius
+ }
+
+ GaussianDirectionalBlur {
+ id: horizontalBlur
+ anchors.fill: parent
+ blending: false
+
+ deltaX: 1.0/parent.width
+ deltaY: 0.0
+
+ source: gaussianBlur.source
+ deviation: gaussianBlur.deviation
+ radius: gaussianBlur.radius
+ }
+
+}
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml
new file mode 100644
index 0000000000..e09dde2604
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml
@@ -0,0 +1,209 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+// Note 1. This shader implements gaussian blur without dynamic array access from inside shader loops (Optional feature in OpenGLES 2.0).
+// Note 2. Shader code is generated to avoid ecessive if-else structure in fragment shader. Code re-generation (very slow!) happens if blur radius is changed.
+
+ShaderEffectItem {
+ id: effect
+ property variant source: 0
+ property real deviation: Math.sqrt(-((radius+1) * (radius+1)) / (2 * Math.log(1.0 / 255.0)));
+ property real radius: 8;
+ property real deltaX: 0.0
+ property real deltaY: 0.0
+
+ property real gaussianSum: 0.0
+ property real startIndex: 0.0
+ property real samples: radius * 2
+
+ property variant gwts: []
+ property variant delta: Qt.vector3d(effect.deltaX, effect.deltaY, effect.startIndex);
+ property variant factor_0_2: Qt.vector3d(effect.gwts[0], effect.gwts[1], effect.gwts[2]);
+ property variant factor_3_5: Qt.vector3d(effect.gwts[3],effect.gwts[4],effect.gwts[5]);
+ property variant factor_6_8: Qt.vector3d(effect.gwts[6],effect.gwts[7],effect.gwts[8]);
+ property variant factor_9_11: Qt.vector3d(effect.gwts[9],effect.gwts[10],effect.gwts[11]);
+ property variant factor_12_14: Qt.vector3d(effect.gwts[12],effect.gwts[13],effect.gwts[14]);
+ property variant factor_15_17: Qt.vector3d(effect.gwts[15],effect.gwts[16],effect.gwts[17]);
+ property variant factor_18_20: Qt.vector3d(effect.gwts[18],effect.gwts[19],effect.gwts[20]);
+ property variant factor_21_23: Qt.vector3d(effect.gwts[21],effect.gwts[22],effect.gwts[23]);
+ property variant factor_24_26: Qt.vector3d(effect.gwts[24],effect.gwts[25],effect.gwts[26]);
+ property variant factor_27_29: Qt.vector3d(effect.gwts[27],effect.gwts[28],effect.gwts[29]);
+ property variant factor_30_32: Qt.vector3d(effect.gwts[30],effect.gwts[31],effect.gwts[32]);
+
+ //Gaussian function = h(x):=(1/sqrt(2*3.14159*(D^2))) * %e^(-(x^2)/(2*(D^2)));
+ function gausFunc(x){
+ return (1/Math.sqrt(2*3.1415926*(Math.pow(effect.deviation,2)))) * Math.pow(2.7182818,-((Math.pow(x,2))/(2*(Math.pow(effect.deviation,2)))));
+ }
+
+ function calcGWTS() {
+ var n = new Array(Math.floor(effect.samples));
+ var step
+ for (var i = 0; i < effect.samples; i++) {
+ step = -effect.samples/2 + i + 0.5
+ n[i] = gausFunc(step);
+ }
+ return n;
+ }
+
+ function buildFragmentShader() {
+
+ var shaderSteps = [
+ "gl_FragColor += texture2D(source, texCoord) * factor_0_2.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_0_2.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_0_2.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_3_5.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_3_5.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_3_5.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_6_8.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_6_8.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_6_8.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_9_11.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_9_11.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_9_11.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_12_14.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_12_14.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_12_14.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_15_17.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_15_17.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_15_17.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_18_20.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_18_20.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_18_20.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_21_23.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_21_23.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_21_23.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_24_26.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_24_26.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_24_26.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_27_29.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_27_29.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_27_29.z; texCoord += shift;",
+
+ "gl_FragColor += texture2D(source, texCoord) * factor_30_32.x; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_30_32.y; texCoord += shift;",
+ "gl_FragColor += texture2D(source, texCoord) * factor_30_32.z; texCoord += shift;"
+ ]
+
+ var shader = fragmentShader_begin
+ var samples = effect.samples
+ if (samples > 32) {
+ console.log("GaussianBlur: Maximum of 32 blur samples exceeded!")
+ samples = 32
+ }
+
+ for (var i = 0; i < samples; i++) {
+ shader += shaderSteps[i]
+ }
+
+ shader += fragmentShader_end
+ effect.fragmentShader = shader
+
+ }
+
+ onDeviationChanged:{
+ effect.startIndex = -effect.samples/2 + 0.5
+ effect.gwts = calcGWTS();
+ var sum = 0.0;
+ for (var j = 0; j < effect.samples; j++) {
+ sum += effect.gwts[j];
+ }
+ effect.gaussianSum = sum
+ }
+
+ Component.onCompleted:{
+ effect.startIndex = -effect.samples/2 + 0.5
+ effect.gwts = calcGWTS();
+ var sum = 0.0;
+ for (var j = 0; j < effect.samples; j++) {
+ sum += effect.gwts[j];
+ }
+ effect.gaussianSum = sum
+ buildFragmentShader()
+ }
+
+ onSamplesChanged: {
+ buildFragmentShader()
+ }
+
+ property string fragmentShader_begin:
+ "
+ varying mediump vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp vec3 delta;
+ uniform highp vec3 factor_0_2;
+ uniform highp vec3 factor_3_5;
+ uniform highp vec3 factor_6_8;
+ uniform highp vec3 factor_9_11;
+ uniform highp vec3 factor_12_14;
+ uniform highp vec3 factor_15_17;
+ uniform highp vec3 factor_18_20;
+ uniform highp vec3 factor_21_23;
+ uniform highp vec3 factor_24_26;
+ uniform highp vec3 factor_27_29;
+ uniform highp vec3 factor_30_32;
+ uniform highp float gaussianSum;
+
+ void main() {
+ highp vec2 shift = vec2(delta.x, delta.y);
+ highp float index = delta.z;
+ mediump vec2 texCoord = qt_TexCoord0 + (shift * index);
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ "
+
+ property string fragmentShader_end:
+ "
+ if (gaussianSum > 0.0)
+ gl_FragColor /= gaussianSum;
+ }
+ "
+}
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml
new file mode 100644
index 0000000000..4e8c8d30f5
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: gaussianDropShadow
+
+ property color shadowColor: Qt.rgba(0.5, 0.5, 0.5, 1.0)
+ property variant source: 0
+ property real radius: 8
+ property real deviation: Math.sqrt(-((radius+1) * (radius+1)) / (2 * Math.log(1.0 / 255.0)))
+ property bool live: true
+
+ GaussianBlur {
+ id: blur
+ anchors.fill: parent
+ radius: gaussianDropShadow.radius
+ deviation: gaussianDropShadow.deviation
+ source: gaussianDropShadow.source
+ live: gaussianDropShadow.live
+ }
+
+ ShaderEffectItem {
+ id: shadow
+ property color shadowColor: gaussianDropShadow.shadowColor
+ property variant source: ShaderEffectSource { sourceItem: blur; hideSource: true }
+ anchors.fill: parent
+
+ fragmentShader:
+ "
+ varying mediump vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform lowp vec4 shadowColor;
+
+ void main() {
+ lowp vec4 sourceColor = texture2D(source, qt_TexCoord0);
+ gl_FragColor = mix(vec4(0), shadowColor, sourceColor.a);
+ }
+ "
+ }
+}
+
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml
new file mode 100755
index 0000000000..4831758002
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ width: 360
+ height: 640
+
+ property bool liveShadows: true
+ property real r: 0
+
+ NumberAnimation on r {
+ loops: Animation.Infinite
+ from: 0
+ to: 360
+ duration: 3000
+ }
+
+ Image {
+ id: background
+ width: main.width
+ height: main.height
+ fillMode: Image.Tile
+ source: "bg.jpg"
+ }
+
+ GaussianDropShadow {
+ x: image1.x + 50
+ y: image1.y + 50
+ width: image1.width
+ height: image1.height
+ shadowColor: "#88000000"
+ source: ShaderEffectSource { sourceItem: image1; hideSource: false; sourceRect: Qt.rect(-10, -10, image1.width + 20, image1.height + 20) }
+ radius: 12.0
+ deviation: 12
+ rotation: r
+ }
+
+ Image {
+ id: image1
+ anchors.fill: parent
+ source: "drop_shadow_small.png"
+ smooth: true
+ rotation: r
+ }
+
+ GaussianDropShadow {
+ x: image2.x + 50
+ y: image2.y + 50
+ width: image2.width
+ height: image2.height
+ shadowColor: "#88000000"
+ source: ShaderEffectSource { sourceItem: image2; hideSource: false; sourceRect: Qt.rect(-10, -10, image2.width + 20, image2.height + 20) }
+ radius: 12.0
+ deviation: 12
+ rotation: -r
+ }
+
+ Image {
+ id: image2
+ anchors.fill: parent
+ source: "drop_shadow_small.png"
+ smooth: true
+ rotation: -r
+ }
+}
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml
new file mode 100755
index 0000000000..c4fbc2aa37
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ width: 360
+ height: 640
+
+ Image {
+ id: image
+ width: parent.width
+ height: parent.height * 0.65
+ source: "sky.jpg"
+ smooth: true
+ }
+ Water {
+ sourceItem: image
+ intensity: 5
+ height: parent.height - image.height
+ }
+}
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/Water.qml b/tests/benchmarks/declarative/qmlshadersplugin/Water.qml
new file mode 100644
index 0000000000..6a1ec1c7cd
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/Water.qml
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: root
+ property alias sourceItem: effectsource.sourceItem
+ property real intensity: 1
+ property bool waving: true
+ anchors.top: sourceItem.bottom
+ width: sourceItem.width
+ height: sourceItem.height
+
+ ShaderEffectItem {
+ anchors.fill: parent
+ property variant source: effectsource
+ property real f: 0
+ property real f2: 0
+ property alias intensity: root.intensity
+ smooth: true
+
+ ShaderEffectSource {
+ id: effectsource
+ hideSource: false
+ smooth: true
+ }
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform lowp float qt_Opacity;
+ uniform highp float f;
+ uniform highp float f2;
+ uniform highp float intensity;
+
+ void main() {
+ const highp float twopi = 3.141592653589 * 2.0;
+
+ highp float distanceFactorToPhase = pow(qt_TexCoord0.y + 0.5, 8.0) * 5.0;
+ highp float ofx = sin(f * twopi + distanceFactorToPhase) / 100.0;
+ highp float ofy = sin(f2 * twopi + distanceFactorToPhase * qt_TexCoord0.x) / 60.0;
+
+ highp float intensityDampingFactor = (qt_TexCoord0.x + 0.1) * (qt_TexCoord0.y + 0.2);
+ highp float distanceFactor = (1.0 - qt_TexCoord0.y) * 4.0 * intensity * intensityDampingFactor;
+
+ ofx *= distanceFactor;
+ ofy *= distanceFactor;
+
+ highp float x = qt_TexCoord0.x + ofx;
+ highp float y = 1.0 - qt_TexCoord0.y + ofy;
+
+ highp float fake = (sin((ofy + ofx) * twopi) + 0.5) * 0.05 * (1.2 - qt_TexCoord0.y) * intensity * intensityDampingFactor;
+
+ highp vec4 pix =
+ texture2D(source, vec2(x, y)) * 0.6 +
+ texture2D(source, vec2(x-fake, y)) * 0.15 +
+ texture2D(source, vec2(x, y-fake)) * 0.15 +
+ texture2D(source, vec2(x+fake, y)) * 0.15 +
+ texture2D(source, vec2(x, y+fake)) * 0.15;
+
+ highp float darken = 0.6 - (ofx - ofy) / 2.0;
+ pix.b *= 1.2 * darken;
+ pix.r *= 0.9 * darken;
+ pix.g *= darken;
+
+ gl_FragColor = qt_Opacity * vec4(pix.r, pix.g, pix.b, 1.0);
+ }
+ "
+
+ NumberAnimation on f {
+ running: root.waving
+ loops: Animation.Infinite
+ from: 0
+ to: 1
+ duration: 2410
+ }
+ NumberAnimation on f2 {
+ running: root.waving
+ loops: Animation.Infinite
+ from: 0
+ to: 1
+ duration: 1754
+ }
+ }
+}
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/bg.jpg b/tests/benchmarks/declarative/qmlshadersplugin/bg.jpg
new file mode 100644
index 0000000000..4d22143810
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/bg.jpg
Binary files differ
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png b/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png
new file mode 100755
index 0000000000..4a9b2831aa
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png
Binary files differ
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro
new file mode 100644
index 0000000000..c4f692526c
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro
@@ -0,0 +1,23 @@
+QT += opengl declarative testlib
+
+TARGET = tst_performance
+
+SOURCES += \
+ tst_performance.cpp \
+ ../../../../src/imports/shaders/shadereffectitem.cpp \
+ ../../../../src/imports/shaders/shadereffectsource.cpp \
+ ../../../../src/imports/shaders/shadereffect.cpp \
+ ../../../../src/imports/shaders/shadereffectbuffer.cpp \
+ ../../../../src/imports/shaders/scenegraph/qsggeometry.cpp
+
+HEADERS += \
+ ../../../../src/imports/shaders/shadereffectitem.h \
+ ../../../../src/imports/shaders/shadereffectsource.h \
+ ../../../../src/imports/shaders/shadereffect.h \
+ ../../../../src/imports/shaders/shadereffectbuffer.h \
+ ../../../../src/imports/shaders/scenegraph/qsggeometry.h
+
+OTHER_FILES += \
+ *.qml \
+ *.png \
+ *.jpg
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/sky.jpg b/tests/benchmarks/declarative/qmlshadersplugin/sky.jpg
new file mode 100644
index 0000000000..8fc19ed1be
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/sky.jpg
Binary files differ
diff --git a/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp b/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp
new file mode 100644
index 0000000000..728334a554
--- /dev/null
+++ b/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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 <QtTest/qtest.h>
+#include <QtDeclarative>
+#include "../../../../src/imports/shaders/shadereffectitem.h"
+#include "../../../../src/imports/shaders/shadereffectsource.h"
+//#include "../../../src/shadereffect.h"
+
+class BenchmarkItem : public QDeclarativeItem
+{
+ Q_OBJECT
+
+public:
+ BenchmarkItem( QDeclarativeItem * parent = 0 ) : QDeclarativeItem(parent)
+ , m_frameCount(0)
+ {
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+ }
+
+ void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+ QDeclarativeItem::paint(painter, option, widget);
+ if (timer.restart() > 7) m_frameCount++;
+ }
+
+ int frameCount() { return m_frameCount; }
+
+private:
+ int m_frameCount;
+ QTime timer;
+};
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+ view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ view.setAttribute(Qt::WA_OpaquePaintEvent);
+ view.setAttribute(Qt::WA_NoSystemBackground);
+ view.setResizeMode(QDeclarativeView::SizeViewToRootObject);
+
+ qmlRegisterType<ShaderEffectItem>("Qt.labs.shaders", 1, 0, "ShaderEffectItem");
+ qmlRegisterType<ShaderEffectSource>("Qt.labs.shaders", 1, 0, "ShaderEffectSource");
+
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+ view.setViewport(glWidget);
+ view.show();
+
+ view.setSource(QUrl::fromLocalFile("TestWater.qml"));
+ BenchmarkItem *benchmarkItem;
+
+ qDebug() << "Sea Water benchmark:";
+ benchmarkItem = new BenchmarkItem(dynamic_cast<QDeclarativeItem *>(view.rootObject()));
+ QTest::qWait(5000);
+ qDebug() << "Rendered " << benchmarkItem->frameCount() << " frames in 5 seconds";
+ qDebug() << "Average " << benchmarkItem->frameCount() / 5.0 << " frames per second";
+
+ qDebug() << "Gaussian drop shadow benchmark:";
+ view.setSource(QUrl::fromLocalFile("TestGaussianDropShadow.qml"));
+ benchmarkItem = new BenchmarkItem(dynamic_cast<QDeclarativeItem *>(view.rootObject()));
+ QTest::qWait(5000);
+ qDebug() << "Rendered " << benchmarkItem->frameCount() << " frames in 5 seconds";
+ qDebug() << "Average " << benchmarkItem->frameCount() / 5.0 << " frames per second";
+}
+
+#include "tst_performance.moc"
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index 17eb5a3af7..941522f22a 100644
--- a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -68,8 +68,12 @@ tst_QGuiMetaType::~tst_QGuiMetaType()
void tst_QGuiMetaType::constructGuiType_data()
{
QTest::addColumn<int>("typeId");
- for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
+ for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
+#ifndef QT3_SUPPORT
+ if (i != 63) // QMetaType::QColorGroup (63) requires QT3_SUPPORT
+#endif
QTest::newRow(QMetaType::typeName(i)) << i;
+ }
}
// Tests how fast QMetaType can default-construct and destroy a Qt GUI
diff --git a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
index 30da54847a..70467bce5e 100644
--- a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
+++ b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
@@ -70,8 +70,12 @@ tst_QGuiVariant::~tst_QGuiVariant()
void tst_QGuiVariant::createGuiType_data()
{
QTest::addColumn<int>("typeId");
- for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
+ for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
+#ifndef QT3_SUPPORT
+ if (i != 63) // QMetaType::QColorGroup (63) requires QT3_SUPPORT
+#endif
QTest::newRow(QMetaType::typeName(i)) << i;
+ }
}
// Tests how fast a Qt GUI type can be default-constructed by a
diff --git a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro
index e5b9346954..4bdfcb7966 100644
--- a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro
+++ b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro
@@ -11,3 +11,5 @@ CONFIG += release
# Input
SOURCES += tst_qtcpserver.cpp
+
+symbian:TARGET.CAPABILITY += NetworkServices \ No newline at end of file
diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
index f81853bfd6..f06c4eba8b 100644
--- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -54,6 +54,10 @@
#include <qplatformdefs.h>
#include <qhostinfo.h>
+#include <QNetworkConfiguration>
+#include <QNetworkConfigurationManager>
+#include <QNetworkSession>
+
#include <QNetworkProxy>
Q_DECLARE_METATYPE(QNetworkProxy)
Q_DECLARE_METATYPE(QList<QNetworkProxy>)
@@ -75,16 +79,42 @@ public:
public slots:
void initTestCase_data();
void init();
+ void initTestCase();
void cleanup();
private slots:
void ipv4LoopbackPerformanceTest();
void ipv6LoopbackPerformanceTest();
void ipv4PerformanceTest();
+private:
+#ifndef QT_NO_BEARERMANAGEMENT
+ QNetworkConfigurationManager *netConfMan;
+ QNetworkConfiguration networkConfiguration;
+ QSharedPointer<QNetworkSession> networkSession;
+#endif
};
tst_QTcpServer::tst_QTcpServer()
{
- Q_SET_DEFAULT_IAP
+}
+
+void tst_QTcpServer::initTestCase()
+{
+#ifndef QT_NO_BEARERMANAGEMENT
+ netConfMan = new QNetworkConfigurationManager(this);
+ netConfMan->updateConfigurations();
+ connect(netConfMan, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ networkConfiguration = netConfMan->defaultConfiguration();
+ if (networkConfiguration.isValid()) {
+ networkSession = QSharedPointer<QNetworkSession>(new QNetworkSession(networkConfiguration));
+ if (!networkSession->isOpen()) {
+ networkSession->open();
+ QVERIFY(networkSession->waitForOpened(30000));
+ }
+ } else {
+ QVERIFY(!(netConfMan->capabilities() & QNetworkConfigurationManager::NetworkSessionRequired));
+ }
+#endif
}
tst_QTcpServer::~tst_QTcpServer()
@@ -98,6 +128,7 @@ void tst_QTcpServer::initTestCase_data()
QTest::newRow("WithoutProxy") << false << 0;
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
+ QTest::newRow("WithHttpProxy") << true << int(QNetworkProxy::HttpProxy);
}
void tst_QTcpServer::init()
@@ -179,9 +210,6 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest()
QSKIP("WinCE WM: Not yet supported", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian: IPv6 is not yet supported", SkipAll);
-#endif
QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 0)) {
QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError);
@@ -236,6 +264,11 @@ void tst_QTcpServer::ipv4PerformanceTest()
QTcpServer server;
QVERIFY(server.listen(probeSocket.localAddress(), 0));
+ QFETCH_GLOBAL(int, proxyType);
+ //For http proxy, only the active connection can be proxied and not the server socket
+ if (proxyType == QNetworkProxy::HttpProxy)
+ QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
+
QTcpSocket clientA;
clientA.connectToHost(server.serverAddress(), server.serverPort());
QVERIFY(clientA.waitForConnected(5000));
diff --git a/tests/manual/declarative/declarative.pro b/tests/manual/declarative/declarative.pro
new file mode 100644
index 0000000000..337db2f9c0
--- /dev/null
+++ b/tests/manual/declarative/declarative.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin
+
diff --git a/tests/manual/declarative/qmlshadersplugin/main.cpp b/tests/manual/declarative/qmlshadersplugin/main.cpp
new file mode 100644
index 0000000000..3f40e92e23
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/main.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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/QApplication>
+#include <QtOpenGL>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+
+ QmlApplicationViewer viewer;
+ viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ viewer.setViewport(glWidget);
+ viewer.setAttribute(Qt::WA_OpaquePaintEvent);
+ viewer.setAttribute(Qt::WA_NoSystemBackground);
+ viewer.setOrientation(QmlApplicationViewer::Auto);
+ viewer.setMainQmlFile(QLatin1String("qml/qmlshadersplugintest/main.qml"));
+ viewer.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml
new file mode 100644
index 0000000000..303c7db11c
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ //effect.active = !effect.active
+ effect.visible = !effect.visible
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.visible ? "Effect active (display should be green)" : "Effect not active (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml
new file mode 100644
index 0000000000..b70cac09d4
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent;
+
+ ShaderEffectItem {
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1);
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml
new file mode 100644
index 0000000000..0c31419a90
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.blending = !effect.blending
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.blending ? "Effect blending (display should be orange)" : "Effect not blending (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml
new file mode 100644
index 0000000000..47f5bc358a
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml
@@ -0,0 +1,267 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: blendModeTest
+ property real blendItemHeight: 60
+
+ anchors.fill: parent;
+
+ Rectangle {
+ width: parent.width / 6
+ height: parent.height
+ color: "black"
+ }
+ Rectangle {
+ x: parent.width/6 * 1
+ width: parent.width / 6
+ height: parent.height
+ color: "white"
+ }
+ Rectangle {
+ x: parent.width/6 * 2
+ width: parent.width / 6
+ height: parent.height
+ color: "gray"
+ }
+ Rectangle {
+ x: parent.width/6 * 3
+ width: parent.width / 6
+ height: parent.height
+ color: "red"
+ }
+ Rectangle {
+ x: parent.width/6 * 4
+ width: parent.width / 6
+ height: parent.height
+ color: "green"
+ }
+ Rectangle {
+ x: parent.width/6 * 5
+ width: parent.width / 6
+ height: parent.height
+ color: "blue"
+ }
+
+
+ Image {
+ anchors.fill: parent;
+ source: "image.png"
+
+ }
+
+ Rectangle {
+ id: first
+ anchors.top: parent.top
+ anchors.topMargin: 60
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ color: "#8000ff00"
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " Rectangle color #8000ff00"
+ color: "white"
+ }
+ }
+ Rectangle {
+ id: second
+ anchors.top: first.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ color: "#ff00ff00"
+ opacity: 0.5
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " Rectangle color #ff00ff00, opacity 0.5"
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.top: second.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 0.5);
+ }
+ "
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem gl_FragColor=vec4(0.0, 1.0, 0.0, 0.5)"
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ anchors.top: effect.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 0.5, 0.0, 0.5);
+ }
+ "
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem gl_FragColor=vec4(0.0, 0.5, 0.0, 0.5)"
+ color: "white"
+ }
+ }
+
+
+ Image {
+ id: image1
+ source: "green_image_transparent.png"
+ anchors.top: effect2.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ }
+ Text {
+ anchors.bottom: image1.bottom
+ anchors.bottomMargin: 5
+ text: " Image, green and 50% alpha"
+ color: "white"
+ }
+
+
+ ShaderEffectItem {
+ id: effect3
+ property variant source: ShaderEffectSource {
+ sourceItem: image1
+ hideSource: false
+ }
+ anchors.top: image1.bottom
+ anchors.topMargin: 5
+
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source item green 50% alpha."
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect4
+ property variant source: ShaderEffectSource {
+ sourceItem: Image { source: "green_image_transparent.png" }
+ hideSource: true
+ }
+ anchors.top: effect3.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source image green 50% alpha."
+ color: "white"
+ }
+ }
+
+
+ Rectangle {
+ id: greenRect2
+ anchors.top: effect4.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ opacity: 0.5
+ color: "green"
+ }
+
+
+ ShaderEffectItem {
+ id: effect5
+ property variant source: ShaderEffectSource { sourceItem: greenRect2; hideSource: true }
+ anchors.top: effect4.bottom
+ anchors.topMargin: 5
+
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source item green rect with 0.5 opacity."
+ color: "white"
+ }
+ }
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ }
+ }
+
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Blending test"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml
new file mode 100644
index 0000000000..1cad5b1f14
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id :root
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect1.visible = !effect1.visible
+ effect2.visible = !effect2.visible
+ //effect3.visible = !effect3.visible
+ }
+ }
+
+ Rectangle {
+ id: a
+ x: 90
+ y: 90
+ color: "red"
+ width: 220
+ height: 220
+ Rectangle {
+ id: b
+ x: 10
+ y: 10
+ color: "blue"
+ width: 100
+ height: 100
+ rotation: 5
+ Rectangle {
+ id: c
+ x: 10
+ y: 10
+ color: "black"
+ width: 80
+ height: 80
+ }
+ }
+ Rectangle {
+ id: d
+ x: 10
+ y: 110
+ color: "yellow"
+ width: 100
+ height: 100
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect1
+ anchors.fill: a
+ property variant source: ShaderEffectSource{ sourceItem: a; hideSource: true }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ x: 100
+ y: 100
+ width: 100
+ height: 100
+ rotation: 5
+ property variant source: ShaderEffectSource{ sourceItem: b; hideSource: true }
+ }
+
+// ShaderEffectItem {
+// id: effect3
+// x: 110
+// y: 210
+// width: 80
+// height: 80
+// property variant source: ShaderEffectSource{ sourceItem: c; hideSource: true }
+// }
+
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect1.visible ? "Effects active" : "Effects NOT active"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml
new file mode 100644
index 0000000000..1446f9ba87
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+
+ }
+ }
+
+ Rectangle {
+ id: theSource
+ color: "red"
+ anchors.centerIn: parent;
+ width: parent.width/2
+ height: parent.height/2
+ }
+
+ ShaderEffectItem {
+ id: effect1
+ anchors.fill: theSource;
+ property variant source: ShaderEffectSource{ sourceItem: theSource; hideSource: true }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ anchors.fill: effect1;
+ property variant source: effect1
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = vec4(texture2D(source, qt_TexCoord0.st).rgb, 1.0);
+ }
+ "
+ }
+
+ ShaderEffectItem {
+ id: effect3
+ x: effect2.x
+ y: effect2.y
+ width: effect2.width
+ height: effect2.height
+
+ property variant source: ShaderEffectSource { sourceItem: effect2 ; hideSource: false }
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Red rect inside green fullscreen rect."
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml
new file mode 100644
index 0000000000..df5e06d8ff
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "gray"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (theSource.format == ShaderEffectSource.Alpha)
+ theSource.format = ShaderEffectSource.RGB
+ else if (theSource.format == ShaderEffectSource.RGB)
+ theSource.format = ShaderEffectSource.RGBA
+ else if (theSource.format == ShaderEffectSource.RGBA)
+ theSource.format = ShaderEffectSource.Alpha
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Source format test: " + theSource.format
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml
new file mode 100644
index 0000000000..d17035865b
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.fragmentShader == effect.redFragmentShader ? effect.fragmentShader = effect.greenFragmentShader : effect.fragmentShader = effect.redFragmentShader
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+
+ property string redFragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ "
+
+ property string greenFragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+
+ fragmentShader: redFragmentShader
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.fragmentShader == effect.redFragmentShader ? "Effect (display should be red)" : "Effect (display should be green)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml
new file mode 100644
index 0000000000..08e9319c11
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ console.log("Grabbed!")
+ theSource.grab();
+ }
+ }
+
+ Image {
+ id: theSourcImage
+ source: "image_opaque.png"
+ opacity: 0.5
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: theSourcImage
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect with grab (opacity 0.5)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml
new file mode 100644
index 0000000000..1cd449f057
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ //theSource.hideOriginal = !theSource.hideOriginal
+ theSource.hideSource = !theSource.hideSource
+ }
+ }
+
+ Rectangle {
+ id: redRect
+ anchors.fill: parent;
+ color: "red"
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redRect
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main() {
+ // Empty fragmentshader, we do not write any pixels via this effect item. We only observe hideoriginal functionality.
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ //text: theSource.hideOriginal ? "Hideoriginal true (display should be green)" : "Hideoriginal false (display should be red)"
+ text: theSource.hideSource ? "HideSource true (display should be green)" : "HideSource false (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml
new file mode 100644
index 0000000000..ec372ca1b4
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatHorizontally
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? "HorizontalWrap RepeatHorizontally" : "HorizontalWrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml
new file mode 100644
index 0000000000..9d990d0a96
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.smooth = !theSource.smooth
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ width: parent.width * 2.0
+ height: parent.height * 2.0
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: !theSource.smooth ? "Filtering nearest (faster)" : "Filtering linear (better quality)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml
new file mode 100644
index 0000000000..3ad2b50063
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: imageMarginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+
+ onTriggered: {
+ if (imageMarginTester.testMarginX < 20) {
+ imageMarginTester.testMarginX = 50
+ imageMarginTester.testMarginY = 120
+ }
+ else {
+ imageMarginTester.testMarginX = 10
+ imageMarginTester.testMarginY = 10
+ }
+
+ console.log("onTriggered...")
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ console.log("onTriggered done")
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "image_opaque.png"
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + imageMarginTester.testMarginX + "x" + imageMarginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml
new file mode 100644
index 0000000000..453bbaff79
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "image_opaque.png"
+ textureSize: Qt.size(160,160)
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml
new file mode 100644
index 0000000000..a51068db10
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (theSource.mipmap && theSource.smooth){
+ theSource.smooth = false
+ } else if (theSource.mipmap && !theSource.smooth){
+ theSource.smooth = true
+ theSource.mipmap = false
+ } else if (!theSource.mipmap && theSource.smooth){
+ theSource.smooth = false
+ } else if (!theSource.mipmap && !theSource.smooth){
+ theSource.smooth = true
+ theSource.mipmap = true
+ }
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "wallpaper.jpg"
+ mipmap: false
+ smooth: false
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent;
+ width: parent.width * 0.8
+ height: parent.height * 0.8
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Mipmap: " + theSource.mipmap + ", Smooth: " + theSource.smooth
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml
new file mode 100644
index 0000000000..94f7824ee4
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ console.log("onTriggered")
+ }
+ }
+
+ Image {
+ id: redrect
+ source: "image_opaque.png"
+ }
+
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redrect
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml
new file mode 100644
index 0000000000..83784c35f0
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ }
+ }
+
+ Image {
+ id: redrect
+ source: "image_opaque.png"
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redrect
+ textureSize: Qt.size(160,160)
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml
new file mode 100644
index 0000000000..6db568d6f9
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.live = !theSource.live
+ theSource.grab() // This tests grabbing screenshot from static source
+ }
+ }
+
+ Rectangle {
+ id: greenRect
+ anchors.fill: parent;
+ color: theSource.live ? "green" : "red" // This works if we use grab()
+ property int counter: 0
+ Text {
+ id: counterText
+ anchors.centerIn: parent
+ text: greenRect.counter
+ font.pixelSize: 48
+ }
+ Timer {
+ running: true
+ interval: 100
+ repeat: true
+ onTriggered: {
+ greenRect.counter++
+ }
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: greenRect
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.live ? "live true (color green, number changes)" : "live false (color red, same number)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml
new file mode 100644
index 0000000000..255df36153
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.meshResolution.width == 1 ? effect.meshResolution = Qt.size(40,40) : effect.meshResolution = Qt.size(1,1)
+ }
+ }
+
+ Rectangle {
+ id: thesource
+ anchors.centerIn: parent;
+ color: "green"
+ width: parent.width
+ height: parent.height
+ Image {
+ anchors.centerIn: parent;
+ source: "image_opaque.png"
+ }
+ }
+
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: thesource;
+ property variant source: ShaderEffectSource { sourceItem: thesource }
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+
+ highp vec4 shift = vec4(cos(1071. * qt_MultiTexCoord0.x + 1.0) + sin(2051. * qt_MultiTexCoord0.y + 1.0),
+ cos(1131. * qt_MultiTexCoord0.x + 1.0) + sin(3039. * qt_MultiTexCoord0.x + 1.0), 0, 0) * 3.0;
+
+ if (qt_MultiTexCoord0.x < 0.01 || qt_MultiTexCoord0.x > 0.99)
+ shift.x = 0.;
+ if (qt_MultiTexCoord0.y < 0.01 || qt_MultiTexCoord0.y > 0.99)
+ shift.y = 0.;
+
+ gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex + shift);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.meshResolution.width == 1 ? "Resolution (1,1) (image looks normal)" : "Resolution (40,40) (image looks distorted)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml
new file mode 100644
index 0000000000..117ae65cb4
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: source
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ anchors.fill: text;
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml
new file mode 100644
index 0000000000..00af373ea6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effect.opacity > 0.9)
+ effect.opacity = 0.0
+ else if (effect.opacity < 0.5)
+ effect.opacity = 0.5
+ else if (effect.opacity < 0.9)
+ effect.opacity = 1.0
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+
+ fragmentShader: "
+ uniform highp float qt_Opacity;
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(texture2D(source, qt_TexCoord0).rgb, qt_Opacity);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect with opacity: " + effect.opacity
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml
new file mode 100644
index 0000000000..c4435faf34
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effectWrapper.rotation < 45)
+ effectWrapper.rotation = 45
+ else if (effectWrapper.rotation < 90)
+ effectWrapper.rotation = 90
+ else if (effectWrapper.rotation < 180)
+ effectWrapper.rotation = 0
+
+ }
+ }
+
+ Item {
+ id: effectWrapper
+ anchors.fill: parent;
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width - 50
+ height: parent.height - 50
+ property variant source: theSource
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect is rotated " + effectWrapper.rotation + " degrees"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml
new file mode 100644
index 0000000000..3488eabd8a
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effectWrapper.scale < 0.3)
+ effectWrapper.scale = 0.3
+ else if (effectWrapper.scale < 1.7)
+ effectWrapper.scale = 1.7
+ else if (effectWrapper.scale < 2.0)
+ effectWrapper.scale = 0.1
+ }
+ }
+
+ Item {
+ id: effectWrapper
+ anchors.fill: parent;
+ scale: 0.1
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width - 50
+ height: parent.height - 50
+ property variant source: theSource
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect is scaled " + effectWrapper.scale
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml
new file mode 100644
index 0000000000..7369efcb50
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.textureSize.width == 64 ? theSource.textureSize = Qt.size(360,640) : theSource.textureSize = Qt.size(64,64)
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ textureSize: Qt.size(64,64)
+ smooth: true
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "textureSize:" + theSource.textureSize.width + "x" + theSource.textureSize.height
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml
new file mode 100644
index 0000000000..8098a4daff
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: source
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ width: parent.width
+ height: parent.height / 2
+ blending: false
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+
+ ShaderEffectItem {
+ width: parent.width
+ y: parent.height / 2
+ height: parent.height / 2
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml
new file mode 100644
index 0000000000..e651cd929b
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Rectangle {
+ id: rect;
+ anchors.centerIn: parent
+ width: 1
+ height: 10
+
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#ff0000" }
+ GradientStop { position: 0.5; color: "#00ff00" }
+ GradientStop { position: 1; color: "#0000ff" }
+ }
+ }
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: maskSource
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectSource {
+ id: colorSource
+ sourceItem: rect;
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ anchors.fill: text;
+
+ property variant colorSource: colorSource
+ property variant maskSource: maskSource;
+
+ fragmentShader: "
+ uniform lowp sampler2D maskSource;
+ uniform lowp sampler2D colorSource;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = texture2D(maskSource, qt_TexCoord0).a * texture2D(colorSource, qt_TexCoord0.yx);
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml
new file mode 100644
index 0000000000..4edb06530e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.vertexShader == effect.defaultVertexShader ? effect.vertexShader = effect.dummyVertexShader : effect.vertexShader = effect.defaultVertexShader
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+
+ property string defaultVertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ property string dummyVertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Vertex * vec4(0.0, 0.0, 0.0, 0.0001);
+ }
+ "
+
+ vertexShader: defaultVertexShader
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.vertexShader == effect.defaultVertexShader ? "Effect (display shoud be green)" : "Effect (display shoud be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml
new file mode 100644
index 0000000000..b7d6db4bb7
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.RepeatVertically ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatVertically
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.RepeatVertically ? "Wrap RepeatVertically" : "VerticalWrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml
new file mode 100644
index 0000000000..e09673cc85
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.Repeat ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.Repeat
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.Repeat ? "Wrap Repeat" : "Wrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg
new file mode 100755
index 0000000000..3005133b8e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<rect fill="none" width="30" height="30"/>
+<path fill="#FFFFFF" d="M19,8h-9V5c0-0.389-0.225-0.74-0.576-0.906C9.289,4.031,9.145,4,9,4C8.771,4,8.543,4.079,8.359,4.231
+ l-6,5.001C2.132,9.422,2,9.703,2,10s0.132,0.578,0.359,0.768l6,5C8.543,15.921,8.771,16,9,16c0.145,0,0.289-0.031,0.424-0.094
+ C9.775,15.741,10,15.389,10,15v-3h9c2.757,0,5,2.243,5,5s-2.243,5-5,5h-6.917c-1.104,0-2,0.896-2,2s0.896,2,2,2H19
+ c4.963,0,9-4.037,9-9S23.963,8,19,8z"/>
+</svg>
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png
new file mode 100755
index 0000000000..f3024f7eeb
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png
new file mode 100755
index 0000000000..144c02d548
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png
new file mode 100755
index 0000000000..c73d38927e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png
new file mode 100755
index 0000000000..b2267737fd
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml
new file mode 100644
index 0000000000..1abf524714
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml
@@ -0,0 +1,236 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: main
+ width: 360
+ height: 640
+
+ Rectangle {
+ id: background
+ visible: testCaseList.visible
+ anchors.fill: parent
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#EEEEEE" }
+ GradientStop { position: 1.0; color: "#AAAAAA" }
+ }
+ }
+
+ Loader {
+ id: testLoader
+ width: parent.width
+ height: parent.height
+ visible: !testCaseList.visible
+ }
+
+ ListModel {
+ id: testcaseModel
+ ListElement { name: "TestEffectHierarchy.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestGrab.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestLive.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestImageFiltering.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestWrapRepeat.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestHorizontalWrap.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestVerticalWrap.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestTextureSize.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestItemMargins.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestEffectInsideAnotherEffect.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestItemMarginsWithTextureSize.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestHideOriginal.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestActive.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestBlending.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestBlendingModes.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestOpacity.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestFragmentShader.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestVertexShader.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestMeshResolution.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestRotation.qml"; group: "Shader effect transformation tests" }
+ ListElement { name: "TestScale.qml"; group: "Shader effect transformation tests" }
+ ListElement { name: "TestBasic.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestOneSource.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestTwiceOnSameSource.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestTwoSources.qml"; group: "Scenegraph effect tests" }
+ }
+
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: testCaseList.width
+ height: 35
+ color: "#00000000"
+
+ Text {
+ text: section
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignLeft
+ anchors.fill: parent
+ anchors.leftMargin: 5
+ font.bold: true
+ style: Text.Raised
+ styleColor: "white"
+ }
+ }
+ }
+
+ ListView {
+ id: testCaseList
+
+ property int hideTranslation: 0
+ transform: Translate {
+ x: testCaseList.hideTranslation
+ }
+
+ anchors.fill: parent
+ anchors.topMargin: 10
+ anchors.leftMargin: 5
+ anchors.rightMargin: 5
+ anchors.bottomMargin: 10
+
+ model: testcaseModel
+ spacing: 3
+
+ state: "testStopped"
+
+ section.property: "group"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+
+ delegate: Rectangle {
+ width: parent.width
+ height: 50
+ radius: 5
+ border.width: 1
+ border.color: "#888888"
+ color: delegateMouseArea.pressed ? "#AAAAFF" : "#FFFFFF"
+ Text {
+ id: delegateText;
+ text: " " + name
+ width: parent.width
+ height: parent.height
+ font.pixelSize: 16
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ id: delegateText2;
+ text: "> "
+ width: parent.width
+ height: parent.height
+ font.pixelSize: 20
+ smooth: true
+ color: "gray"
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignRight
+ }
+
+ MouseArea {
+ id: delegateMouseArea
+ anchors.fill: parent;
+ onClicked: {
+ testCaseList.state = "testRunning"
+ testLoader.source = name
+ console.log(name)
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "testRunning"
+ PropertyChanges { target: testCaseList; visible: false; hideTranslation: -main.width }
+ },
+ State {
+ name: "testStopped"
+ PropertyChanges { target: testCaseList; visible: true; hideTranslation: 0 }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "testRunning"
+ SequentialAnimation {
+ NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 }
+ PropertyAction { target: testCaseList; property: "visible"; value: false }
+ }
+ },
+ Transition {
+ to: "testStopped"
+ SequentialAnimation {
+ PropertyAction { target: testCaseList; property: "visible"; value: true }
+ NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 }
+ }
+ }
+
+ ]
+ }
+
+ Rectangle {
+ visible: true
+ anchors.bottom: main.bottom
+ anchors.left: main.left
+ anchors.right: main.right
+ height: 40
+ color: "#cc000000"
+ Item {
+ anchors.top: parent.top
+ anchors.topMargin: 5
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ Image {
+ source: "back.svg"
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent;
+ onClicked: {
+ if (testCaseList.visible){
+ Qt.quit()
+ } else if (!testCaseList.state != "testStopped") {
+ testCaseList.state = "testStopped"
+ testLoader.source = ""
+ }
+ }
+ }
+ }
+}
+
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg
new file mode 100755
index 0000000000..5bc7b58550
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 0000000000..b5b43bfd83
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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$
+**
+****************************************************************************/
+
+// checksum 0xdf1f version 0x10008
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#ifdef QMLJSDEBUGGER
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#ifdef QMLOBSERVER
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(Orientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != Auto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == LockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case LockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case LockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case Auto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::show()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ QDeclarativeView::show();
+#endif
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 0000000000..4d1a38c8d3
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin 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$
+**
+****************************************************************************/
+
+// checksum 0x39ee version 0x10008
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+public:
+ enum Orientation {
+ LockPortrait,
+ LockLandscape,
+ Auto
+ };
+
+ QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(Orientation orientation);
+ void show();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 0000000000..79e6a9f820
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,152 @@
+# checksum 0xc123 version 0x10008
+# This file should not be edited.
+# Future versions of Qt Creator might offer updated versions of this file.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+contains(DEFINES, QMLOBSERVER) {
+ DEFINES *= QMLJSDEBUGGER
+}
+
+defineTest(minQtVersion) {
+ maj = $$1
+ min = $$2
+ patch = $$3
+ isEqual(QT_MAJOR_VERSION, $$maj) {
+ isEqual(QT_MINOR_VERSION, $$min) {
+ isEqual(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ greaterThan(QT_PATCH_VERSION, $$patch) {
+ return(true)
+ }
+ }
+ greaterThan(QT_MINOR_VERSION, $$min) {
+ return(true)
+ }
+ }
+ return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+ CONFIG(debug, debug|release) {
+ !minQtVersion(4, 7, 1) {
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("This library requires Qt 4.7.1 or newer.")
+ warning()
+
+ error("Qt version $$QT_VERSION too old for QmlJS Debugging. Aborting.")
+ }
+ isEmpty(QMLJSDEBUGGER_PATH) {
+ warning()
+ warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+ warning("Please specify its location on the qmake command line, eg")
+ warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+ warning()
+
+ error("QMLJSDEBUGGER defined, but no QMLJSDEBUGGER_PATH set on command line. Aborting.")
+ DEFINES -= QMLJSDEBUGGER
+ } else {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+ }
+ } else {
+ DEFINES -= QMLJSDEBUGGER
+ }
+}
+# This file should not be edited.
+# Future versions of Qt Creator might offer updated versions of this file.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ ICON = $${TARGET}.svg
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
+ contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
+} else:win32 {
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$eval($${deploymentfolder}.source)
+ pathSegments = $$split(source, /)
+ sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
+ copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/usr
+ desktopfile.path = /usr/share/applications/hildon
+ } else {
+ installPrefix = /usr/local
+ desktopfile.path = /usr/share/applications
+ !isEqual(PWD,$$OUT_PWD) {
+ copyCommand = @echo Copying application data...
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ copyCommand += && $(MKDIR) $$target
+ copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
+ }
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+ icon.files = $${TARGET}.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ desktopfile.files = $${TARGET}.desktop
+ target.path = $${installPrefix}/bin
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ export(target.path)
+ INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro
new file mode 100644
index 0000000000..98101fb641
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro
@@ -0,0 +1,29 @@
+QT += declarative opengl
+
+# Add more folders to ship with the application, here
+folder_01.source = qml/qmlshadersplugintest
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve Qml modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE40472A7
+
+# Define QMLJSDEBUGGER to enable basic debugging (setting breakpoints etc)
+# Define QMLOBSERVER for advanced features (requires experimental QmlInspector plugin!)
+#DEFINES += QMLJSDEBUGGER
+#DEFINES += QMLOBSERVER
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 05b34bc26a..ddefa9a27c 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -1388,7 +1388,7 @@ void MainWindow::setupPhrase()
void MainWindow::closeEvent(QCloseEvent *e)
{
- if (maybeSaveAll() && closePhraseBooks())
+ if (maybeSaveAll() && maybeSavePhraseBooks())
e->accept();
else
e->ignore();
@@ -2302,7 +2302,7 @@ bool MainWindow::maybeSavePhraseBook(PhraseBook *pb)
return true;
}
-bool MainWindow::closePhraseBooks()
+bool MainWindow::maybeSavePhraseBooks()
{
foreach(PhraseBook *phraseBook, m_phraseBooks)
if (!maybeSavePhraseBook(phraseBook))
diff --git a/tools/linguist/linguist/mainwindow.h b/tools/linguist/linguist/mainwindow.h
index c589945f6d..7a81ff6302 100644
--- a/tools/linguist/linguist/mainwindow.h
+++ b/tools/linguist/linguist/mainwindow.h
@@ -192,7 +192,7 @@ private:
bool isPhraseBookOpen(const QString &name);
bool savePhraseBook(QString *name, PhraseBook &pb);
bool maybeSavePhraseBook(PhraseBook *phraseBook);
- bool closePhraseBooks();
+ bool maybeSavePhraseBooks();
QStringList pickTranslationFiles();
void showTranslationSettings(int model);
void updateLatestModel(int model);
diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp
index 9eea2a3bae..5cbc5e8ed0 100644
--- a/tools/linguist/linguist/messagemodel.cpp
+++ b/tools/linguist/linguist/messagemodel.cpp
@@ -375,7 +375,7 @@ bool DataModel::release(const QString &fileName, bool verbose, bool ignoreUnfini
cd.m_verbose = verbose;
cd.m_ignoreUnfinished = ignoreUnfinished;
cd.m_saveMode = mode;
- bool ok = tor.release(&file, cd);
+ bool ok = saveQM(tor, file, cd);
if (!ok)
QMessageBox::warning(parent, QObject::tr("Qt Linguist"), cd.error());
return ok;
diff --git a/tools/linguist/lrelease/lrelease.pro b/tools/linguist/lrelease/lrelease.pro
index 89694be6e6..28a741dd68 100644
--- a/tools/linguist/lrelease/lrelease.pro
+++ b/tools/linguist/lrelease/lrelease.pro
@@ -5,19 +5,9 @@ DESTDIR = ../../../bin
DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
SOURCES += main.cpp
-INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global # qlibraryinfo.cpp includes qconfig.cpp
-SOURCES += \
- $$QT_SOURCE_TREE/src/corelib/global/qlibraryinfo.cpp \
- $$QT_SOURCE_TREE/src/corelib/io/qsettings.cpp
-win32:SOURCES += $$QT_SOURCE_TREE/src/corelib/io/qsettings_win.cpp
-macx:SOURCES += $$QT_SOURCE_TREE/src/corelib/io/qsettings_mac.cpp
-
include(../../../src/tools/bootstrap/bootstrap.pri)
include(../shared/formats.pri)
include(../shared/proparser.pri)
-include(../../shared/symbian/epocroot.pri)
-
-win32:LIBS += -ladvapi32 # for qsettings_win.cpp
target.path=$$[QT_INSTALL_BINS]
INSTALLS += target
diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp
index 72d5d48388..1fa1474acd 100644
--- a/tools/linguist/lrelease/main.cpp
+++ b/tools/linguist/lrelease/main.cpp
@@ -40,7 +40,9 @@
****************************************************************************/
#include "translator.h"
-#include "profileevaluator.h"
+
+#include <profileparser.h>
+#include <profileevaluator.h>
#ifndef QT_BOOTSTRAPPED
#include <QtCore/QCoreApplication>
@@ -55,11 +57,11 @@
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
-#include <iostream>
-
QT_USE_NAMESPACE
#ifdef QT_BOOTSTRAPPED
+static QString binDir;
+
static void initBinaryDir(
#ifndef Q_OS_WIN
const char *argv0
@@ -84,6 +86,12 @@ static void printOut(const QString & out)
stream << out;
}
+static void printErr(const QString & out)
+{
+ QTextStream stream(stderr);
+ stream << out;
+}
+
static void printUsage()
{
printOut(LR::tr(
@@ -119,7 +127,7 @@ static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbo
ConversionData cd;
bool ok = tor.load(tsFileName, cd, QLatin1String("auto"));
if (!ok) {
- std::cerr << qPrintable(LR::tr("lrelease error: %1").arg(cd.error()));
+ printErr(LR::tr("lrelease error: %1").arg(cd.error()));
} else {
if (!cd.errors().isEmpty())
printOut(cd.error());
@@ -143,17 +151,17 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName,
QFile file(qmFileName);
if (!file.open(QIODevice::WriteOnly)) {
- std::cerr << qPrintable(LR::tr("lrelease error: cannot create '%1': %2\n")
+ printErr(LR::tr("lrelease error: cannot create '%1': %2\n")
.arg(qmFileName, file.errorString()));
return false;
}
tor.normalizeTranslations(cd);
- bool ok = tor.release(&file, cd);
+ bool ok = saveQM(tor, file, cd);
file.close();
if (!ok) {
- std::cerr << qPrintable(LR::tr("lrelease error: cannot save '%1': %2")
+ printErr(LR::tr("lrelease error: cannot save '%1': %2")
.arg(qmFileName, cd.error()));
} else if (!cd.errors().isEmpty()) {
printOut(cd.error());
@@ -181,6 +189,40 @@ static bool releaseTsFile(const QString& tsFileName,
return releaseTranslator(tor, qmFileName, cd, removeIdentical);
}
+static void print(const QString &fileName, int lineNo, const QString &msg)
+{
+ if (lineNo)
+ printErr(QString::fromLatin1("%2(%1): %3").arg(lineNo).arg(fileName, msg));
+ else
+ printErr(msg);
+}
+
+class ParseHandler : public ProFileParserHandler {
+public:
+ virtual void parseError(const QString &fileName, int lineNo, const QString &msg)
+ { if (verbose) print(fileName, lineNo, msg); }
+
+ bool verbose;
+};
+
+class EvalHandler : public ProFileEvaluatorHandler {
+public:
+ virtual void configError(const QString &msg)
+ { printErr(msg); }
+ virtual void evalError(const QString &fileName, int lineNo, const QString &msg)
+ { if (verbose) print(fileName, lineNo, msg); }
+ virtual void fileMessage(const QString &msg)
+ { printErr(msg); }
+
+ virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
+ virtual void doneWithEval(ProFile *) {}
+
+ bool verbose;
+};
+
+static ParseHandler parseHandler;
+static EvalHandler evalHandler;
+
int main(int argc, char **argv)
{
#ifdef QT_BOOTSTRAPPED
@@ -268,27 +310,36 @@ int main(int argc, char **argv)
if (inputFile.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive)
|| inputFile.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) {
QFileInfo fi(inputFile);
- ProFile pro(fi.absoluteFilePath());
- ProFileEvaluator visitor;
- visitor.setVerbose(cd.isVerbose());
+ parseHandler.verbose = evalHandler.verbose = cd.isVerbose();
+ ProFileOption option;
+#ifdef QT_BOOTSTRAPPED
+ option.initProperties(binDir + QLatin1String("/qmake"));
+#else
+ option.initProperties(app.applicationDirPath() + QLatin1String("/qmake"));
+#endif
+ ProFileParser parser(0, &parseHandler);
+ ProFileEvaluator visitor(&option, &parser, &evalHandler);
- if (!visitor.queryProFile(&pro)) {
- std::cerr << qPrintable(LR::tr(
+ ProFile *pro;
+ if (!(pro = parser.parsedProFile(QDir::cleanPath(fi.absoluteFilePath())))) {
+ printErr(LR::tr(
"lrelease error: cannot read project file '%1'.\n")
.arg(inputFile));
continue;
}
- if (!visitor.accept(&pro)) {
- std::cerr << qPrintable(LR::tr(
+ if (!visitor.accept(pro)) {
+ printErr(LR::tr(
"lrelease error: cannot process project file '%1'.\n")
.arg(inputFile));
+ pro->deref();
continue;
}
+ pro->deref();
QStringList translations = visitor.values(QLatin1String("TRANSLATIONS"));
if (translations.isEmpty()) {
- std::cerr << qPrintable(LR::tr(
+ printErr(LR::tr(
"lrelease warning: Met no 'TRANSLATIONS' entry in project file '%1'\n")
.arg(inputFile));
} else {
@@ -320,8 +371,6 @@ int main(int argc, char **argv)
# include <windows.h>
#endif
-static QString binDir;
-
static void initBinaryDir(
#ifndef Q_OS_WIN
const char *_argv0
@@ -376,16 +425,4 @@ static void initBinaryDir(
#endif
}
-QT_BEGIN_NAMESPACE
-
-// The name is hard-coded in QLibraryInfo
-QString qmake_libraryInfoFile()
-{
- if (binDir.isEmpty())
- return QString();
- return QDir(binDir).filePath(QString::fromLatin1("qt.conf"));
-}
-
-QT_END_NAMESPACE
-
#endif // QT_BOOTSTRAPPED
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp
index 737bfd0ee4..34bb792928 100644
--- a/tools/linguist/lupdate/main.cpp
+++ b/tools/linguist/lupdate/main.cpp
@@ -42,6 +42,7 @@
#include "lupdate.h"
#include <translator.h>
+#include <profileparser.h>
#include <profileevaluator.h>
#include <QtCore/QCoreApplication>
@@ -227,6 +228,40 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil
}
}
+static void print(const QString &fileName, int lineNo, const QString &msg)
+{
+ if (lineNo)
+ printErr(QString::fromLatin1("%2(%1): %3").arg(lineNo).arg(fileName, msg));
+ else
+ printErr(msg);
+}
+
+class ParseHandler : public ProFileParserHandler {
+public:
+ virtual void parseError(const QString &fileName, int lineNo, const QString &msg)
+ { if (verbose) print(fileName, lineNo, msg); }
+
+ bool verbose;
+};
+
+class EvalHandler : public ProFileEvaluatorHandler {
+public:
+ virtual void configError(const QString &msg)
+ { printErr(msg); }
+ virtual void evalError(const QString &fileName, int lineNo, const QString &msg)
+ { if (verbose) print(fileName, lineNo, msg); }
+ virtual void fileMessage(const QString &msg)
+ { printErr(msg); }
+
+ virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
+ virtual void doneWithEval(ProFile *) {}
+
+ bool verbose;
+};
+
+static ParseHandler parseHandler;
+static EvalHandler evalHandler;
+
static QStringList getSources(const char *var, const char *vvar, const QStringList &baseVPaths,
const QString &projectDir, const ProFileEvaluator &visitor)
{
@@ -288,12 +323,14 @@ static void processSources(Translator &fetchedTor,
static void processProjects(
bool topLevel, bool nestComplain, const QStringList &proFiles,
+ ProFileOption *option, ProFileParser *parser,
UpdateOptions options, const QByteArray &codecForSource,
const QString &targetLanguage, const QString &sourceLanguage,
Translator *parentTor, bool *fail);
static void processProject(
- bool nestComplain, const QFileInfo &pfi, ProFileEvaluator &visitor,
+ bool nestComplain, const QFileInfo &pfi,
+ ProFileOption *option, ProFileParser *parser, ProFileEvaluator &visitor,
UpdateOptions options, const QByteArray &_codecForSource,
const QString &targetLanguage, const QString &sourceLanguage,
Translator *fetchedTor, bool *fail)
@@ -321,7 +358,7 @@ static void processProject(
else
subProFiles << subPro;
}
- processProjects(false, nestComplain, subProFiles, options, codecForSource,
+ processProjects(false, nestComplain, subProFiles, option, parser, options, codecForSource,
targetLanguage, sourceLanguage, fetchedTor, fail);
} else {
ConversionData cd;
@@ -347,23 +384,25 @@ static void processProject(
static void processProjects(
bool topLevel, bool nestComplain, const QStringList &proFiles,
+ ProFileOption *option, ProFileParser *parser,
UpdateOptions options, const QByteArray &codecForSource,
const QString &targetLanguage, const QString &sourceLanguage,
Translator *parentTor, bool *fail)
{
foreach (const QString &proFile, proFiles) {
- ProFileEvaluator visitor;
- visitor.setVerbose(options & Verbose);
-
- QHash<QString, QStringList> lupdateConfig;
- lupdateConfig.insert(QLatin1String("CONFIG"), QStringList(QLatin1String("lupdate_run")));
- visitor.addVariables(lupdateConfig);
-
QFileInfo pfi(proFile);
- ProFile pro(pfi.absoluteFilePath());
- if (!visitor.queryProFile(&pro) || !visitor.accept(&pro)) {
+
+ ProFileEvaluator visitor(option, parser, &evalHandler);
+ ProFile *pro;
+ if (!(pro = parser->parsedProFile(QDir::cleanPath(pfi.absoluteFilePath())))) {
+ if (topLevel)
+ *fail = true;
+ continue;
+ }
+ if (!visitor.accept(pro)) {
if (topLevel)
*fail = true;
+ pro->deref();
continue;
}
@@ -376,6 +415,7 @@ static void processProjects(
} else if (nestComplain) {
printErr(LU::tr("lupdate warning: TS files from command line "
"prevent recursing into %1.\n").arg(proFile));
+ pro->deref();
continue;
}
}
@@ -387,6 +427,7 @@ static void processProjects(
// This might mean either a buggy PRO file or an intentional detach -
// we can't know without seeing the actual RHS of the assignment ...
// Just assume correctness and be silent.
+ pro->deref();
continue;
}
Translator tor;
@@ -398,9 +439,10 @@ static void processProjects(
tor.setCodecName(tmp.last().toLatin1());
setCodec = true;
}
- processProject(false, pfi, visitor, options, codecForSource,
+ processProject(false, pfi, option, parser, visitor, options, codecForSource,
targetLanguage, sourceLanguage, &tor, fail);
updateTsFiles(tor, tsFiles, setCodec, sourceLanguage, targetLanguage, options, fail);
+ pro->deref();
continue;
}
noTrans:
@@ -409,12 +451,13 @@ static void processProjects(
printErr(LU::tr("lupdate warning: no TS files specified. Only diagnostics "
"will be produced for '%1'.\n").arg(proFile));
Translator tor;
- processProject(nestComplain, pfi, visitor, options, codecForSource,
+ processProject(nestComplain, pfi, option, parser, visitor, options, codecForSource,
targetLanguage, sourceLanguage, &tor, fail);
} else {
- processProject(nestComplain, pfi, visitor, options, codecForSource,
+ processProject(nestComplain, pfi, option, parser, visitor, options, codecForSource,
targetLanguage, sourceLanguage, parentTor, fail);
}
+ pro->deref();
}
}
@@ -714,15 +757,22 @@ int main(int argc, char **argv)
" Both project and source files / include paths specified.\n"));
return 1;
}
+
+ parseHandler.verbose = evalHandler.verbose = !!(options & Verbose);
+ ProFileOption option;
+ option.initProperties(app.applicationDirPath() + QLatin1String("/qmake"));
+ option.setCommandLineArguments(QStringList() << QLatin1String("CONFIG+=lupdate_run"));
+ ProFileParser parser(0, &parseHandler);
+
if (!tsFileNames.isEmpty()) {
Translator fetchedTor;
fetchedTor.setCodecName(codecForTr);
- processProjects(true, true, proFiles, options, QByteArray(),
+ processProjects(true, true, proFiles, &option, &parser, options, QByteArray(),
targetLanguage, sourceLanguage, &fetchedTor, &fail);
updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(),
sourceLanguage, targetLanguage, options, &fail);
} else {
- processProjects(true, false, proFiles, options, QByteArray(),
+ processProjects(true, false, proFiles, &option, &parser, options, QByteArray(),
targetLanguage, sourceLanguage, 0, &fail);
}
}
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index 2d5230b898..8b6624dcce 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -348,11 +348,11 @@ Translator merge(const Translator &tor, const Translator &virginTor,
if (m.sourceText().isEmpty() && m.id().isEmpty()) {
// context/file comment
- TranslatorMessage mv = virginTor.find(m.context());
- if (!mv.isNull())
- m.setComment(mv.comment());
+ int mvi = virginTor.find(m.context());
+ if (mvi >= 0)
+ m.setComment(virginTor.constMessage(mvi).comment());
} else {
- TranslatorMessage mv;
+ const TranslatorMessage *mv;
int mvi = virginTor.find(m);
if (mvi < 0) {
if (!(options & HeuristicSimilarText)) {
@@ -362,16 +362,17 @@ Translator merge(const Translator &tor, const Translator &virginTor,
obsoleted++;
m.clearReferences();
} else {
- mv = virginTor.find(m.context(), m.comment(), m.allReferences());
- if (mv.isNull()) {
+ mvi = virginTor.find(m.context(), m.comment(), m.allReferences());
+ if (mvi < 0) {
// did not find it in the virgin, mark it as obsolete
goto makeObsolete;
} else {
+ mv = &virginTor.constMessage(mvi);
// Do not just accept it if its on the same line number,
// but different source text.
// Also check if the texts are more or less similar before
// we consider them to represent the same message...
- if (getSimilarityScore(m.sourceText(), mv.sourceText()) >= textSimilarityThreshold) {
+ if (getSimilarityScore(m.sourceText(), mv->sourceText()) >= textSimilarityThreshold) {
// It is just slightly modified, assume that it is the same string
// Mark it as unfinished. (Since the source text
@@ -382,7 +383,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
outdateSource:
m.setOldSourceText(m.sourceText());
- m.setSourceText(mv.sourceText());
+ m.setSourceText(mv->sourceText());
const QString &oldpluralsource = m.extra(QLatin1String("po-msgid_plural"));
if (!oldpluralsource.isEmpty()) {
m.setExtra(QLatin1String("po-old_msgid_plural"), oldpluralsource);
@@ -397,22 +398,22 @@ Translator merge(const Translator &tor, const Translator &virginTor,
}
}
} else {
- mv = virginTor.message(mvi);
- if (!mv.id().isEmpty()
- && (mv.context() != m.context()
- || mv.sourceText() != m.sourceText()
- || mv.comment() != m.comment())) {
+ mv = &virginTor.message(mvi);
+ if (!mv->id().isEmpty()
+ && (mv->context() != m.context()
+ || mv->sourceText() != m.sourceText()
+ || mv->comment() != m.comment())) {
known++;
newType = TranslatorMessage::Unfinished;
- m.setContext(mv.context());
- m.setComment(mv.comment());
- if (mv.sourceText() != m.sourceText())
+ m.setContext(mv->context());
+ m.setComment(mv->comment());
+ if (mv->sourceText() != m.sourceText())
goto outdateSource;
} else {
switch (m.type()) {
case TranslatorMessage::Finished:
default:
- if (m.isPlural() == mv.isPlural()) {
+ if (m.isPlural() == mv->isPlural()) {
newType = TranslatorMessage::Finished;
} else {
newType = TranslatorMessage::Unfinished;
@@ -435,11 +436,11 @@ Translator merge(const Translator &tor, const Translator &virginTor,
// have the <location> element.
// why not use operator=()? Because it overwrites e.g. userData.
copyAttribs:
- m.setReferences(mv.allReferences());
- m.setPlural(mv.isPlural());
- m.setUtf8(mv.isUtf8());
- m.setExtraComment(mv.extraComment());
- m.setId(mv.id());
+ m.setReferences(mv->allReferences());
+ m.setPlural(mv->isPlural());
+ m.setUtf8(mv->isUtf8());
+ m.setExtraComment(mv->extraComment());
+ m.setId(mv->id());
}
}
@@ -453,15 +454,16 @@ Translator merge(const Translator &tor, const Translator &virginTor,
*/
foreach (const TranslatorMessage &mv, virginTor.messages()) {
if (mv.sourceText().isEmpty() && mv.id().isEmpty()) {
- if (tor.contains(mv.context()))
+ if (tor.find(mv.context()) >= 0)
continue;
} else {
if (tor.find(mv) >= 0)
continue;
if (options & HeuristicSimilarText) {
- TranslatorMessage m = tor.find(mv.context(), mv.comment(), mv.allReferences());
- if (!m.isNull()) {
- if (getSimilarityScore(m.sourceText(), mv.sourceText()) >= textSimilarityThreshold)
+ int mi = tor.find(mv.context(), mv.comment(), mv.allReferences());
+ if (mi >= 0) {
+ if (getSimilarityScore(tor.constMessage(mi).sourceText(), mv.sourceText())
+ >= textSimilarityThreshold)
continue;
}
}
diff --git a/tools/linguist/phrasebooks/japanese.qph b/tools/linguist/phrasebooks/japanese.qph
index 3ecd9e332c..b04e525634 100644
--- a/tools/linguist/phrasebooks/japanese.qph
+++ b/tools/linguist/phrasebooks/japanese.qph
@@ -1,4 +1,5 @@
-<!DOCTYPE QPH><QPH language="ja">
+<!DOCTYPE QPH>
+<QPH language="ja">
<phrase>
<source>About</source>
<target>について</target>
@@ -1018,4 +1019,16 @@
<source>Yes</source>
<target>はい</target>
</phrase>
+<phrase>
+ <source>&amp;Next</source>
+ <target>次を検索(&amp;N)</target>
+</phrase>
+<phrase>
+ <source>List View</source>
+ <target>一覧表示</target>
+</phrase>
+<phrase>
+ <source>&amp;Run</source>
+ <target>実行(&amp;R)</target>
+</phrase>
</QPH>
diff --git a/tools/linguist/shared/abstractproitemvisitor.h b/tools/linguist/shared/abstractproitemvisitor.h
deleted file mode 100644
index 73614c5777..0000000000
--- a/tools/linguist/shared/abstractproitemvisitor.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Linguist of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef ABSTRACTPROITEMVISITOR
-#define ABSTRACTPROITEMVISITOR
-
-#include "proitems.h"
-
-QT_BEGIN_NAMESPACE
-
-struct AbstractProItemVisitor
-{
- virtual ~AbstractProItemVisitor() {}
-
- virtual ProItem::ProItemReturn visitBeginProBlock(ProBlock *block) = 0;
- virtual void visitEndProBlock(ProBlock *block) = 0;
-
- virtual ProItem::ProItemReturn visitProLoopIteration() = 0;
- virtual void visitProLoopCleanup() = 0;
-
- virtual void visitBeginProVariable(ProVariable *variable) = 0;
- virtual void visitEndProVariable(ProVariable *variable) = 0;
-
- virtual ProItem::ProItemReturn visitBeginProFile(ProFile *value) = 0;
- virtual ProItem::ProItemReturn visitEndProFile(ProFile *value) = 0;
-
- virtual void visitProValue(ProValue *value) = 0;
- virtual ProItem::ProItemReturn visitProFunction(ProFunction *function) = 0;
- virtual void visitProOperator(ProOperator *function) = 0;
- virtual void visitProCondition(ProCondition *function) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // ABSTRACTPROITEMVISITOR
-
diff --git a/tools/linguist/shared/ioutils.cpp b/tools/linguist/shared/ioutils.cpp
new file mode 100644
index 0000000000..9658cf6b4f
--- /dev/null
+++ b/tools/linguist/shared/ioutils.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "ioutils.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QFile>
+
+#ifdef Q_OS_WIN
+# include <windows.h>
+#else
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <unistd.h>
+#endif
+
+using namespace ProFileEvaluatorInternal;
+
+IoUtils::FileType IoUtils::fileType(const QString &fileName)
+{
+ Q_ASSERT(fileName.isEmpty() || isAbsolutePath(fileName));
+#ifdef Q_OS_WIN
+ DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());
+ if (attr == INVALID_FILE_ATTRIBUTES)
+ return FileNotFound;
+ return (attr & FILE_ATTRIBUTE_DIRECTORY) ? FileIsDir : FileIsRegular;
+#else
+ struct ::stat st;
+ if (::stat(fileName.toLocal8Bit().constData(), &st))
+ return FileNotFound;
+ return S_ISDIR(st.st_mode) ? FileIsDir : FileIsRegular;
+#endif
+}
+
+bool IoUtils::isRelativePath(const QString &path)
+{
+ if (path.startsWith(QLatin1Char('/')))
+ return false;
+#ifdef Q_OS_WIN
+ if (path.startsWith(QLatin1Char('\\')))
+ return false;
+ // Unlike QFileInfo, this won't accept a relative path with a drive letter.
+ // Such paths result in a royal mess anyway ...
+ if (path.length() >= 3 && path.at(1) == QLatin1Char(':') && path.at(0).isLetter()
+ && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\')))
+ return false;
+#endif
+ return true;
+}
+
+QStringRef IoUtils::fileName(const QString &fileName)
+{
+ return fileName.midRef(fileName.lastIndexOf(QLatin1Char('/')) + 1);
+}
+
+QString IoUtils::resolvePath(const QString &baseDir, const QString &fileName)
+{
+ if (fileName.isEmpty())
+ return QString();
+ if (isAbsolutePath(fileName))
+ return QDir::cleanPath(fileName);
+ return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName);
+}
+
+#ifdef QT_BOOTSTRAPPED
+inline static bool isSpecialChar(ushort c)
+{
+ // Chars that should be quoted (TM). This includes:
+#ifdef Q_OS_WIN
+ // - control chars & space
+ // - the shell meta chars "&()<>^|
+ // - the potential separators ,;=
+ static const uchar iqm[] = {
+ 0xff, 0xff, 0xff, 0xff, 0x45, 0x13, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10
+ };
+#else
+ static const uchar iqm[] = {
+ 0xff, 0xff, 0xff, 0xff, 0xdf, 0x07, 0x00, 0xd8,
+ 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78
+ }; // 0-32 \'"$`<>|;&(){}*?#!~[]
+#endif
+
+ return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7)));
+}
+
+inline static bool hasSpecialChars(const QString &arg)
+{
+ for (int x = arg.length() - 1; x >= 0; --x)
+ if (isSpecialChar(arg.unicode()[x].unicode()))
+ return true;
+ return false;
+}
+
+QString IoUtils::shellQuote(const QString &arg)
+{
+ if (!arg.length())
+ return QString::fromLatin1("\"\"");
+
+ QString ret(arg);
+ if (hasSpecialChars(ret)) {
+#ifdef Q_OS_WIN
+ // Quotes are escaped and their preceding backslashes are doubled.
+ // It's impossible to escape anything inside a quoted string on cmd
+ // level, so the outer quoting must be "suspended".
+ ret.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\"\\1\\1\\^\"\""));
+ // The argument must not end with a \ since this would be interpreted
+ // as escaping the quote -- rather put the \ behind the quote: e.g.
+ // rather use "foo"\ than "foo\"
+ int i = ret.length();
+ while (i > 0 && ret.at(i - 1) == QLatin1Char('\\'))
+ --i;
+ ret.insert(i, QLatin1Char('"'));
+ ret.prepend(QLatin1Char('"'));
+#else // Q_OS_WIN
+ ret.replace(QLatin1Char('\''), QLatin1String("'\\''"));
+ ret.prepend(QLatin1Char('\''));
+ ret.append(QLatin1Char('\''));
+#endif // Q_OS_WIN
+ }
+ return ret;
+}
+#endif
diff --git a/tools/linguist/shared/ioutils.h b/tools/linguist/shared/ioutils.h
new file mode 100644
index 0000000000..e013aefc6c
--- /dev/null
+++ b/tools/linguist/shared/ioutils.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef IOUTILS_H
+#define IOUTILS_H
+
+#include <QtCore/QString>
+
+namespace ProFileEvaluatorInternal {
+
+/*!
+ This class provides replacement functionality for QFileInfo, QFile & QDir,
+ as these are abysmally slow.
+*/
+class IoUtils {
+public:
+ enum FileType {
+ FileNotFound = 0,
+ FileIsRegular = 1,
+ FileIsDir = 2
+ };
+
+ static FileType fileType(const QString &fileName);
+ static bool exists(const QString &fileName) { return fileType(fileName) != FileNotFound; }
+ static bool isRelativePath(const QString &fileName);
+ static bool isAbsolutePath(const QString &fileName) { return !isRelativePath(fileName); }
+ static QStringRef fileName(const QString &fileName); // Requires normalized path
+ static QString resolvePath(const QString &baseDir, const QString &fileName);
+#ifdef QT_BOOTSTRAPPED
+ static QString shellQuote(const QString &arg);
+#endif
+};
+
+}
+
+#endif // IOUTILS_H
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index 03937686c5..0539efa4b0 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -40,8 +40,9 @@
****************************************************************************/
#include "profileevaluator.h"
-#include "proparserutils.h"
-#include "proitems.h"
+
+#include "profileparser.h"
+#include "ioutils.h"
#include <QtCore/QByteArray>
#include <QtCore/QDateTime>
@@ -56,6 +57,9 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
+#ifdef PROEVALUATOR_THREAD_SAFE
+# include <QtCore/QThreadPool>
+#endif
#ifdef Q_OS_UNIX
#include <unistd.h>
@@ -74,966 +78,1482 @@
#define QT_PCLOSE pclose
#endif
+using namespace ProFileEvaluatorInternal;
+
QT_BEGIN_NAMESPACE
+using namespace ProStringConstants;
+
+
+#define fL1S(s) QString::fromLatin1(s)
+
///////////////////////////////////////////////////////////////////////
//
-// Option
+// ProFileOption
//
///////////////////////////////////////////////////////////////////////
-QString
-Option::fixString(QString string, uchar flags)
+ProFileOption::ProFileOption()
{
- // XXX Ripped out caching, so this will be slow. Should not matter for current uses.
+#ifdef Q_OS_WIN
+ dirlist_sep = QLatin1Char(';');
+ dir_sep = QLatin1Char('\\');
+#else
+ dirlist_sep = QLatin1Char(':');
+ dir_sep = QLatin1Char('/');
+#endif
+ qmakespec = getEnv(QLatin1String("QMAKESPEC"));
- //fix the environment variables
- if (flags & Option::FixEnvVars) {
- int rep;
- QRegExp reg_variableName(QLatin1String("\\$\\(.*\\)"));
- reg_variableName.setMinimal(true);
- while ((rep = reg_variableName.indexIn(string)) != -1)
- string.replace(rep, reg_variableName.matchedLength(),
- QString::fromLocal8Bit(qgetenv(string.mid(rep + 2, reg_variableName.matchedLength() - 3).toLatin1().constData()).constData()));
- }
+ host_mode = HOST_UNKNOWN_MODE;
+ target_mode = TARG_UNKNOWN_MODE;
- //canonicalize it (and treat as a path)
- if (flags & Option::FixPathCanonicalize) {
-#if 0
- string = QFileInfo(string).canonicalFilePath();
+#ifdef PROEVALUATOR_THREAD_SAFE
+ base_inProgress = false;
#endif
- string = QDir::cleanPath(string);
- }
+}
- if (string.length() > 2 && string[0].isLetter() && string[1] == QLatin1Char(':'))
- string[0] = string[0].toLower();
+ProFileOption::~ProFileOption()
+{
+}
- //fix separators
- Q_ASSERT(!((flags & Option::FixPathToLocalSeparators) && (flags & Option::FixPathToTargetSeparators)));
- if (flags & Option::FixPathToLocalSeparators) {
-#if defined(Q_OS_WIN32)
- string = string.replace(QLatin1Char('/'), QLatin1Char('\\'));
-#else
- string = string.replace(QLatin1Char('\\'), QLatin1Char('/'));
-#endif
- } else if (flags & Option::FixPathToTargetSeparators) {
- string = string.replace(QLatin1Char('/'), Option::dir_sep)
- .replace(QLatin1Char('\\'), Option::dir_sep);
+void ProFileOption::setCommandLineArguments(const QStringList &args)
+{
+ QStringList _precmds, _preconfigs, _postcmds, _postconfigs;
+ bool after = false;
+
+ bool isConf = false;
+ foreach (const QString &arg, args) {
+ if (isConf) {
+ isConf = false;
+ if (after)
+ _postconfigs << arg;
+ else
+ _preconfigs << arg;
+ } else if (arg.startsWith(QLatin1Char('-'))) {
+ if (arg == QLatin1String("-after")) {
+ after = true;
+ } else if (arg == QLatin1String("-config")) {
+ isConf = true;
+ } else if (arg == QLatin1String("-win32")) {
+ host_mode = HOST_WIN_MODE;
+ target_mode = TARG_WIN_MODE;
+ } else if (arg == QLatin1String("-unix")) {
+ host_mode = HOST_UNIX_MODE;
+ target_mode = TARG_UNIX_MODE;
+ } else if (arg == QLatin1String("-macx")) {
+ host_mode = HOST_MACX_MODE;
+ target_mode = TARG_MACX_MODE;
+ }
+ } else if (arg.contains(QLatin1Char('='))) {
+ if (after)
+ _postcmds << arg;
+ else
+ _precmds << arg;
+ }
}
- if ((string.startsWith(QLatin1Char('"')) && string.endsWith(QLatin1Char('"'))) ||
- (string.startsWith(QLatin1Char('\'')) && string.endsWith(QLatin1Char('\''))))
- string = string.mid(1, string.length() - 2);
+ if (!_preconfigs.isEmpty())
+ _precmds << (fL1S("CONFIG += ") + _preconfigs.join(fL1S(" ")));
+ precmds = _precmds.join(fL1S("\n"));
+ if (!_postconfigs.isEmpty())
+ _postcmds << (fL1S("CONFIG += ") + _postconfigs.join(fL1S(" ")));
+ postcmds = _postcmds.join(fL1S("\n"));
- return string;
+ if (host_mode != HOST_UNKNOWN_MODE)
+ applyHostMode();
}
+void ProFileOption::applyHostMode()
+{
+ if (host_mode == HOST_WIN_MODE) {
+ dir_sep = fL1S("\\");
+ } else {
+ dir_sep = fL1S("/");
+ }
+}
+
+QString ProFileOption::getEnv(const QString &var) const
+{
+#ifndef QT_BOOTSTRAPPED
+ if (!environment.isEmpty())
+ return environment.value(var);
+#endif
+ return QString::fromLocal8Bit(qgetenv(var.toLocal8Bit().constData()));
+}
+
+#ifdef PROEVALUATOR_INIT_PROPS
+bool ProFileOption::initProperties(const QString &qmake)
+{
+ QByteArray data;
+#ifndef QT_BOOTSTRAPPED
+ QProcess proc;
+ proc.start(qmake, QStringList() << QLatin1String("-query"));
+ if (!proc.waitForFinished())
+ return false;
+ data = proc.readAll();
+#else
+ if (FILE *proc = QT_POPEN(QString(IoUtils::shellQuote(qmake) + QLatin1String(" -query"))
+ .toLocal8Bit(), "r")) {
+ char buff[1024];
+ while (!feof(proc))
+ data.append(buff, int(fread(buff, 1, 1023, proc)));
+ QT_PCLOSE(proc);
+ }
+#endif
+ foreach (QByteArray line, data.split('\n'))
+ if (!line.startsWith("QMAKE_")) {
+ int off = line.indexOf(':');
+ if (off < 0) // huh?
+ continue;
+ if (line.endsWith('\r'))
+ line.chop(1);
+ properties.insert(QString::fromLatin1(line.left(off)),
+ QString::fromLocal8Bit(line.mid(off + 1)));
+ }
+ return true;
+}
+#endif
+
///////////////////////////////////////////////////////////////////////
//
// ProFileEvaluator::Private
//
///////////////////////////////////////////////////////////////////////
-class ProFileEvaluator::Private : public AbstractProItemVisitor
+class ProFileEvaluator::Private
{
public:
- Private(ProFileEvaluator *q_);
+ static void initStatics();
+ Private(ProFileEvaluator *q_, ProFileOption *option, ProFileParser *parser,
+ ProFileEvaluatorHandler *handler);
+ ~Private();
ProFileEvaluator *q;
- int m_lineNo; // Error reporting
- bool m_verbose;
-
- /////////////// Reading pro file
-
- bool read(ProFile *pro);
-
- ProBlock *currentBlock();
- void updateItem();
- bool parseLine(const QString &line);
- void insertVariable(const QString &line, int *i);
- void insertOperator(const char op);
- void insertComment(const QString &comment);
- void enterScope(bool multiLine);
- void leaveScope();
- void finalizeBlock();
-
- QStack<ProBlock *> m_blockstack;
- ProBlock *m_block;
-
- ProItem *m_commentItem;
- QString m_proitem;
- QString m_pendingComment;
- bool m_syntaxError;
- bool m_contNextLine;
- bool m_inQuote;
- int m_parens;
-
- /////////////// Evaluating pro file contents
-
- // implementation of AbstractProItemVisitor
- ProItem::ProItemReturn visitBeginProBlock(ProBlock *block);
- void visitEndProBlock(ProBlock *block);
- ProItem::ProItemReturn visitProLoopIteration();
- void visitProLoopCleanup();
- void visitBeginProVariable(ProVariable *variable);
- void visitEndProVariable(ProVariable *variable);
- ProItem::ProItemReturn visitBeginProFile(ProFile *value);
- ProItem::ProItemReturn visitEndProFile(ProFile *value);
- void visitProValue(ProValue *value);
- ProItem::ProItemReturn visitProFunction(ProFunction *function);
- void visitProOperator(ProOperator *oper);
- void visitProCondition(ProCondition *condition);
-
- QStringList valuesDirect(const QString &variableName) const { return m_valuemap[variableName]; }
- QStringList values(const QString &variableName) const;
- QStringList values(const QString &variableName, const ProFile *pro) const;
- QStringList values(const QString &variableName, const QHash<QString, QStringList> &place,
- const ProFile *pro) const;
- QString propertyValue(const QString &val) const;
+ enum VisitReturn {
+ ReturnFalse,
+ ReturnTrue,
+ ReturnBreak,
+ ReturnNext,
+ ReturnReturn
+ };
+
+ static ALWAYS_INLINE uint getBlockLen(const ushort *&tokPtr);
+ ProString getStr(const ushort *&tokPtr);
+ ProString getHashStr(const ushort *&tokPtr);
+ void evaluateExpression(const ushort *&tokPtr, ProStringList *ret, bool joined);
+ static ALWAYS_INLINE void skipStr(const ushort *&tokPtr);
+ static ALWAYS_INLINE void skipHashStr(const ushort *&tokPtr);
+ void skipExpression(const ushort *&tokPtr);
+
+ void visitCmdLine(const QString &cmds);
+ VisitReturn visitProFile(ProFile *pro, ProFileEvaluatorHandler::EvalFileType type,
+ ProFileEvaluator::LoadFlags flags);
+ VisitReturn visitProBlock(ProFile *pro, const ushort *tokPtr);
+ VisitReturn visitProBlock(const ushort *tokPtr);
+ VisitReturn visitProLoop(const ProString &variable, const ushort *exprPtr,
+ const ushort *tokPtr);
+ void visitProFunctionDef(ushort tok, const ProString &name, const ushort *tokPtr);
+ void visitProVariable(ushort tok, const ProStringList &curr, const ushort *&tokPtr);
+
+ static inline const ProString &map(const ProString &var);
+ QHash<ProString, ProStringList> *findValues(const ProString &variableName,
+ QHash<ProString, ProStringList>::Iterator *it);
+ ProStringList &valuesRef(const ProString &variableName);
+ ProStringList valuesDirect(const ProString &variableName) const;
+ ProStringList values(const ProString &variableName) const;
+ QString propertyValue(const QString &val, bool complain) const;
+
+ ProStringList split_value_list(const QString &vals, const ProFile *source = 0);
bool isActiveConfig(const QString &config, bool regex = false);
- QStringList expandVariableReferences(const QString &value);
- void doVariableReplace(QString *str);
- QStringList evaluateExpandFunction(const QString &function, const QString &arguments);
- QString format(const char *format) const;
+ ProStringList expandVariableReferences(const ProString &value, int *pos = 0, bool joined = false);
+ ProStringList expandVariableReferences(const ushort *&tokPtr, int sizeHint = 0, bool joined = false);
+ ProStringList evaluateExpandFunction(const ProString &function, const ProString &arguments);
+ ProStringList evaluateExpandFunction(const ProString &function, const ushort *&tokPtr);
+ ProStringList evaluateExpandFunction(const ProString &function, const ProStringList &args);
+ void evalError(const QString &msg) const;
QString currentFileName() const;
QString currentDirectory() const;
ProFile *currentProFile() const;
-
- ProItem::ProItemReturn evaluateConditionalFunction(const QString &function, const QString &arguments);
- bool evaluateFile(const QString &fileName);
+ QString resolvePath(const QString &fileName) const
+ { return IoUtils::resolvePath(currentDirectory(), fileName); }
+
+ VisitReturn evaluateConditionalFunction(const ProString &function, const ProString &arguments);
+ VisitReturn evaluateConditionalFunction(const ProString &function, const ushort *&tokPtr);
+ VisitReturn evaluateConditionalFunction(const ProString &function, const ProStringList &args);
+ bool evaluateFileDirect(const QString &fileName, ProFileEvaluatorHandler::EvalFileType type,
+ ProFileEvaluator::LoadFlags flags);
+ bool evaluateFile(const QString &fileName, ProFileEvaluatorHandler::EvalFileType type,
+ ProFileEvaluator::LoadFlags flags);
bool evaluateFeatureFile(const QString &fileName);
+ enum EvalIntoMode { EvalProOnly, EvalWithDefaults, EvalWithSetup };
+ bool evaluateFileInto(const QString &fileName, ProFileEvaluatorHandler::EvalFileType type,
+ QHash<ProString, ProStringList> *values, FunctionDefs *defs,
+ EvalIntoMode mode); // values are output-only, defs are input-only
+
+ static ALWAYS_INLINE VisitReturn returnBool(bool b)
+ { return b ? ReturnTrue : ReturnFalse; }
+
+ QList<ProStringList> prepareFunctionArgs(const ushort *&tokPtr);
+ QList<ProStringList> prepareFunctionArgs(const ProString &arguments);
+ ProStringList evaluateFunction(const FunctionDef &func, const QList<ProStringList> &argumentsList, bool *ok);
+ VisitReturn evaluateBoolFunction(const FunctionDef &func, const QList<ProStringList> &argumentsList,
+ const ProString &function);
+
+ bool modesForGenerator(const QString &gen,
+ ProFileOption::HOST_MODE *host_mode, ProFileOption::TARG_MODE *target_mode) const;
+ void validateModes() const;
+ QStringList qmakeMkspecPaths() const;
+ QStringList qmakeFeaturePaths() const;
+
+ QString expandEnvVars(const QString &str) const;
+ QString fixPathToLocalOS(const QString &str) const;
+ QString sysrootify(const QString &path, const QString &baseDir) const;
+
+#ifndef QT_BOOTSTRAPPED
+ void runProcess(QProcess *proc, const QString &command, QProcess::ProcessChannel chan) const;
+#endif
- static inline ProItem::ProItemReturn returnBool(bool b)
- { return b ? ProItem::ReturnTrue : ProItem::ReturnFalse; }
-
- QStringList evaluateFunction(ProBlock *funcPtr, const QStringList &argumentsList, bool *ok);
-
- QStringList qmakeFeaturePaths();
-
- struct State {
- bool condition;
- bool prevCondition;
- } m_sts;
- bool m_invertNext; // Short-lived, so not in State
int m_skipLevel;
+ int m_loopLevel; // To report unexpected break() and next()s
+#ifdef PROEVALUATOR_CUMULATIVE
bool m_cumulative;
- bool m_isFirstVariableValue;
- QString m_lastVarName;
- ProVariable::VariableOperator m_variableOperator;
- QString m_origfile;
- QString m_oldPath; // To restore the current path to the path
- QStack<ProFile*> m_profileStack; // To handle 'include(a.pri), so we can track back to 'a.pro' when finished with 'a.pri'
- struct ProLoop {
- QString variable;
- QStringList oldVarVal;
- QStringList list;
- int index;
- bool infinite;
+#else
+ enum { m_cumulative = 0 };
+#endif
+
+ struct Location {
+ Location() : pro(0), line(0) {}
+ Location(ProFile *_pro, int _line) : pro(_pro), line(_line) {}
+ ProFile *pro;
+ int line;
};
- QStack<ProLoop> m_loopStack;
- // we need the following two variables for handling
- // CONFIG = foo bar $$CONFIG
- QHash<QString, QStringList> m_tempValuemap; // used while evaluating (variable operator value1 value2 ...)
- QHash<const ProFile*, QHash<QString, QStringList> > m_tempFilevaluemap; // used while evaluating (variable operator value1 value2 ...)
+ Location m_current; // Currently evaluated location
+ QStack<Location> m_locationStack; // All execution location changes
+ QStack<ProFile *> m_profileStack; // Includes only
- QHash<QString, QStringList> m_valuemap; // VariableName must be us-ascii, the content however can be non-us-ascii.
- QHash<const ProFile*, QHash<QString, QStringList> > m_filevaluemap; // Variables per include file
- QHash<QString, QString> m_properties;
QString m_outputDir;
- bool m_definingTest;
- QString m_definingFunc;
- QHash<QString, ProBlock *> m_testFunctions;
- QHash<QString, ProBlock *> m_replaceFunctions;
- QStringList m_returnValue;
- QStack<QHash<QString, QStringList> > m_valuemapStack;
- QStack<QHash<const ProFile*, QHash<QString, QStringList> > > m_filevaluemapStack;
+ int m_listCount;
+ FunctionDefs m_functionDefs;
+ ProStringList m_returnValue;
+ QStack<QHash<ProString, ProStringList> > m_valuemapStack; // VariableName must be us-ascii, the content however can be non-us-ascii.
+ QString m_tmp1, m_tmp2, m_tmp3, m_tmp[2]; // Temporaries for efficient toQString
+
+ ProFileOption *m_option;
+ ProFileParser *m_parser;
+ ProFileEvaluatorHandler *m_handler;
+
+ enum ExpandFunc {
+ E_INVALID = 0, E_MEMBER, E_FIRST, E_LAST, E_SIZE, E_CAT, E_FROMFILE, E_EVAL, E_LIST,
+ E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
+ E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND,
+ E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE,
+ E_REPLACE
+ };
+
+ enum TestFunc {
+ T_INVALID = 0, T_REQUIRES, T_GREATERTHAN, T_LESSTHAN, T_EQUALS,
+ T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM,
+ T_RETURN, T_BREAK, T_NEXT, T_DEFINED, T_CONTAINS, T_INFILE,
+ T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_MESSAGE, T_IF
+ };
- int m_prevLineNo; // Checking whether we're assigning the same TARGET
- ProFile *m_prevProFile; // See m_prevLineNo
+ enum VarName {
+ V_LITERAL_DOLLAR, V_LITERAL_HASH, V_LITERAL_WHITESPACE,
+ V_DIRLIST_SEPARATOR, V_DIR_SEPARATOR,
+ V_OUT_PWD, V_PWD, V_IN_PWD,
+ V__FILE_, V__LINE_, V__PRO_FILE_, V__PRO_FILE_PWD_,
+ V_QMAKE_HOST_arch, V_QMAKE_HOST_name, V_QMAKE_HOST_os,
+ V_QMAKE_HOST_version, V_QMAKE_HOST_version_string,
+ V__DATE_, V__QMAKE_CACHE_
+ };
};
-Q_DECLARE_TYPEINFO(ProFileEvaluator::Private::State, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(ProFileEvaluator::Private::ProLoop, Q_MOVABLE_TYPE);
+static struct {
+ QString field_sep;
+ QString strtrue;
+ QString strfalse;
+ QString strunix;
+ QString strmacx;
+ QString strmac;
+ QString strwin32;
+ QString strsymbian;
+ ProString strCONFIG;
+ ProString strARGS;
+ QString strDot;
+ QString strDotDot;
+ QString strever;
+ QString strforever;
+ ProString strTEMPLATE;
+ ProString strQMAKE_DIR_SEP;
+ QHash<ProString, int> expands;
+ QHash<ProString, int> functions;
+ QHash<ProString, int> varList;
+ QHash<ProString, ProString> varMap;
+ QRegExp reg_variableName;
+ ProStringList fakeValue;
+} statics;
+
+void ProFileEvaluator::Private::initStatics()
+{
+ if (!statics.field_sep.isNull())
+ return;
+
+ statics.field_sep = QLatin1String(" ");
+ statics.strtrue = QLatin1String("true");
+ statics.strfalse = QLatin1String("false");
+ statics.strunix = QLatin1String("unix");
+ statics.strmacx = QLatin1String("macx");
+ statics.strmac = QLatin1String("mac");
+ statics.strwin32 = QLatin1String("win32");
+ statics.strsymbian = QLatin1String("symbian");
+ statics.strCONFIG = ProString("CONFIG");
+ statics.strARGS = ProString("ARGS");
+ statics.strDot = QLatin1String(".");
+ statics.strDotDot = QLatin1String("..");
+ statics.strever = QLatin1String("ever");
+ statics.strforever = QLatin1String("forever");
+ statics.strTEMPLATE = ProString("TEMPLATE");
+ statics.strQMAKE_DIR_SEP = ProString("QMAKE_DIR_SEP");
+
+ statics.reg_variableName.setPattern(QLatin1String("\\$\\(.*\\)"));
+ statics.reg_variableName.setMinimal(true);
+
+ statics.fakeValue.detach(); // It has to have a unique begin() value
+
+ static const struct {
+ const char * const name;
+ const ExpandFunc func;
+ } expandInits[] = {
+ { "member", E_MEMBER },
+ { "first", E_FIRST },
+ { "last", E_LAST },
+ { "size", E_SIZE },
+ { "cat", E_CAT },
+ { "fromfile", E_FROMFILE },
+ { "eval", E_EVAL },
+ { "list", E_LIST },
+ { "sprintf", E_SPRINTF },
+ { "join", E_JOIN },
+ { "split", E_SPLIT },
+ { "basename", E_BASENAME },
+ { "dirname", E_DIRNAME },
+ { "section", E_SECTION },
+ { "find", E_FIND },
+ { "system", E_SYSTEM },
+ { "unique", E_UNIQUE },
+ { "quote", E_QUOTE },
+ { "escape_expand", E_ESCAPE_EXPAND },
+ { "upper", E_UPPER },
+ { "lower", E_LOWER },
+ { "re_escape", E_RE_ESCAPE },
+ { "files", E_FILES },
+ { "prompt", E_PROMPT }, // interactive, so cannot be implemented
+ { "replace", E_REPLACE }
+ };
+ for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i)
+ statics.expands.insert(ProString(expandInits[i].name), expandInits[i].func);
+
+ static const struct {
+ const char * const name;
+ const TestFunc func;
+ } testInits[] = {
+ { "requires", T_REQUIRES },
+ { "greaterThan", T_GREATERTHAN },
+ { "lessThan", T_LESSTHAN },
+ { "equals", T_EQUALS },
+ { "isEqual", T_EQUALS },
+ { "exists", T_EXISTS },
+ { "export", T_EXPORT },
+ { "clear", T_CLEAR },
+ { "unset", T_UNSET },
+ { "eval", T_EVAL },
+ { "CONFIG", T_CONFIG },
+ { "if", T_IF },
+ { "isActiveConfig", T_CONFIG },
+ { "system", T_SYSTEM },
+ { "return", T_RETURN },
+ { "break", T_BREAK },
+ { "next", T_NEXT },
+ { "defined", T_DEFINED },
+ { "contains", T_CONTAINS },
+ { "infile", T_INFILE },
+ { "count", T_COUNT },
+ { "isEmpty", T_ISEMPTY },
+ { "load", T_LOAD },
+ { "include", T_INCLUDE },
+ { "debug", T_DEBUG },
+ { "message", T_MESSAGE },
+ { "warning", T_MESSAGE },
+ { "error", T_MESSAGE },
+ };
+ for (unsigned i = 0; i < sizeof(testInits)/sizeof(testInits[0]); ++i)
+ statics.functions.insert(ProString(testInits[i].name), testInits[i].func);
+
+ static const char * const names[] = {
+ "LITERAL_DOLLAR", "LITERAL_HASH", "LITERAL_WHITESPACE",
+ "DIRLIST_SEPARATOR", "DIR_SEPARATOR",
+ "OUT_PWD", "PWD", "IN_PWD",
+ "_FILE_", "_LINE_", "_PRO_FILE_", "_PRO_FILE_PWD_",
+ "QMAKE_HOST.arch", "QMAKE_HOST.name", "QMAKE_HOST.os",
+ "QMAKE_HOST.version", "QMAKE_HOST.version_string",
+ "_DATE_", "_QMAKE_CACHE_"
+ };
+ for (unsigned i = 0; i < sizeof(names)/sizeof(names[0]); ++i)
+ statics.varList.insert(ProString(names[i]), i);
+
+ static const struct {
+ const char * const oldname, * const newname;
+ } mapInits[] = {
+ { "INTERFACES", "FORMS" },
+ { "QMAKE_POST_BUILD", "QMAKE_POST_LINK" },
+ { "TARGETDEPS", "POST_TARGETDEPS" },
+ { "LIBPATH", "QMAKE_LIBDIR" },
+ { "QMAKE_EXT_MOC", "QMAKE_EXT_CPP_MOC" },
+ { "QMAKE_MOD_MOC", "QMAKE_H_MOD_MOC" },
+ { "QMAKE_LFLAGS_SHAPP", "QMAKE_LFLAGS_APP" },
+ { "PRECOMPH", "PRECOMPILED_HEADER" },
+ { "PRECOMPCPP", "PRECOMPILED_SOURCE" },
+ { "INCPATH", "INCLUDEPATH" },
+ { "QMAKE_EXTRA_WIN_COMPILERS", "QMAKE_EXTRA_COMPILERS" },
+ { "QMAKE_EXTRA_UNIX_COMPILERS", "QMAKE_EXTRA_COMPILERS" },
+ { "QMAKE_EXTRA_WIN_TARGETS", "QMAKE_EXTRA_TARGETS" },
+ { "QMAKE_EXTRA_UNIX_TARGETS", "QMAKE_EXTRA_TARGETS" },
+ { "QMAKE_EXTRA_UNIX_INCLUDES", "QMAKE_EXTRA_INCLUDES" },
+ { "QMAKE_EXTRA_UNIX_VARIABLES", "QMAKE_EXTRA_VARIABLES" },
+ { "QMAKE_RPATH", "QMAKE_LFLAGS_RPATH" },
+ { "QMAKE_FRAMEWORKDIR", "QMAKE_FRAMEWORKPATH" },
+ { "QMAKE_FRAMEWORKDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS" }
+ };
+ for (unsigned i = 0; i < sizeof(mapInits)/sizeof(mapInits[0]); ++i)
+ statics.varMap.insert(ProString(mapInits[i].oldname),
+ ProString(mapInits[i].newname));
+}
+
+const ProString &ProFileEvaluator::Private::map(const ProString &var)
+{
+ QHash<ProString, ProString>::ConstIterator it = statics.varMap.constFind(var);
+ return (it != statics.varMap.constEnd()) ? it.value() : var;
+}
+
-ProFileEvaluator::Private::Private(ProFileEvaluator *q_)
- : q(q_)
+ProFileEvaluator::Private::Private(ProFileEvaluator *q_, ProFileOption *option,
+ ProFileParser *parser, ProFileEvaluatorHandler *handler)
+ : q(q_), m_option(option), m_parser(parser), m_handler(handler)
{
- // Global parser state
- m_prevLineNo = 0;
- m_prevProFile = 0;
+ // So that single-threaded apps don't have to call initialize() for now.
+ initStatics();
// Configuration, more or less
- m_verbose = true;
+#ifdef PROEVALUATOR_CUMULATIVE
m_cumulative = true;
+#endif
// Evaluator state
- m_sts.condition = false;
- m_sts.prevCondition = false;
- m_invertNext = false;
m_skipLevel = 0;
- m_isFirstVariableValue = true;
- m_definingFunc.clear();
+ m_loopLevel = 0;
+ m_listCount = 0;
+ m_valuemapStack.push(QHash<ProString, ProStringList>());
}
-bool ProFileEvaluator::Private::read(ProFile *pro)
+ProFileEvaluator::Private::~Private()
{
- QFile file(pro->fileName());
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- q->errorMessage(format("%1 not readable.").arg(pro->fileName()));
- return false;
- }
-
- // Parser state
- m_block = 0;
- m_commentItem = 0;
- m_inQuote = false;
- m_parens = 0;
- m_contNextLine = false;
- m_syntaxError = false;
- m_lineNo = 1;
- m_blockstack.clear();
- m_blockstack.push(pro);
-
- QTextStream ts(&file);
- while (!ts.atEnd()) {
- QString line = ts.readLine();
- if (!parseLine(line)) {
- q->errorMessage(format(".pro parse failure."));
- return false;
- }
- ++m_lineNo;
- }
- return true;
}
-bool ProFileEvaluator::Private::parseLine(const QString &line0)
-{
- if (m_blockstack.isEmpty())
- return false;
-
- int parens = m_parens;
- bool inQuote = m_inQuote;
- bool escaped = false;
- QString line = line0.simplified();
+//////// Evaluator tools /////////
- for (int i = 0; !m_syntaxError && i < line.length(); ++i) {
- ushort c = line.at(i).unicode();
- if (c == '#') { // Yep - no escaping possible
- insertComment(line.mid(i + 1));
- escaped = m_contNextLine;
- break;
- }
- if (!escaped) {
- if (c == '\\') {
- escaped = true;
- m_proitem += c;
- continue;
- } else if (c == '"') {
- inQuote = !inQuote;
- m_proitem += c;
- continue;
- }
- } else {
- escaped = false;
- }
- if (!inQuote) {
- if (c == '(') {
- ++parens;
- } else if (c == ')') {
- --parens;
- } else if (!parens) {
- if (m_block && (m_block->blockKind() & ProBlock::VariableKind)) {
- if (c == ' ')
- updateItem();
- else
- m_proitem += c;
- continue;
- }
- if (c == ':') {
- enterScope(false);
- continue;
- }
- if (c == '{') {
- enterScope(true);
- continue;
- }
- if (c == '}') {
- leaveScope();
- continue;
- }
- if (c == '=') {
- insertVariable(line, &i);
- continue;
- }
- if (c == '|' || c == '!') {
- insertOperator(c);
- continue;
- }
- }
- }
-
- m_proitem += c;
- }
- m_inQuote = inQuote;
- m_parens = parens;
- m_contNextLine = escaped;
- if (escaped) {
- m_proitem.chop(1);
- updateItem();
- return true;
- } else {
- if (!m_syntaxError) {
- updateItem();
- finalizeBlock();
- return true;
- }
- return false;
- }
+uint ProFileEvaluator::Private::getBlockLen(const ushort *&tokPtr)
+{
+ uint len = *tokPtr++;
+ len |= (uint)*tokPtr++ << 16;
+ return len;
}
-void ProFileEvaluator::Private::finalizeBlock()
+ProString ProFileEvaluator::Private::getStr(const ushort *&tokPtr)
{
- if (m_blockstack.isEmpty()) {
- m_syntaxError = true;
- } else {
- if (m_blockstack.top()->blockKind() & ProBlock::SingleLine)
- leaveScope();
- m_block = 0;
- m_commentItem = 0;
- }
+ uint len = *tokPtr++;
+ ProString ret(m_current.pro->items(), tokPtr - m_current.pro->tokPtr(), len, NoHash);
+ ret.setSource(m_current.pro);
+ tokPtr += len;
+ return ret;
}
-void ProFileEvaluator::Private::insertVariable(const QString &line, int *i)
+ProString ProFileEvaluator::Private::getHashStr(const ushort *&tokPtr)
{
- ProVariable::VariableOperator opkind;
-
- if (m_proitem.isEmpty()) // Line starting with '=', like a conflict marker
- return;
-
- switch (m_proitem.at(m_proitem.length() - 1).unicode()) {
- case '+':
- m_proitem.chop(1);
- opkind = ProVariable::AddOperator;
- break;
- case '-':
- m_proitem.chop(1);
- opkind = ProVariable::RemoveOperator;
- break;
- case '*':
- m_proitem.chop(1);
- opkind = ProVariable::UniqueAddOperator;
- break;
- case '~':
- m_proitem.chop(1);
- opkind = ProVariable::ReplaceOperator;
- break;
- default:
- opkind = ProVariable::SetOperator;
- }
+ uint hash = getBlockLen(tokPtr);
+ uint len = *tokPtr++;
+ ProString ret(m_current.pro->items(), tokPtr - m_current.pro->tokPtr(), len, hash);
+ tokPtr += len;
+ return ret;
+}
- ProBlock *block = m_blockstack.top();
- m_proitem = m_proitem.trimmed();
- ProVariable *variable = new ProVariable(m_proitem, block);
- variable->setLineNumber(m_lineNo);
- variable->setVariableOperator(opkind);
- block->appendItem(variable);
- m_block = variable;
-
- if (!m_pendingComment.isEmpty()) {
- m_block->setComment(m_pendingComment);
- m_pendingComment.clear();
- }
- m_commentItem = variable;
+void ProFileEvaluator::Private::skipStr(const ushort *&tokPtr)
+{
+ uint len = *tokPtr++;
+ tokPtr += len;
+}
- m_proitem.clear();
+void ProFileEvaluator::Private::skipHashStr(const ushort *&tokPtr)
+{
+ tokPtr += 2;
+ uint len = *tokPtr++;
+ tokPtr += len;
+}
- if (opkind == ProVariable::ReplaceOperator) {
- // skip util end of line or comment
- while (1) {
- ++(*i);
+// FIXME: this should not build new strings for direct sections.
+// Note that the E_SPRINTF and E_LIST implementations rely on the deep copy.
+ProStringList ProFileEvaluator::Private::split_value_list(const QString &vals, const ProFile *source)
+{
+ QString build;
+ ProStringList ret;
+ QStack<char> quote;
- // end of line?
- if (*i >= line.count())
- break;
+ const ushort SPACE = ' ';
+ const ushort LPAREN = '(';
+ const ushort RPAREN = ')';
+ const ushort SINGLEQUOTE = '\'';
+ const ushort DOUBLEQUOTE = '"';
+ const ushort BACKSLASH = '\\';
- // comment?
- if (line.at(*i).unicode() == '#') {
- --(*i);
- break;
- }
+ if (!source)
+ source = currentProFile();
+
+ ushort unicode;
+ const QChar *vals_data = vals.data();
+ const int vals_len = vals.length();
+ for (int x = 0, parens = 0; x < vals_len; x++) {
+ unicode = vals_data[x].unicode();
+ if (x != (int)vals_len-1 && unicode == BACKSLASH &&
+ (vals_data[x+1].unicode() == SINGLEQUOTE || vals_data[x+1].unicode() == DOUBLEQUOTE)) {
+ build += vals_data[x++]; //get that 'escape'
+ } else if (!quote.isEmpty() && unicode == quote.top()) {
+ quote.pop();
+ } else if (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE) {
+ quote.push(unicode);
+ } else if (unicode == RPAREN) {
+ --parens;
+ } else if (unicode == LPAREN) {
+ ++parens;
+ }
- m_proitem += line.at(*i);
+ if (!parens && quote.isEmpty() && vals_data[x] == SPACE) {
+ ret << ProString(build, NoHash).setSource(source);
+ build.clear();
+ } else {
+ build += vals_data[x];
}
- m_proitem = m_proitem.trimmed();
}
+ if (!build.isEmpty())
+ ret << ProString(build, NoHash).setSource(source);
+ return ret;
}
-void ProFileEvaluator::Private::insertOperator(const char op)
+static void zipEmpty(ProStringList *value)
{
- updateItem();
-
- ProOperator::OperatorKind opkind;
- switch(op) {
- case '!':
- opkind = ProOperator::NotOperator;
- break;
- case '|':
- opkind = ProOperator::OrOperator;
- break;
- default:
- opkind = ProOperator::OrOperator;
- }
-
- ProBlock * const block = currentBlock();
- ProOperator * const proOp = new ProOperator(opkind);
- proOp->setLineNumber(m_lineNo);
- block->appendItem(proOp);
- m_commentItem = proOp;
+ for (int i = value->size(); --i >= 0;)
+ if (value->at(i).isEmpty())
+ value->remove(i);
}
-void ProFileEvaluator::Private::insertComment(const QString &comment)
+static void insertUnique(ProStringList *varlist, const ProStringList &value)
{
- updateItem();
-
- QString strComment;
- if (!m_commentItem)
- strComment = m_pendingComment;
- else
- strComment = m_commentItem->comment();
-
- if (strComment.isEmpty())
- strComment = comment;
- else {
- strComment += QLatin1Char('\n');
- strComment += comment.trimmed();
- }
-
- strComment = strComment.trimmed();
-
- if (!m_commentItem)
- m_pendingComment = strComment;
- else
- m_commentItem->setComment(strComment);
+ foreach (const ProString &str, value)
+ if (!str.isEmpty() && !varlist->contains(str))
+ varlist->append(str);
}
-void ProFileEvaluator::Private::enterScope(bool multiLine)
+static void removeAll(ProStringList *varlist, const ProString &value)
{
- updateItem();
-
- ProBlock *parent = currentBlock();
- ProBlock *block = new ProBlock(parent);
- block->setLineNumber(m_lineNo);
- parent->setBlockKind(ProBlock::ScopeKind);
-
- parent->appendItem(block);
-
- if (multiLine)
- block->setBlockKind(ProBlock::ScopeContentsKind);
- else
- block->setBlockKind(ProBlock::ScopeContentsKind|ProBlock::SingleLine);
-
- m_blockstack.push(block);
- m_block = 0;
+ for (int i = varlist->size(); --i >= 0; )
+ if (varlist->at(i) == value)
+ varlist->remove(i);
}
-void ProFileEvaluator::Private::leaveScope()
+static void removeEach(ProStringList *varlist, const ProStringList &value)
{
- updateItem();
- m_blockstack.pop();
- finalizeBlock();
+ foreach (const ProString &str, value)
+ if (!str.isEmpty())
+ removeAll(varlist, str);
}
-ProBlock *ProFileEvaluator::Private::currentBlock()
+static void replaceInList(ProStringList *varlist,
+ const QRegExp &regexp, const QString &replace, bool global, QString &tmp)
{
- if (m_block)
- return m_block;
-
- ProBlock *parent = m_blockstack.top();
- m_block = new ProBlock(parent);
- m_block->setLineNumber(m_lineNo);
- parent->appendItem(m_block);
-
- if (!m_pendingComment.isEmpty()) {
- m_block->setComment(m_pendingComment);
- m_pendingComment.clear();
+ for (ProStringList::Iterator varit = varlist->begin(); varit != varlist->end(); ) {
+ QString val = varit->toQString(tmp);
+ QString copy = val; // Force detach and have a reference value
+ val.replace(regexp, replace);
+ if (!val.isSharedWith(copy)) {
+ if (val.isEmpty()) {
+ varit = varlist->erase(varit);
+ } else {
+ (*varit).setValue(val, NoHash);
+ ++varit;
+ }
+ if (!global)
+ break;
+ } else {
+ ++varit;
+ }
}
+}
- m_commentItem = m_block;
-
- return m_block;
+QString ProFileEvaluator::Private::expandEnvVars(const QString &str) const
+{
+ QString string = str;
+ int rep;
+ QRegExp reg_variableName = statics.reg_variableName; // Copy for thread safety
+ while ((rep = reg_variableName.indexIn(string)) != -1)
+ string.replace(rep, reg_variableName.matchedLength(),
+ m_option->getEnv(string.mid(rep + 2, reg_variableName.matchedLength() - 3)));
+ return string;
}
-void ProFileEvaluator::Private::updateItem()
+// This is braindead, but we want qmake compat
+QString ProFileEvaluator::Private::fixPathToLocalOS(const QString &str) const
{
- m_proitem = m_proitem.trimmed();
- if (m_proitem.isEmpty())
- return;
+ QString string = expandEnvVars(str);
- ProBlock *block = currentBlock();
- if (block->blockKind() & ProBlock::VariableKind) {
- m_commentItem = new ProValue(m_proitem, static_cast<ProVariable*>(block));
- } else if (m_proitem.endsWith(QLatin1Char(')'))) {
- m_commentItem = new ProFunction(m_proitem);
- } else {
- m_commentItem = new ProCondition(m_proitem);
- }
- m_commentItem->setLineNumber(m_lineNo);
- block->appendItem(m_commentItem);
+ if (string.length() > 2 && string.at(0).isLetter() && string.at(1) == QLatin1Char(':'))
+ string[0] = string[0].toLower();
- m_proitem.clear();
+#if defined(Q_OS_WIN32)
+ string.replace(QLatin1Char('/'), QLatin1Char('\\'));
+#else
+ string.replace(QLatin1Char('\\'), QLatin1Char('/'));
+#endif
+ return string;
+}
+
+static bool isTrue(const ProString &_str, QString &tmp)
+{
+ const QString &str = _str.toQString(tmp);
+ return !str.compare(statics.strtrue, Qt::CaseInsensitive) || str.toInt();
}
+//////// Evaluator /////////
-ProItem::ProItemReturn ProFileEvaluator::Private::visitBeginProBlock(ProBlock *block)
+static ALWAYS_INLINE void addStr(
+ const ProString &str, ProStringList *ret, bool &pending, bool joined)
{
- if (block->blockKind() & ProBlock::ScopeContentsKind) {
- if (!m_definingFunc.isEmpty()) {
- if (!m_skipLevel || m_cumulative) {
- QHash<QString, ProBlock *> *hash =
- (m_definingTest ? &m_testFunctions : &m_replaceFunctions);
- if (ProBlock *def = hash->value(m_definingFunc))
- def->deref();
- hash->insert(m_definingFunc, block);
- block->ref();
- block->setBlockKind(block->blockKind() | ProBlock::FunctionBodyKind);
- }
- m_definingFunc.clear();
- return ProItem::ReturnSkip;
- } else if (!(block->blockKind() & ProBlock::FunctionBodyKind)) {
- if (!m_sts.condition)
- ++m_skipLevel;
- else
- Q_ASSERT(!m_skipLevel);
- }
+ if (joined) {
+ ret->last().append(str, &pending);
} else {
- if (!m_skipLevel) {
- if (m_sts.condition) {
- m_sts.prevCondition = true;
- m_sts.condition = false;
- }
+ if (!pending) {
+ pending = true;
+ *ret << str;
} else {
- Q_ASSERT(!m_sts.condition);
+ ret->last().append(str);
}
}
- return ProItem::ReturnTrue;
}
-void ProFileEvaluator::Private::visitEndProBlock(ProBlock *block)
+static ALWAYS_INLINE void addStrList(
+ const ProStringList &list, ushort tok, ProStringList *ret, bool &pending, bool joined)
{
- if ((block->blockKind() & ProBlock::ScopeContentsKind)
- && !(block->blockKind() & ProBlock::FunctionBodyKind)) {
- if (m_skipLevel) {
- Q_ASSERT(!m_sts.condition);
- --m_skipLevel;
- } else if (!(block->blockKind() & ProBlock::SingleLine)) {
- // Conditionals contained inside this block may have changed the state.
- // So we reset it here to make an else following us do the right thing.
- m_sts.condition = true;
+ if (!list.isEmpty()) {
+ if (joined) {
+ ret->last().append(list, &pending, !(tok & TokQuoted));
+ } else {
+ if (tok & TokQuoted) {
+ if (!pending) {
+ pending = true;
+ *ret << ProString();
+ }
+ ret->last().append(list);
+ } else {
+ if (!pending) {
+ // Another qmake bizzarity: if nothing is pending and the
+ // first element is empty, it will be eaten
+ if (!list.at(0).isEmpty()) {
+ // The common case
+ pending = true;
+ *ret += list;
+ return;
+ }
+ } else {
+ ret->last().append(list.at(0));
+ }
+ // This is somewhat slow, but a corner case
+ for (int j = 1; j < list.size(); ++j) {
+ pending = true;
+ *ret << list.at(j);
+ }
+ }
}
}
}
-ProItem::ProItemReturn ProFileEvaluator::Private::visitProLoopIteration()
-{
- ProLoop &loop = m_loopStack.top();
-
- if (loop.infinite) {
- if (!loop.variable.isEmpty())
- m_valuemap[loop.variable] = QStringList(QString::number(loop.index++));
- if (loop.index > 1000) {
- q->errorMessage(format("ran into infinite loop (> 1000 iterations)."));
- return ProItem::ReturnFalse;
+void ProFileEvaluator::Private::evaluateExpression(
+ const ushort *&tokPtr, ProStringList *ret, bool joined)
+{
+ if (joined)
+ *ret << ProString();
+ bool pending = false;
+ forever {
+ ushort tok = *tokPtr++;
+ if (tok & TokNewStr)
+ pending = false;
+ ushort maskedTok = tok & TokMask;
+ switch (maskedTok) {
+ case TokLine:
+ m_current.line = *tokPtr++;
+ break;
+ case TokLiteral:
+ addStr(getStr(tokPtr), ret, pending, joined);
+ break;
+ case TokHashLiteral:
+ addStr(getHashStr(tokPtr), ret, pending, joined);
+ break;
+ case TokVariable:
+ addStrList(values(map(getHashStr(tokPtr))), tok, ret, pending, joined);
+ break;
+ case TokProperty:
+ addStr(ProString(propertyValue(
+ getStr(tokPtr).toQString(m_tmp1), true), NoHash).setSource(currentProFile()),
+ ret, pending, joined);
+ break;
+ case TokEnvVar:
+ addStrList(split_value_list(m_option->getEnv(getStr(tokPtr).toQString(m_tmp1))),
+ tok, ret, pending, joined);
+ break;
+ case TokFuncName: {
+ ProString func = getHashStr(tokPtr);
+ addStrList(evaluateExpandFunction(func, tokPtr), tok, ret, pending, joined);
+ break; }
+ default:
+ tokPtr--;
+ return;
}
- } else {
- QString val;
- do {
- if (loop.index >= loop.list.count())
- return ProItem::ReturnFalse;
- val = loop.list.at(loop.index++);
- } while (val.isEmpty()); // stupid, but qmake is like that
- m_valuemap[loop.variable] = QStringList(val);
}
- return ProItem::ReturnTrue;
-}
-
-void ProFileEvaluator::Private::visitProLoopCleanup()
-{
- ProLoop &loop = m_loopStack.top();
- m_valuemap[loop.variable] = loop.oldVarVal;
- m_loopStack.pop_back();
}
-void ProFileEvaluator::Private::visitBeginProVariable(ProVariable *variable)
+void ProFileEvaluator::Private::skipExpression(const ushort *&pTokPtr)
{
- m_lastVarName = variable->variable();
- m_variableOperator = variable->variableOperator();
- m_isFirstVariableValue = true;
- m_tempValuemap = m_valuemap;
- m_tempFilevaluemap = m_filevaluemap;
+ const ushort *tokPtr = pTokPtr;
+ forever {
+ ushort tok = *tokPtr++;
+ switch (tok) {
+ case TokLine:
+ m_current.line = *tokPtr++;
+ break;
+ case TokValueTerminator:
+ case TokFuncTerminator:
+ pTokPtr = tokPtr;
+ return;
+ case TokArgSeparator:
+ break;
+ default:
+ switch (tok & TokMask) {
+ case TokLiteral:
+ case TokProperty:
+ case TokEnvVar:
+ skipStr(tokPtr);
+ break;
+ case TokHashLiteral:
+ case TokVariable:
+ skipHashStr(tokPtr);
+ break;
+ case TokFuncName:
+ skipHashStr(tokPtr);
+ pTokPtr = tokPtr;
+ skipExpression(pTokPtr);
+ tokPtr = pTokPtr;
+ break;
+ default:
+ Q_ASSERT_X(false, "skipExpression", "Unrecognized token");
+ break;
+ }
+ }
+ }
}
-void ProFileEvaluator::Private::visitEndProVariable(ProVariable *variable)
-{
- Q_UNUSED(variable);
- m_valuemap = m_tempValuemap;
- m_filevaluemap = m_tempFilevaluemap;
- m_lastVarName.clear();
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProBlock(
+ ProFile *pro, const ushort *tokPtr)
+{
+ m_current.pro = pro;
+ m_current.line = 0;
+ return visitProBlock(tokPtr);
+}
+
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProBlock(
+ const ushort *tokPtr)
+{
+ ProStringList curr;
+ bool okey = true, or_op = false, invert = false;
+ uint blockLen;
+ VisitReturn ret = ReturnTrue;
+ while (ushort tok = *tokPtr++) {
+ switch (tok) {
+ case TokLine:
+ m_current.line = *tokPtr++;
+ continue;
+ case TokAssign:
+ case TokAppend:
+ case TokAppendUnique:
+ case TokRemove:
+ case TokReplace:
+ visitProVariable(tok, curr, tokPtr);
+ curr.clear();
+ continue;
+ case TokBranch:
+ blockLen = getBlockLen(tokPtr);
+ if (m_cumulative) {
+ if (!okey)
+ m_skipLevel++;
+ ret = blockLen ? visitProBlock(tokPtr) : ReturnTrue;
+ tokPtr += blockLen;
+ blockLen = getBlockLen(tokPtr);
+ if (!okey)
+ m_skipLevel--;
+ else
+ m_skipLevel++;
+ if ((ret == ReturnTrue || ret == ReturnFalse) && blockLen)
+ ret = visitProBlock(tokPtr);
+ if (okey)
+ m_skipLevel--;
+ } else {
+ if (okey)
+ ret = blockLen ? visitProBlock(tokPtr) : ReturnTrue;
+ tokPtr += blockLen;
+ blockLen = getBlockLen(tokPtr);
+ if (!okey)
+ ret = blockLen ? visitProBlock(tokPtr) : ReturnTrue;
+ }
+ tokPtr += blockLen;
+ okey = true, or_op = false; // force next evaluation
+ break;
+ case TokForLoop:
+ if (m_cumulative) { // This is a no-win situation, so just pretend it's no loop
+ skipHashStr(tokPtr);
+ uint exprLen = getBlockLen(tokPtr);
+ tokPtr += exprLen;
+ blockLen = getBlockLen(tokPtr);
+ ret = visitProBlock(tokPtr);
+ } else if (okey != or_op) {
+ const ProString &variable = getHashStr(tokPtr);
+ uint exprLen = getBlockLen(tokPtr);
+ const ushort *exprPtr = tokPtr;
+ tokPtr += exprLen;
+ blockLen = getBlockLen(tokPtr);
+ ret = visitProLoop(variable, exprPtr, tokPtr);
+ } else {
+ skipHashStr(tokPtr);
+ uint exprLen = getBlockLen(tokPtr);
+ tokPtr += exprLen;
+ blockLen = getBlockLen(tokPtr);
+ ret = ReturnTrue;
+ }
+ tokPtr += blockLen;
+ okey = true, or_op = false; // force next evaluation
+ break;
+ case TokTestDef:
+ case TokReplaceDef:
+ if (m_cumulative || okey != or_op) {
+ const ProString &name = getHashStr(tokPtr);
+ blockLen = getBlockLen(tokPtr);
+ visitProFunctionDef(tok, name, tokPtr);
+ } else {
+ skipHashStr(tokPtr);
+ blockLen = getBlockLen(tokPtr);
+ }
+ tokPtr += blockLen;
+ okey = true, or_op = false; // force next evaluation
+ continue;
+ case TokNot:
+ invert ^= true;
+ continue;
+ case TokAnd:
+ or_op = false;
+ continue;
+ case TokOr:
+ or_op = true;
+ continue;
+ case TokCondition:
+ if (!m_skipLevel && okey != or_op) {
+ if (curr.size() != 1) {
+ if (!m_cumulative || !curr.isEmpty())
+ evalError(fL1S("Conditional must expand to exactly one word."));
+ okey = false;
+ } else {
+ okey = isActiveConfig(curr.at(0).toQString(m_tmp2), true) ^ invert;
+ }
+ }
+ or_op = !okey; // tentatively force next evaluation
+ invert = false;
+ curr.clear();
+ continue;
+ case TokTestCall:
+ if (!m_skipLevel && okey != or_op) {
+ if (curr.size() != 1) {
+ if (!m_cumulative || !curr.isEmpty())
+ evalError(fL1S("Test name must expand to exactly one word."));
+ skipExpression(tokPtr);
+ okey = false;
+ } else {
+ ret = evaluateConditionalFunction(curr.at(0), tokPtr);
+ switch (ret) {
+ case ReturnTrue: okey = true; break;
+ case ReturnFalse: okey = false; break;
+ default: return ret;
+ }
+ okey ^= invert;
+ }
+ } else if (m_cumulative) {
+ m_skipLevel++;
+ if (curr.size() != 1)
+ skipExpression(tokPtr);
+ else
+ evaluateConditionalFunction(curr.at(0), tokPtr);
+ m_skipLevel--;
+ } else {
+ skipExpression(tokPtr);
+ }
+ or_op = !okey; // tentatively force next evaluation
+ invert = false;
+ curr.clear();
+ continue;
+ default: {
+ const ushort *oTokPtr = --tokPtr;
+ evaluateExpression(tokPtr, &curr, false);
+ if (tokPtr != oTokPtr)
+ continue;
+ }
+ Q_ASSERT_X(false, "visitProBlock", "unexpected item type");
+ }
+ if (ret != ReturnTrue && ret != ReturnFalse)
+ break;
+ }
+ return ret;
}
-void ProFileEvaluator::Private::visitProOperator(ProOperator *oper)
-{
- m_invertNext = (oper->operatorKind() == ProOperator::NotOperator);
-}
-void ProFileEvaluator::Private::visitProCondition(ProCondition *cond)
+void ProFileEvaluator::Private::visitProFunctionDef(
+ ushort tok, const ProString &name, const ushort *tokPtr)
{
- if (!m_skipLevel) {
- if (!cond->text().compare(QLatin1String("else"), Qt::CaseInsensitive)) {
- m_sts.condition = !m_sts.prevCondition;
- } else {
- m_sts.prevCondition = false;
- if (!m_sts.condition && isActiveConfig(cond->text(), true) ^ m_invertNext)
- m_sts.condition = true;
- }
- }
- m_invertNext = false;
+ QHash<ProString, FunctionDef> *hash =
+ (tok == TokTestDef
+ ? &m_functionDefs.testFunctions
+ : &m_functionDefs.replaceFunctions);
+ hash->insert(name, FunctionDef(m_current.pro, tokPtr - m_current.pro->tokPtr()));
}
-ProItem::ProItemReturn ProFileEvaluator::Private::visitBeginProFile(ProFile * pro)
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProLoop(
+ const ProString &_variable, const ushort *exprPtr, const ushort *tokPtr)
{
- PRE(pro);
- m_lineNo = pro->lineNumber();
- if (m_origfile.isEmpty())
- m_origfile = pro->fileName();
- if (m_oldPath.isEmpty()) {
- // change the working directory for the initial profile we visit, since
- // that is *the* profile. All the other times we reach this function will be due to
- // include(file) or load(file)
-
- m_oldPath = QDir::currentPath();
-
- m_profileStack.push(pro);
-
- const QString mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
- if (!mkspecDirectory.isEmpty()) {
- bool cumulative = m_cumulative;
- m_cumulative = false;
- // This is what qmake does, everything set in the mkspec is also set
- // But this also creates a lot of problems
- evaluateFile(mkspecDirectory + QLatin1String("/default/qmake.conf"));
- evaluateFile(mkspecDirectory + QLatin1String("/features/default_pre.prf"));
- m_cumulative = cumulative;
+ VisitReturn ret = ReturnTrue;
+ bool infinite = false;
+ int index = 0;
+ ProString variable;
+ ProStringList oldVarVal;
+ ProString it_list = expandVariableReferences(exprPtr, 0, true).at(0);
+ if (_variable.isEmpty()) {
+ if (it_list != statics.strever) {
+ evalError(fL1S("Invalid loop expression."));
+ return ReturnFalse;
}
-
- return returnBool(QDir::setCurrent(pro->directoryName()));
+ it_list = ProString(statics.strforever);
+ } else {
+ variable = map(_variable);
+ oldVarVal = valuesDirect(variable);
}
-
- return ProItem::ReturnTrue;
-}
-
-ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
-{
- PRE(pro);
- m_lineNo = pro->lineNumber();
- if (m_profileStack.count() == 1 && !m_oldPath.isEmpty()) {
- const QString &mkspecDirectory = propertyValue(QLatin1String("QMAKE_MKSPECS"));
- if (!mkspecDirectory.isEmpty()) {
- bool cumulative = m_cumulative;
- m_cumulative = false;
-
- evaluateFile(mkspecDirectory + QLatin1String("/features/default_post.prf"));
-
- QSet<QString> processed;
- forever {
- bool finished = true;
- QStringList configs = valuesDirect(QLatin1String("CONFIG"));
- for (int i = configs.size() - 1; i >= 0; --i) {
- const QString config = configs[i].toLower();
- if (!processed.contains(config)) {
- processed.insert(config);
- if (evaluateFile(mkspecDirectory + QLatin1String("/features/")
- + config + QLatin1String(".prf"))) {
- finished = false;
- break;
+ ProStringList list = valuesDirect(it_list);
+ if (list.isEmpty()) {
+ if (it_list == statics.strforever) {
+ infinite = true;
+ } else {
+ const QString &itl = it_list.toQString(m_tmp1);
+ int dotdot = itl.indexOf(statics.strDotDot);
+ if (dotdot != -1) {
+ bool ok;
+ int start = itl.left(dotdot).toInt(&ok);
+ if (ok) {
+ int end = itl.mid(dotdot+2).toInt(&ok);
+ if (ok) {
+ if (start < end) {
+ for (int i = start; i <= end; i++)
+ list << ProString(QString::number(i), NoHash);
+ } else {
+ for (int i = start; i >= end; i--)
+ list << ProString(QString::number(i), NoHash);
}
}
}
- if (finished)
- break;
}
-
- foreach (ProBlock *itm, m_replaceFunctions)
- itm->deref();
- m_replaceFunctions.clear();
- foreach (ProBlock *itm, m_testFunctions)
- itm->deref();
- m_testFunctions.clear();
-
- m_cumulative = cumulative;
}
-
- m_profileStack.pop();
- return returnBool(QDir::setCurrent(m_oldPath));
}
- return ProItem::ReturnTrue;
-}
-
-static void replaceInList(QStringList *varlist,
- const QRegExp &regexp, const QString &replace, bool global)
-{
- for (QStringList::Iterator varit = varlist->begin(); varit != varlist->end(); ) {
- if ((*varit).contains(regexp)) {
- (*varit).replace(regexp, replace);
- if ((*varit).isEmpty())
- varit = varlist->erase(varit);
- else
- ++varit;
- if(!global)
+ m_loopLevel++;
+ forever {
+ if (infinite) {
+ if (!variable.isEmpty())
+ m_valuemapStack.top()[variable] = ProStringList(ProString(QString::number(index++), NoHash));
+ if (index > 1000) {
+ evalError(fL1S("ran into infinite loop (> 1000 iterations)."));
break;
+ }
} else {
- ++varit;
+ ProString val;
+ do {
+ if (index >= list.count())
+ goto do_break;
+ val = list.at(index++);
+ } while (val.isEmpty()); // stupid, but qmake is like that
+ m_valuemapStack.top()[variable] = ProStringList(val);
+ }
+
+ ret = visitProBlock(tokPtr);
+ switch (ret) {
+ case ReturnTrue:
+ case ReturnFalse:
+ break;
+ case ReturnNext:
+ ret = ReturnTrue;
+ break;
+ case ReturnBreak:
+ ret = ReturnTrue;
+ goto do_break;
+ default:
+ goto do_break;
}
}
+ do_break:
+ m_loopLevel--;
+
+ if (!variable.isEmpty())
+ m_valuemapStack.top()[variable] = oldVarVal;
+ return ret;
}
-void ProFileEvaluator::Private::visitProValue(ProValue *value)
+void ProFileEvaluator::Private::visitProVariable(
+ ushort tok, const ProStringList &curr, const ushort *&tokPtr)
{
- PRE(value);
- m_lineNo = value->lineNumber();
- QString val = value->value();
+ int sizeHint = *tokPtr++;
- QString varName = m_lastVarName;
+ if (curr.size() != 1) {
+ skipExpression(tokPtr);
+ if (!m_cumulative || !curr.isEmpty())
+ evalError(fL1S("Left hand side of assignment must expand to exactly one word."));
+ return;
+ }
+ const ProString &varName = map(curr.first());
- QStringList v = expandVariableReferences(val);
+ if (tok == TokReplace) { // ~=
+ // DEFINES ~= s/a/b/?[gqi]
- // Since qmake combines different values for the TARGET variable, we join
- // TARGET values that are on the same line. We can't do this later with all
- // values because this parser isn't scope-aware, so we'd risk joining
- // scope-specific targets together.
- if (varName == QLatin1String("TARGET")
- && m_lineNo == m_prevLineNo
- && currentProFile() == m_prevProFile) {
- QStringList targets = m_tempValuemap.value(QLatin1String("TARGET"));
- m_tempValuemap.remove(QLatin1String("TARGET"));
- QStringList lastTarget(targets.takeLast());
- lastTarget << v.join(QLatin1String(" "));
- targets.push_back(lastTarget.join(QLatin1String(" ")));
- v = targets;
- }
- m_prevLineNo = m_lineNo;
- m_prevProFile = currentProFile();
+ const ProStringList &varVal = expandVariableReferences(tokPtr, sizeHint, true);
+ const QString &val = varVal.at(0).toQString(m_tmp1);
+ if (val.length() < 4 || val.at(0) != QLatin1Char('s')) {
+ evalError(fL1S("the ~= operator can handle only the s/// function."));
+ return;
+ }
+ QChar sep = val.at(1);
+ QStringList func = val.split(sep);
+ if (func.count() < 3 || func.count() > 4) {
+ evalError(fL1S("the s/// function expects 3 or 4 arguments."));
+ return;
+ }
+
+ bool global = false, quote = false, case_sense = false;
+ if (func.count() == 4) {
+ global = func[3].indexOf(QLatin1Char('g')) != -1;
+ case_sense = func[3].indexOf(QLatin1Char('i')) == -1;
+ quote = func[3].indexOf(QLatin1Char('q')) != -1;
+ }
+ QString pattern = func[1];
+ QString replace = func[2];
+ if (quote)
+ pattern = QRegExp::escape(pattern);
+
+ QRegExp regexp(pattern, case_sense ? Qt::CaseSensitive : Qt::CaseInsensitive);
- switch (m_variableOperator) {
- case ProVariable::SetOperator: // =
+ if (!m_skipLevel || m_cumulative) {
+ // We could make a union of modified and unmodified values,
+ // but this will break just as much as it fixes, so leave it as is.
+ replaceInList(&valuesRef(varName), regexp, replace, global, m_tmp2);
+ }
+ } else {
+ ProStringList varVal = expandVariableReferences(tokPtr, sizeHint);
+ switch (tok) {
+ default: // whatever - cannot happen
+ case TokAssign: // =
if (!m_cumulative) {
if (!m_skipLevel) {
- if (m_isFirstVariableValue) {
- m_tempValuemap[varName] = v;
- m_tempFilevaluemap[currentProFile()][varName] = v;
- } else { // handle lines "CONFIG = foo bar"
- m_tempValuemap[varName] += v;
- m_tempFilevaluemap[currentProFile()][varName] += v;
- }
+ zipEmpty(&varVal);
+ m_valuemapStack.top()[varName] = varVal;
}
} else {
- // We are greedy for values.
- m_tempValuemap[varName] += v;
- m_tempFilevaluemap[currentProFile()][varName] += v;
+ zipEmpty(&varVal);
+ if (!varVal.isEmpty()) {
+ // We are greedy for values. But avoid exponential growth.
+ ProStringList &v = valuesRef(varName);
+ if (v.isEmpty()) {
+ v = varVal;
+ } else {
+ ProStringList old = v;
+ v = varVal;
+ QSet<ProString> has;
+ has.reserve(v.size());
+ foreach (const ProString &s, v)
+ has.insert(s);
+ v.reserve(v.size() + old.size());
+ foreach (const ProString &s, old)
+ if (!has.contains(s))
+ v << s;
+ }
+ }
}
break;
- case ProVariable::UniqueAddOperator: // *=
- if (!m_skipLevel || m_cumulative) {
- insertUnique(&m_tempValuemap, varName, v);
- insertUnique(&m_tempFilevaluemap[currentProFile()], varName, v);
- }
+ case TokAppendUnique: // *=
+ if (!m_skipLevel || m_cumulative)
+ insertUnique(&valuesRef(varName), varVal);
break;
- case ProVariable::AddOperator: // +=
+ case TokAppend: // +=
if (!m_skipLevel || m_cumulative) {
- m_tempValuemap[varName] += v;
- m_tempFilevaluemap[currentProFile()][varName] += v;
+ zipEmpty(&varVal);
+ valuesRef(varName) += varVal;
}
break;
- case ProVariable::RemoveOperator: // -=
+ case TokRemove: // -=
if (!m_cumulative) {
- if (!m_skipLevel) {
- removeEach(&m_tempValuemap, varName, v);
- removeEach(&m_tempFilevaluemap[currentProFile()], varName, v);
- }
+ if (!m_skipLevel)
+ removeEach(&valuesRef(varName), varVal);
} else {
// We are stingy with our values, too.
}
break;
- case ProVariable::ReplaceOperator: // ~=
- {
- // DEFINES ~= s/a/b/?[gqi]
+ }
+ }
+}
- doVariableReplace(&val);
- if (val.length() < 4 || val[0] != QLatin1Char('s')) {
- q->logMessage(format("the ~= operator can handle only the s/// function."));
- break;
+void ProFileEvaluator::Private::visitCmdLine(const QString &cmds)
+{
+ if (!cmds.isEmpty()) {
+ if (ProFile *pro = m_parser->parsedProBlock(fL1S("(command line)"), cmds)) {
+ m_locationStack.push(m_current);
+ visitProBlock(pro, pro->tokPtr());
+ m_current = m_locationStack.pop();
+ pro->deref();
+ }
+ }
+}
+
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(
+ ProFile *pro, ProFileEvaluatorHandler::EvalFileType type,
+ ProFileEvaluator::LoadFlags flags)
+{
+ if (!m_cumulative && !pro->isOk())
+ return ReturnFalse;
+
+ m_handler->aboutToEval(currentProFile(), pro, type);
+ m_profileStack.push(pro);
+ if (flags & LoadPreFiles) {
+#ifdef PROEVALUATOR_THREAD_SAFE
+ {
+ QMutexLocker locker(&m_option->mutex);
+ if (m_option->base_inProgress) {
+ QThreadPool::globalInstance()->releaseThread();
+ m_option->cond.wait(&m_option->mutex);
+ QThreadPool::globalInstance()->reserveThread();
+ } else
+#endif
+ if (m_option->base_valuemap.isEmpty()) {
+#ifdef PROEVALUATOR_THREAD_SAFE
+ m_option->base_inProgress = true;
+ locker.unlock();
+#endif
+
+#ifdef PROEVALUATOR_CUMULATIVE
+ bool cumulative = m_cumulative;
+ m_cumulative = false;
+#endif
+
+ // ### init QMAKE_QMAKE, QMAKE_SH
+ // ### init QMAKE_EXT_{C,H,CPP,OBJ}
+ // ### init TEMPLATE_PREFIX
+
+ QString qmake_cache = m_option->cachefile;
+ if (qmake_cache.isEmpty() && !m_outputDir.isEmpty()) { //find it as it has not been specified
+ QDir dir(m_outputDir);
+ forever {
+ qmake_cache = dir.path() + QLatin1String("/.qmake.cache");
+ if (IoUtils::exists(qmake_cache))
+ break;
+ if (!dir.cdUp() || dir.isRoot()) {
+ qmake_cache.clear();
+ break;
+ }
+ }
}
- QChar sep = val.at(1);
- QStringList func = val.split(sep);
- if (func.count() < 3 || func.count() > 4) {
- q->logMessage(format("the s/// function expects 3 or 4 arguments."));
- break;
+ if (!qmake_cache.isEmpty()) {
+ qmake_cache = resolvePath(qmake_cache);
+ QHash<ProString, ProStringList> cache_valuemap;
+ if (evaluateFileInto(qmake_cache, ProFileEvaluatorHandler::EvalConfigFile,
+ &cache_valuemap, 0, EvalProOnly)) {
+ if (m_option->qmakespec.isEmpty()) {
+ const ProStringList &vals = cache_valuemap.value(ProString("QMAKESPEC"));
+ if (!vals.isEmpty())
+ m_option->qmakespec = vals.first().toQString();
+ }
+ } else {
+ qmake_cache.clear();
+ }
}
+ m_option->cachefile = qmake_cache;
+
+ QStringList mkspec_roots = qmakeMkspecPaths();
- bool global = false, quote = false, case_sense = false;
- if (func.count() == 4) {
- global = func[3].indexOf(QLatin1Char('g')) != -1;
- case_sense = func[3].indexOf(QLatin1Char('i')) == -1;
- quote = func[3].indexOf(QLatin1Char('q')) != -1;
+ QString qmakespec = expandEnvVars(m_option->qmakespec);
+ if (qmakespec.isEmpty()) {
+ foreach (const QString &root, mkspec_roots) {
+ QString mkspec = root + QLatin1String("/default");
+ if (IoUtils::fileType(mkspec) == IoUtils::FileIsDir) {
+ qmakespec = mkspec;
+ break;
+ }
+ }
+ if (qmakespec.isEmpty()) {
+ m_handler->configError(fL1S("Could not find qmake configuration directory"));
+ // Unlike in qmake, not finding the spec is not critical ...
+ }
}
- QString pattern = func[1];
- QString replace = func[2];
- if (quote)
- pattern = QRegExp::escape(pattern);
-
- QRegExp regexp(pattern, case_sense ? Qt::CaseSensitive : Qt::CaseInsensitive);
-
- if (!m_skipLevel || m_cumulative) {
- // We could make a union of modified and unmodified values,
- // but this will break just as much as it fixes, so leave it as is.
- replaceInList(&m_tempValuemap[varName], regexp, replace, global);
- replaceInList(&m_tempFilevaluemap[currentProFile()][varName], regexp, replace, global);
+
+ if (IoUtils::isRelativePath(qmakespec)) {
+ if (IoUtils::exists(currentDirectory() + QLatin1Char('/') + qmakespec
+ + QLatin1String("/qmake.conf"))) {
+ qmakespec = currentDirectory() + QLatin1Char('/') + qmakespec;
+ } else if (!m_outputDir.isEmpty()
+ && IoUtils::exists(m_outputDir + QLatin1Char('/') + qmakespec
+ + QLatin1String("/qmake.conf"))) {
+ qmakespec = m_outputDir + QLatin1Char('/') + qmakespec;
+ } else {
+ foreach (const QString &root, mkspec_roots) {
+ QString mkspec = root + QLatin1Char('/') + qmakespec;
+ if (IoUtils::exists(mkspec)) {
+ qmakespec = mkspec;
+ goto cool;
+ }
+ }
+ m_handler->configError(fL1S("Could not find qmake configuration file"));
+ // Unlike in qmake, a missing config is not critical ...
+ qmakespec.clear();
+ cool: ;
+ }
}
+
+ if (!qmakespec.isEmpty()) {
+ m_option->qmakespec = QDir::cleanPath(qmakespec);
+
+ QString spec = m_option->qmakespec + QLatin1String("/qmake.conf");
+ if (!evaluateFileDirect(spec, ProFileEvaluatorHandler::EvalConfigFile,
+ ProFileEvaluator::LoadProOnly)) {
+ m_handler->configError(
+ fL1S("Could not read qmake configuration file %1").arg(spec));
+ } else if (!m_option->cachefile.isEmpty()) {
+ evaluateFileDirect(m_option->cachefile,
+ ProFileEvaluatorHandler::EvalConfigFile,
+ ProFileEvaluator::LoadProOnly);
+ }
+ m_option->qmakespec_name = IoUtils::fileName(m_option->qmakespec).toString();
+ if (m_option->qmakespec_name == QLatin1String("default")) {
+#ifdef Q_OS_UNIX
+ char buffer[1024];
+ int l = ::readlink(m_option->qmakespec.toLocal8Bit().constData(), buffer, 1024);
+ if (l != -1)
+ m_option->qmakespec_name =
+ IoUtils::fileName(QString::fromLocal8Bit(buffer, l)).toString();
+#else
+ // We can't resolve symlinks as they do on Unix, so configure.exe puts
+ // the source of the qmake.conf at the end of the default/qmake.conf in
+ // the QMAKESPEC_ORG variable.
+ const ProStringList &spec_org =
+ m_option->base_valuemap.value(ProString("QMAKESPEC_ORIGINAL"));
+ if (!spec_org.isEmpty())
+ m_option->qmakespec_name =
+ IoUtils::fileName(spec_org.first().toQString()).toString();
+#endif
+ }
+ }
+
+ evaluateFeatureFile(QLatin1String("default_pre.prf"));
+
+ m_option->base_valuemap = m_valuemapStack.top();
+ m_option->base_functions = m_functionDefs;
+
+#ifdef PROEVALUATOR_CUMULATIVE
+ m_cumulative = cumulative;
+#endif
+
+#ifdef PROEVALUATOR_THREAD_SAFE
+ locker.relock();
+ m_option->base_inProgress = false;
+ m_option->cond.wakeAll();
+#endif
+ goto fresh;
}
- break;
+#ifdef PROEVALUATOR_THREAD_SAFE
+ }
+#endif
+
+ m_valuemapStack.top() = m_option->base_valuemap;
+ m_functionDefs = m_option->base_functions;
+ fresh:
+ ProStringList &tgt = m_valuemapStack.top()[ProString("TARGET")];
+ if (tgt.isEmpty())
+ tgt.append(ProString(QFileInfo(pro->fileName()).baseName(), NoHash));
+
+ visitCmdLine(m_option->precmds);
}
- m_isFirstVariableValue = false;
-}
-ProItem::ProItemReturn ProFileEvaluator::Private::visitProFunction(ProFunction *func)
-{
- // Make sure that called subblocks don't inherit & destroy the state
- bool invertThis = m_invertNext;
- m_invertNext = false;
- if (!m_skipLevel)
- m_sts.prevCondition = false;
- if (m_cumulative || !m_sts.condition) {
- QString text = func->text();
- int lparen = text.indexOf(QLatin1Char('('));
- int rparen = text.lastIndexOf(QLatin1Char(')'));
- Q_ASSERT(lparen < rparen);
- QString arguments = text.mid(lparen + 1, rparen - lparen - 1);
- QString funcName = text.left(lparen);
- m_lineNo = func->lineNumber();
- ProItem::ProItemReturn result = evaluateConditionalFunction(funcName.trimmed(), arguments);
- if (result != ProItem::ReturnFalse && result != ProItem::ReturnTrue)
- return result;
- if (!m_skipLevel && ((result == ProItem::ReturnTrue) ^ invertThis))
- m_sts.condition = true;
+ visitProBlock(pro, pro->tokPtr());
+
+ if (flags & LoadPostFiles) {
+ visitCmdLine(m_option->postcmds);
+
+ evaluateFeatureFile(QLatin1String("default_post.prf"));
+
+ QSet<QString> processed;
+ forever {
+ bool finished = true;
+ ProStringList configs = valuesDirect(statics.strCONFIG);
+ for (int i = configs.size() - 1; i >= 0; --i) {
+ QString config = configs.at(i).toQString(m_tmp1).toLower();
+ if (!processed.contains(config)) {
+ config.detach();
+ processed.insert(config);
+ if (evaluateFeatureFile(config)) {
+ finished = false;
+ break;
+ }
+ }
+ }
+ if (finished)
+ break;
+ }
}
- return ProItem::ReturnTrue;
+ m_profileStack.pop();
+ m_handler->doneWithEval(currentProFile());
+
+ return ReturnTrue;
}
-QStringList ProFileEvaluator::Private::qmakeFeaturePaths()
+QStringList ProFileEvaluator::Private::qmakeMkspecPaths() const
+{
+ QStringList ret;
+ const QString concat = QLatin1String("/mkspecs");
+
+ QString qmakepath = m_option->getEnv(QLatin1String("QMAKEPATH"));
+ if (!qmakepath.isEmpty())
+ foreach (const QString &it, qmakepath.split(m_option->dirlist_sep))
+ ret << QDir::cleanPath(it) + concat;
+
+ QString builtIn = propertyValue(QLatin1String("QT_INSTALL_DATA"), false) + concat;
+ if (!ret.contains(builtIn))
+ ret << builtIn;
+
+ return ret;
+}
+
+QStringList ProFileEvaluator::Private::qmakeFeaturePaths() const
{
+ QString mkspecs_concat = QLatin1String("/mkspecs");
+ QString features_concat = QLatin1String("/features");
QStringList concat;
- {
- const QString base_concat = QDir::separator() + QLatin1String("features");
- concat << base_concat + QDir::separator() + QLatin1String("mac");
- concat << base_concat + QDir::separator() + QLatin1String("macx");
- concat << base_concat + QDir::separator() + QLatin1String("unix");
- concat << base_concat + QDir::separator() + QLatin1String("win32");
- concat << base_concat + QDir::separator() + QLatin1String("mac9");
- concat << base_concat + QDir::separator() + QLatin1String("qnx6");
- concat << base_concat;
+
+ validateModes();
+ switch (m_option->target_mode) {
+ case ProFileOption::TARG_MACX_MODE:
+ concat << QLatin1String("/features/mac");
+ concat << QLatin1String("/features/macx");
+ concat << QLatin1String("/features/unix");
+ break;
+ default: // Can't happen, just make the compiler shut up
+ case ProFileOption::TARG_UNIX_MODE:
+ concat << QLatin1String("/features/unix");
+ break;
+ case ProFileOption::TARG_WIN_MODE:
+ concat << QLatin1String("/features/win32");
+ break;
+ case ProFileOption::TARG_SYMBIAN_MODE:
+ concat << QLatin1String("/features/symbian");
+ break;
}
- const QString mkspecs_concat = QDir::separator() + QLatin1String("mkspecs");
+ concat << features_concat;
+
QStringList feature_roots;
- QByteArray mkspec_path = qgetenv("QMAKEFEATURES");
- if (!mkspec_path.isNull())
- feature_roots += splitPathList(QString::fromLocal8Bit(mkspec_path));
- /*
- if (prop)
- feature_roots += splitPathList(prop->value("QMAKEFEATURES"));
- if (!Option::mkfile::cachefile.isEmpty()) {
- QString path;
- int last_slash = Option::mkfile::cachefile.lastIndexOf(Option::dir_sep);
- if (last_slash != -1)
- path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash));
+
+ QString mkspec_path = m_option->getEnv(QLatin1String("QMAKEFEATURES"));
+ if (!mkspec_path.isEmpty())
+ foreach (const QString &f, mkspec_path.split(m_option->dirlist_sep))
+ feature_roots += resolvePath(f);
+
+ feature_roots += propertyValue(QLatin1String("QMAKEFEATURES"), false).split(
+ m_option->dirlist_sep, QString::SkipEmptyParts);
+
+ if (!m_option->cachefile.isEmpty()) {
+ QString path = m_option->cachefile.left(m_option->cachefile.lastIndexOf((ushort)'/'));
foreach (const QString &concat_it, concat)
feature_roots << (path + concat_it);
}
- */
- QByteArray qmakepath = qgetenv("QMAKEPATH");
+ QString qmakepath = m_option->getEnv(QLatin1String("QMAKEPATH"));
if (!qmakepath.isNull()) {
- const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath));
+ const QStringList lst = qmakepath.split(m_option->dirlist_sep);
foreach (const QString &item, lst) {
+ QString citem = resolvePath(item);
foreach (const QString &concat_it, concat)
- feature_roots << (item + mkspecs_concat + concat_it);
+ feature_roots << (citem + mkspecs_concat + concat_it);
}
}
- //if (!Option::mkfile::qmakespec.isEmpty())
- // feature_roots << Option::mkfile::qmakespec + QDir::separator() + "features";
- //if (!Option::mkfile::qmakespec.isEmpty()) {
- // QFileInfo specfi(Option::mkfile::qmakespec);
- // QDir specdir(specfi.absoluteFilePath());
- // while (!specdir.isRoot()) {
- // if (!specdir.cdUp() || specdir.isRoot())
- // break;
- // if (QFile::exists(specdir.path() + QDir::separator() + "features")) {
- // foreach (const QString &concat_it, concat)
- // feature_roots << (specdir.path() + concat_it);
- // break;
- // }
- // }
- //}
+
+ if (!m_option->qmakespec.isEmpty()) {
+ QString qmakespec = resolvePath(m_option->qmakespec);
+ feature_roots << (qmakespec + features_concat);
+
+ QDir specdir(qmakespec);
+ while (!specdir.isRoot()) {
+ if (!specdir.cdUp() || specdir.isRoot())
+ break;
+ if (IoUtils::exists(specdir.path() + features_concat)) {
+ foreach (const QString &concat_it, concat)
+ feature_roots << (specdir.path() + concat_it);
+ break;
+ }
+ }
+ }
+
foreach (const QString &concat_it, concat)
- feature_roots << (propertyValue(QLatin1String("QT_INSTALL_PREFIX")) +
+ feature_roots << (propertyValue(QLatin1String("QT_INSTALL_PREFIX"), false) +
mkspecs_concat + concat_it);
foreach (const QString &concat_it, concat)
- feature_roots << (propertyValue(QLatin1String("QT_INSTALL_DATA")) +
+ feature_roots << (propertyValue(QLatin1String("QT_INSTALL_DATA"), false) +
mkspecs_concat + concat_it);
+
+ for (int i = 0; i < feature_roots.count(); ++i)
+ if (!feature_roots.at(i).endsWith((ushort)'/'))
+ feature_roots[i].append((ushort)'/');
+
+ feature_roots.removeDuplicates();
+
return feature_roots;
}
-QString ProFileEvaluator::Private::propertyValue(const QString &name) const
-{
- if (m_properties.contains(name))
- return m_properties.value(name);
- if (name == QLatin1String("QT_INSTALL_PREFIX"))
- return QLibraryInfo::location(QLibraryInfo::PrefixPath);
- if (name == QLatin1String("QT_INSTALL_DATA"))
- return QLibraryInfo::location(QLibraryInfo::DataPath);
- if (name == QLatin1String("QT_INSTALL_DOCS"))
- return QLibraryInfo::location(QLibraryInfo::DocumentationPath);
- if (name == QLatin1String("QT_INSTALL_HEADERS"))
- return QLibraryInfo::location(QLibraryInfo::HeadersPath);
- if (name == QLatin1String("QT_INSTALL_LIBS"))
- return QLibraryInfo::location(QLibraryInfo::LibrariesPath);
- if (name == QLatin1String("QT_INSTALL_BINS"))
- return QLibraryInfo::location(QLibraryInfo::BinariesPath);
- if (name == QLatin1String("QT_INSTALL_PLUGINS"))
- return QLibraryInfo::location(QLibraryInfo::PluginsPath);
- if (name == QLatin1String("QT_INSTALL_TRANSLATIONS"))
- return QLibraryInfo::location(QLibraryInfo::TranslationsPath);
- if (name == QLatin1String("QT_INSTALL_CONFIGURATION"))
- return QLibraryInfo::location(QLibraryInfo::SettingsPath);
- if (name == QLatin1String("QT_INSTALL_EXAMPLES"))
- return QLibraryInfo::location(QLibraryInfo::ExamplesPath);
- if (name == QLatin1String("QT_INSTALL_DEMOS"))
- return QLibraryInfo::location(QLibraryInfo::DemosPath);
+QString ProFileEvaluator::Private::propertyValue(const QString &name, bool complain) const
+{
+ if (m_option->properties.contains(name))
+ return m_option->properties.value(name);
if (name == QLatin1String("QMAKE_MKSPECS"))
- return qmake_mkspec_paths().join(Option::dirlist_sep);
+ return qmakeMkspecPaths().join(m_option->dirlist_sep);
if (name == QLatin1String("QMAKE_VERSION"))
return QLatin1String("1.0"); //### FIXME
- //return qmake_version();
-#ifdef QT_VERSION_STR
- if (name == QLatin1String("QT_VERSION"))
- return QLatin1String(QT_VERSION_STR);
-#endif
- return QLatin1String("UNKNOWN"); //###
+ if (complain)
+ evalError(fL1S("Querying unknown property %1").arg(name));
+ return QString();
}
ProFile *ProFileEvaluator::Private::currentProFile() const
@@ -1057,17 +1577,114 @@ QString ProFileEvaluator::Private::currentDirectory() const
return cur->directoryName();
}
-void ProFileEvaluator::Private::doVariableReplace(QString *str)
+QString ProFileEvaluator::Private::sysrootify(const QString &path, const QString &baseDir) const
{
- *str = expandVariableReferences(*str).join(QString(Option::field_sep));
+ const bool isHostSystemPath = m_option->sysroot.isEmpty() || path.startsWith(m_option->sysroot)
+ || path.startsWith(baseDir) || path.startsWith(m_outputDir);
+ return isHostSystemPath ? path : m_option->sysroot + path;
}
-QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &str)
+#ifndef QT_BOOTSTRAPPED
+void ProFileEvaluator::Private::runProcess(QProcess *proc, const QString &command,
+ QProcess::ProcessChannel chan) const
{
- QStringList ret;
+ proc->setWorkingDirectory(currentDirectory());
+ if (!m_option->environment.isEmpty())
+ proc->setProcessEnvironment(m_option->environment);
+# ifdef Q_OS_WIN
+ proc->setNativeArguments(QLatin1String("/v:off /s /c \"") + command + QLatin1Char('"'));
+ proc->start(m_option->getEnv(QLatin1String("COMSPEC")), QStringList());
+# else
+ proc->start(QLatin1String("/bin/sh"), QStringList() << QLatin1String("-c") << command);
+# endif
+ proc->waitForFinished(-1);
+ proc->setReadChannel(chan);
+ QByteArray errout = proc->readAll();
+ if (errout.endsWith('\n'))
+ errout.chop(1);
+ m_handler->evalError(QString(), 0, QString::fromLocal8Bit(errout));
+}
+#endif
+
+// The (QChar*)current->constData() constructs below avoid pointless detach() calls
+// FIXME: This is inefficient. Should not make new string if it is a straight subsegment
+static ALWAYS_INLINE void appendChar(ushort unicode,
+ QString *current, QChar **ptr, ProString *pending)
+{
+ if (!pending->isEmpty()) {
+ int len = pending->size();
+ current->resize(current->size() + len);
+ ::memcpy((QChar*)current->constData(), pending->constData(), len * 2);
+ pending->clear();
+ *ptr = (QChar*)current->constData() + len;
+ }
+ *(*ptr)++ = QChar(unicode);
+}
+
+static void appendString(const ProString &string,
+ QString *current, QChar **ptr, ProString *pending)
+{
+ if (string.isEmpty())
+ return;
+ QChar *uc = (QChar*)current->constData();
+ int len;
+ if (*ptr != uc) {
+ len = *ptr - uc;
+ current->resize(current->size() + string.size());
+ } else if (!pending->isEmpty()) {
+ len = pending->size();
+ current->resize(current->size() + len + string.size());
+ ::memcpy((QChar*)current->constData(), pending->constData(), len * 2);
+ pending->clear();
+ } else {
+ *pending = string;
+ return;
+ }
+ *ptr = (QChar*)current->constData() + len;
+ ::memcpy(*ptr, string.constData(), string.size() * 2);
+ *ptr += string.size();
+}
+
+static void flushCurrent(ProStringList *ret,
+ QString *current, QChar **ptr, ProString *pending, bool joined)
+{
+ QChar *uc = (QChar*)current->constData();
+ int len = *ptr - uc;
+ if (len) {
+ ret->append(ProString(QString(uc, len), NoHash));
+ *ptr = uc;
+ } else if (!pending->isEmpty()) {
+ ret->append(*pending);
+ pending->clear();
+ } else if (joined) {
+ ret->append(ProString());
+ }
+}
+
+static inline void flushFinal(ProStringList *ret,
+ const QString &current, const QChar *ptr, const ProString &pending,
+ const ProString &str, bool replaced, bool joined)
+{
+ int len = ptr - current.data();
+ if (len) {
+ if (!replaced && len == str.size())
+ ret->append(str);
+ else
+ ret->append(ProString(QString(current.data(), len), NoHash));
+ } else if (!pending.isEmpty()) {
+ ret->append(pending);
+ } else if (joined) {
+ ret->append(ProString());
+ }
+}
+
+ProStringList ProFileEvaluator::Private::expandVariableReferences(
+ const ProString &str, int *pos, bool joined)
+{
+ ProStringList ret;
// if (ok)
// *ok = true;
- if (str.isEmpty())
+ if (str.isEmpty() && !pos)
return ret;
const ushort LSQUARE = '[';
@@ -1082,42 +1699,45 @@ QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &s
const ushort DOT = '.';
const ushort SPACE = ' ';
const ushort TAB = '\t';
+ const ushort COMMA = ',';
const ushort SINGLEQUOTE = '\'';
const ushort DOUBLEQUOTE = '"';
- ushort unicode, quote = 0;
- const QChar *str_data = str.data();
- const int str_len = str.length();
-
- ushort term;
- QString var, args;
-
- int replaced = 0;
- QString current;
- for (int i = 0; i < str_len; ++i) {
- unicode = str_data[i].unicode();
- const int start_var = i;
- if (unicode == DOLLAR && str_len > i+2) {
- unicode = str_data[++i].unicode();
- if (unicode == DOLLAR) {
- term = 0;
- var.clear();
- args.clear();
+ ushort unicode, quote = 0, parens = 0;
+ const ushort *str_data = (const ushort *)str.constData();
+ const int str_len = str.size();
+
+ ProString var, args;
+
+ bool replaced = false;
+ bool putSpace = false;
+ QString current; // Buffer for successively assembled string segments
+ current.resize(str.size());
+ QChar *ptr = current.data();
+ ProString pending; // Buffer for string segments from variables
+ // Only one of the above buffers can be filled at a given time.
+ for (int i = pos ? *pos : 0; i < str_len; ++i) {
+ unicode = str_data[i];
+ if (unicode == DOLLAR) {
+ if (str_len > i+2 && str_data[i+1] == DOLLAR) {
+ ++i;
+ ushort term = 0;
enum { VAR, ENVIRON, FUNCTION, PROPERTY } var_type = VAR;
- unicode = str_data[++i].unicode();
+ unicode = str_data[++i];
if (unicode == LSQUARE) {
- unicode = str_data[++i].unicode();
+ unicode = str_data[++i];
term = RSQUARE;
var_type = PROPERTY;
} else if (unicode == LCURLY) {
- unicode = str_data[++i].unicode();
+ unicode = str_data[++i];
var_type = VAR;
term = RCURLY;
} else if (unicode == LPAREN) {
- unicode = str_data[++i].unicode();
+ unicode = str_data[++i];
var_type = ENVIRON;
term = RPAREN;
}
+ int name_start = i;
forever {
if (!(unicode & (0xFF<<8)) &&
unicode != DOT && unicode != UNDERSCORE &&
@@ -1125,19 +1745,20 @@ QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &s
(unicode < 'a' || unicode > 'z') && (unicode < 'A' || unicode > 'Z') &&
(unicode < '0' || unicode > '9'))
break;
- var.append(QChar(unicode));
if (++i == str_len)
break;
- unicode = str_data[i].unicode();
+ unicode = str_data[i];
// at this point, i points to either the 'term' or 'next' character (which is in unicode)
}
+ var = str.mid(name_start, i - name_start);
if (var_type == VAR && unicode == LPAREN) {
var_type = FUNCTION;
+ name_start = i + 1;
int depth = 0;
forever {
if (++i == str_len)
break;
- unicode = str_data[i].unicode();
+ unicode = str_data[i];
if (unicode == LPAREN) {
depth++;
} else if (unicode == RPAREN) {
@@ -1145,10 +1766,10 @@ QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &s
break;
--depth;
}
- args.append(QChar(unicode));
}
+ args = str.mid(name_start, i - name_start);
if (++i < str_len)
- unicode = str_data[i].unicode();
+ unicode = str_data[i];
else
unicode = 0;
// at this point i is pointing to the 'next' character (which is in unicode)
@@ -1156,232 +1777,415 @@ QStringList ProFileEvaluator::Private::expandVariableReferences(const QString &s
}
if (term) {
if (unicode != term) {
- q->logMessage(format("Missing %1 terminator [found %2]")
- .arg(QChar(term))
- .arg(unicode ? QString(unicode) : QString::fromLatin1(("end-of-line"))));
+ evalError(fL1S("Missing %1 terminator [found %2]")
+ .arg(QChar(term))
+ .arg(unicode ? QString(unicode) : fL1S("end-of-line")));
// if (ok)
// *ok = false;
- return QStringList();
+ if (pos)
+ *pos = str_len;
+ return ProStringList();
}
} else {
// move the 'cursor' back to the last char of the thing we were looking at
--i;
}
- // since i never points to the 'next' character, there is no reason for this to be set
- unicode = 0;
- QStringList replacement;
+ ProStringList replacement;
if (var_type == ENVIRON) {
- replacement = split_value_list(QString::fromLocal8Bit(qgetenv(var.toLatin1().constData())));
+ replacement = split_value_list(m_option->getEnv(var.toQString(m_tmp1)));
} else if (var_type == PROPERTY) {
- replacement << propertyValue(var);
+ replacement << ProString(propertyValue(var.toQString(m_tmp1), true), NoHash);
} else if (var_type == FUNCTION) {
- replacement << evaluateExpandFunction(var, args);
+ replacement += evaluateExpandFunction(var, args);
} else if (var_type == VAR) {
- replacement = values(var);
+ replacement = values(map(var));
}
- if (!(replaced++) && start_var)
- current = str.left(start_var);
if (!replacement.isEmpty()) {
- if (quote) {
- current += replacement.join(QString(Option::field_sep));
+ if (quote || joined) {
+ if (putSpace) {
+ putSpace = false;
+ if (!replacement.at(0).isEmpty()) // Bizarre, indeed
+ appendChar(' ', &current, &ptr, &pending);
+ }
+ appendString(ProString(replacement.join(statics.field_sep), NoHash),
+ &current, &ptr, &pending);
} else {
- current += replacement.takeFirst();
- if (!replacement.isEmpty()) {
- if (!current.isEmpty())
- ret.append(current);
- current = replacement.takeLast();
- if (!replacement.isEmpty())
- ret += replacement;
+ appendString(replacement.at(0), &current, &ptr, &pending);
+ if (replacement.size() > 1) {
+ flushCurrent(&ret, &current, &ptr, &pending, false);
+ int j = 1;
+ if (replacement.size() > 2) {
+ // FIXME: ret.reserve(ret.size() + replacement.size() - 2);
+ for (; j < replacement.size() - 1; ++j)
+ ret << replacement.at(j);
+ }
+ pending = replacement.at(j);
}
}
+ replaced = true;
}
- } else {
- if (replaced)
- current.append(QLatin1Char('$'));
+ continue;
}
- }
- if (quote && unicode == quote) {
- unicode = 0;
- quote = 0;
} else if (unicode == BACKSLASH) {
- bool escape = false;
- const char *symbols = "[]{}()$\\'\"";
- for (const char *s = symbols; *s; ++s) {
- if (str_data[i+1].unicode() == (ushort)*s) {
- i++;
- escape = true;
- if (!(replaced++))
- current = str.left(start_var);
- current.append(str.at(i));
- break;
- }
+ static const char symbols[] = "[]{}()$\\'\"";
+ ushort unicode2 = str_data[i+1];
+ if (!(unicode2 & 0xff00) && strchr(symbols, unicode2)) {
+ unicode = unicode2;
+ ++i;
+ }
+ } else if (quote) {
+ if (unicode == quote) {
+ quote = 0;
+ continue;
}
- if (escape || !replaced)
- unicode =0;
- } else if (!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) {
- quote = unicode;
- unicode = 0;
- if (!(replaced++) && i)
- current = str.left(i);
- } else if (!quote && (unicode == SPACE || unicode == TAB)) {
- unicode = 0;
- if (!current.isEmpty()) {
- ret.append(current);
- current.clear();
+ } else {
+ if (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE) {
+ quote = unicode;
+ continue;
+ } else if (unicode == SPACE || unicode == TAB) {
+ if (!joined)
+ flushCurrent(&ret, &current, &ptr, &pending, false);
+ else if ((ptr - (QChar*)current.constData()) || !pending.isEmpty())
+ putSpace = true;
+ continue;
+ } else if (pos) {
+ if (unicode == LPAREN) {
+ ++parens;
+ } else if (unicode == RPAREN) {
+ --parens;
+ } else if (!parens && unicode == COMMA) {
+ if (!joined) {
+ *pos = i + 1;
+ flushFinal(&ret, current, ptr, pending, str, replaced, false);
+ return ret;
+ }
+ flushCurrent(&ret, &current, &ptr, &pending, true);
+ putSpace = false;
+ continue;
+ }
}
}
- if (replaced && unicode)
- current.append(QChar(unicode));
+ if (putSpace) {
+ putSpace = false;
+ appendChar(' ', &current, &ptr, &pending);
+ }
+ appendChar(unicode, &current, &ptr, &pending);
}
- if (!replaced)
- ret = QStringList(str);
- else if (!current.isEmpty())
- ret.append(current);
+ if (pos)
+ *pos = str_len;
+ flushFinal(&ret, current, ptr, pending, str, replaced, joined);
return ret;
}
+bool ProFileEvaluator::Private::modesForGenerator(const QString &gen,
+ ProFileOption::HOST_MODE *host_mode, ProFileOption::TARG_MODE *target_mode) const
+{
+ if (gen == fL1S("UNIX")) {
+#ifdef Q_OS_MAC
+ *host_mode = ProFileOption::HOST_MACX_MODE;
+ *target_mode = ProFileOption::TARG_MACX_MODE;
+#else
+ *host_mode = ProFileOption::HOST_UNIX_MODE;
+ *target_mode = ProFileOption::TARG_UNIX_MODE;
+#endif
+ } else if (gen == fL1S("MSVC.NET") || gen == fL1S("BMAKE") || gen == fL1S("MSBUILD")) {
+ *host_mode = ProFileOption::HOST_WIN_MODE;
+ *target_mode = ProFileOption::TARG_WIN_MODE;
+ } else if (gen == fL1S("MINGW")) {
+#if defined(Q_OS_MAC)
+ *host_mode = ProFileOption::HOST_MACX_MODE;
+#elif defined(Q_OS_UNIX)
+ *host_mode = ProFileOption::HOST_UNIX_MODE;
+#else
+ *host_mode = ProFileOption::HOST_WIN_MODE;
+#endif
+ *target_mode = ProFileOption::TARG_WIN_MODE;
+ } else if (gen == fL1S("PROJECTBUILDER") || gen == fL1S("XCODE")) {
+ *host_mode = ProFileOption::HOST_MACX_MODE;
+ *target_mode = ProFileOption::TARG_MACX_MODE;
+ } else if (gen == fL1S("SYMBIAN_ABLD") || gen == fL1S("SYMBIAN_SBSV2")
+ || gen == fL1S("SYMBIAN_UNIX") || gen == fL1S("SYMBIAN_MINGW")) {
+#if defined(Q_OS_MAC)
+ *host_mode = ProFileOption::HOST_MACX_MODE;
+#elif defined(Q_OS_UNIX)
+ *host_mode = ProFileOption::HOST_UNIX_MODE;
+#else
+ *host_mode = ProFileOption::HOST_WIN_MODE;
+#endif
+ *target_mode = ProFileOption::TARG_SYMBIAN_MODE;
+ } else {
+ evalError(fL1S("Unknown generator specified: %1").arg(gen));
+ return false;
+ }
+ return true;
+}
+
+void ProFileEvaluator::Private::validateModes() const
+{
+ if (m_option->host_mode == ProFileOption::HOST_UNKNOWN_MODE
+ || m_option->target_mode == ProFileOption::TARG_UNKNOWN_MODE) {
+ const QHash<ProString, ProStringList> &vals =
+ m_option->base_valuemap.isEmpty() ? m_valuemapStack[0] : m_option->base_valuemap;
+ ProFileOption::HOST_MODE host_mode;
+ ProFileOption::TARG_MODE target_mode;
+ const ProStringList &gen = vals.value(ProString("MAKEFILE_GENERATOR"));
+ if (gen.isEmpty()) {
+ evalError(fL1S("Using OS scope before setting MAKEFILE_GENERATOR"));
+ } else if (modesForGenerator(gen.at(0).toQString(), &host_mode, &target_mode)) {
+ if (m_option->host_mode == ProFileOption::HOST_UNKNOWN_MODE) {
+ m_option->host_mode = host_mode;
+ m_option->applyHostMode();
+ }
+
+ if (m_option->target_mode == ProFileOption::TARG_UNKNOWN_MODE) {
+ const ProStringList &tgt = vals.value(ProString("TARGET_PLATFORM"));
+ if (!tgt.isEmpty()) {
+ const QString &os = tgt.at(0).toQString();
+ if (os == statics.strunix)
+ m_option->target_mode = ProFileOption::TARG_UNIX_MODE;
+ else if (os == statics.strmacx)
+ m_option->target_mode = ProFileOption::TARG_MACX_MODE;
+ else if (os == statics.strsymbian)
+ m_option->target_mode = ProFileOption::TARG_SYMBIAN_MODE;
+ else if (os == statics.strwin32)
+ m_option->target_mode = ProFileOption::TARG_WIN_MODE;
+ else
+ evalError(fL1S("Unknown target platform specified: %1").arg(os));
+ } else {
+ m_option->target_mode = target_mode;
+ }
+ }
+ }
+ }
+}
+
bool ProFileEvaluator::Private::isActiveConfig(const QString &config, bool regex)
{
// magic types for easy flipping
- if (config == QLatin1String("true"))
+ if (config == statics.strtrue)
return true;
- if (config == QLatin1String("false"))
+ if (config == statics.strfalse)
return false;
- // mkspecs
- if ((Option::target_mode == Option::TARG_MACX_MODE
- || Option::target_mode == Option::TARG_QNX6_MODE
- || Option::target_mode == Option::TARG_UNIX_MODE)
- && config == QLatin1String("unix"))
- return true;
- if (Option::target_mode == Option::TARG_MACX_MODE && config == QLatin1String("macx"))
- return true;
- if (Option::target_mode == Option::TARG_QNX6_MODE && config == QLatin1String("qnx6"))
- return true;
- if (Option::target_mode == Option::TARG_MAC9_MODE && config == QLatin1String("mac9"))
- return true;
- if ((Option::target_mode == Option::TARG_MAC9_MODE
- || Option::target_mode == Option::TARG_MACX_MODE)
- && config == QLatin1String("mac"))
- return true;
- if (Option::target_mode == Option::TARG_WIN_MODE && config == QLatin1String("win32"))
- return true;
+ if (config == statics.strunix) {
+ validateModes();
+ return m_option->target_mode == ProFileOption::TARG_UNIX_MODE
+ || m_option->target_mode == ProFileOption::TARG_MACX_MODE
+ || m_option->target_mode == ProFileOption::TARG_SYMBIAN_MODE;
+ } else if (config == statics.strmacx || config == statics.strmac) {
+ validateModes();
+ return m_option->target_mode == ProFileOption::TARG_MACX_MODE;
+ } else if (config == statics.strsymbian) {
+ validateModes();
+ return m_option->target_mode == ProFileOption::TARG_SYMBIAN_MODE;
+ } else if (config == statics.strwin32) {
+ validateModes();
+ return m_option->target_mode == ProFileOption::TARG_WIN_MODE;
+ }
- QRegExp re(config, Qt::CaseSensitive, QRegExp::Wildcard);
- QString spec = Option::qmakespec;
- if ((regex && re.exactMatch(spec)) || (!regex && spec == config))
- return true;
+ if (regex && (config.contains(QLatin1Char('*')) || config.contains(QLatin1Char('?')))) {
+ QString cfg = config;
+ cfg.detach(); // Keep m_tmp out of QRegExp's cache
+ QRegExp re(cfg, Qt::CaseSensitive, QRegExp::Wildcard);
+
+ // mkspecs
+ if (re.exactMatch(m_option->qmakespec_name))
+ return true;
+
+ // CONFIG variable
+ int t = 0;
+ foreach (const ProString &configValue, valuesDirect(statics.strCONFIG)) {
+ if (re.exactMatch(configValue.toQString(m_tmp[t])))
+ return true;
+ t ^= 1;
+ }
+ } else {
+ // mkspecs
+ if (m_option->qmakespec_name == config)
+ return true;
+
+ // CONFIG variable
+ if (valuesDirect(statics.strCONFIG).contains(ProString(config, NoHash)))
+ return true;
+ }
return false;
}
-QStringList ProFileEvaluator::Private::evaluateFunction(
- ProBlock *funcPtr, const QStringList &argumentsList, bool *ok)
+ProStringList ProFileEvaluator::Private::expandVariableReferences(
+ const ushort *&tokPtr, int sizeHint, bool joined)
+{
+ ProStringList ret;
+ ret.reserve(sizeHint);
+ forever {
+ evaluateExpression(tokPtr, &ret, joined);
+ switch (*tokPtr) {
+ case TokValueTerminator:
+ case TokFuncTerminator:
+ tokPtr++;
+ return ret;
+ case TokArgSeparator:
+ if (joined) {
+ tokPtr++;
+ continue;
+ }
+ // fallthrough
+ default:
+ Q_ASSERT_X(false, "expandVariableReferences", "Unrecognized token");
+ break;
+ }
+ }
+}
+
+QList<ProStringList> ProFileEvaluator::Private::prepareFunctionArgs(const ushort *&tokPtr)
+{
+ QList<ProStringList> args_list;
+ if (*tokPtr != TokFuncTerminator) {
+ for (;; tokPtr++) {
+ ProStringList arg;
+ evaluateExpression(tokPtr, &arg, false);
+ args_list << arg;
+ if (*tokPtr == TokFuncTerminator)
+ break;
+ Q_ASSERT(*tokPtr == TokArgSeparator);
+ }
+ }
+ tokPtr++;
+ return args_list;
+}
+
+QList<ProStringList> ProFileEvaluator::Private::prepareFunctionArgs(const ProString &arguments)
+{
+ QList<ProStringList> args_list;
+ for (int pos = 0; pos < arguments.size(); )
+ args_list << expandVariableReferences(arguments, &pos);
+ return args_list;
+}
+
+ProStringList ProFileEvaluator::Private::evaluateFunction(
+ const FunctionDef &func, const QList<ProStringList> &argumentsList, bool *ok)
{
bool oki;
- QStringList ret;
+ ProStringList ret;
if (m_valuemapStack.count() >= 100) {
- q->errorMessage(format("ran into infinite recursion (depth > 100)."));
+ evalError(fL1S("ran into infinite recursion (depth > 100)."));
oki = false;
} else {
- State sts = m_sts;
- m_valuemapStack.push(m_valuemap);
- m_filevaluemapStack.push(m_filevaluemap);
+ m_valuemapStack.push(QHash<ProString, ProStringList>());
+ m_locationStack.push(m_current);
+ int loopLevel = m_loopLevel;
+ m_loopLevel = 0;
- QStringList args;
+ ProStringList args;
for (int i = 0; i < argumentsList.count(); ++i) {
- QStringList theArgs = expandVariableReferences(argumentsList[i]);
- args += theArgs;
- m_valuemap[QString::number(i+1)] = theArgs;
+ args += argumentsList[i];
+ m_valuemapStack.top()[ProString(QString::number(i+1))] = argumentsList[i];
}
- m_valuemap[QLatin1String("ARGS")] = args;
- oki = (funcPtr->Accept(this) != ProItem::ReturnFalse); // True || Return
+ m_valuemapStack.top()[statics.strARGS] = args;
+ oki = (visitProBlock(func.pro(), func.tokPtr()) != ReturnFalse); // True || Return
ret = m_returnValue;
m_returnValue.clear();
- m_valuemap = m_valuemapStack.pop();
- m_filevaluemap = m_filevaluemapStack.pop();
- m_sts = sts;
+ m_loopLevel = loopLevel;
+ m_current = m_locationStack.pop();
+ m_valuemapStack.pop();
}
if (ok)
*ok = oki;
if (oki)
return ret;
- return QStringList();
-}
-
-QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &func, const QString &arguments)
-{
- QStringList argumentsList = split_arg_list(arguments);
-
- if (ProBlock *funcPtr = m_replaceFunctions.value(func, 0))
- return evaluateFunction(funcPtr, argumentsList, 0);
-
- QStringList args;
- for (int i = 0; i < argumentsList.count(); ++i)
- args += expandVariableReferences(argumentsList[i]).join(Option::field_sep);
-
- enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST,
- E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
- E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND,
- E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE,
- E_REPLACE };
-
- static QHash<QString, int> expands;
- if (expands.isEmpty()) {
- expands.insert(QLatin1String("member"), E_MEMBER);
- expands.insert(QLatin1String("first"), E_FIRST);
- expands.insert(QLatin1String("last"), E_LAST);
- expands.insert(QLatin1String("cat"), E_CAT);
- expands.insert(QLatin1String("fromfile"), E_FROMFILE); // implementation disabled (see comment below)
- expands.insert(QLatin1String("eval"), E_EVAL);
- expands.insert(QLatin1String("list"), E_LIST);
- expands.insert(QLatin1String("sprintf"), E_SPRINTF);
- expands.insert(QLatin1String("join"), E_JOIN);
- expands.insert(QLatin1String("split"), E_SPLIT);
- expands.insert(QLatin1String("basename"), E_BASENAME);
- expands.insert(QLatin1String("dirname"), E_DIRNAME);
- expands.insert(QLatin1String("section"), E_SECTION);
- expands.insert(QLatin1String("find"), E_FIND);
- expands.insert(QLatin1String("system"), E_SYSTEM);
- expands.insert(QLatin1String("unique"), E_UNIQUE);
- expands.insert(QLatin1String("quote"), E_QUOTE);
- expands.insert(QLatin1String("escape_expand"), E_ESCAPE_EXPAND);
- expands.insert(QLatin1String("upper"), E_UPPER);
- expands.insert(QLatin1String("lower"), E_LOWER);
- expands.insert(QLatin1String("re_escape"), E_RE_ESCAPE);
- expands.insert(QLatin1String("files"), E_FILES);
- expands.insert(QLatin1String("prompt"), E_PROMPT); // interactive, so cannot be implemented
- expands.insert(QLatin1String("replace"), E_REPLACE);
+ return ProStringList();
+}
+
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateBoolFunction(
+ const FunctionDef &func, const QList<ProStringList> &argumentsList,
+ const ProString &function)
+{
+ bool ok;
+ ProStringList ret = evaluateFunction(func, argumentsList, &ok);
+ if (ok) {
+ if (ret.isEmpty())
+ return ReturnTrue;
+ if (ret.at(0) != statics.strfalse) {
+ if (ret.at(0) == statics.strtrue)
+ return ReturnTrue;
+ int val = ret.at(0).toQString(m_tmp1).toInt(&ok);
+ if (ok) {
+ if (val)
+ return ReturnTrue;
+ } else {
+ evalError(fL1S("Unexpected return value from test '%1': %2")
+ .arg(function.toQString(m_tmp1))
+ .arg(ret.join(QLatin1String(" :: "))));
+ }
+ }
}
- ExpandFunc func_t = ExpandFunc(expands.value(func.toLower()));
+ return ReturnFalse;
+}
- QStringList ret;
+ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
+ const ProString &func, const ushort *&tokPtr)
+{
+ QHash<ProString, FunctionDef>::ConstIterator it =
+ m_functionDefs.replaceFunctions.constFind(func);
+ if (it != m_functionDefs.replaceFunctions.constEnd())
+ return evaluateFunction(*it, prepareFunctionArgs(tokPtr), 0);
+
+ //why don't the builtin functions just use args_list? --Sam
+ return evaluateExpandFunction(func, expandVariableReferences(tokPtr, 5, true));
+}
+
+ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
+ const ProString &func, const ProString &arguments)
+{
+ QHash<ProString, FunctionDef>::ConstIterator it =
+ m_functionDefs.replaceFunctions.constFind(func);
+ if (it != m_functionDefs.replaceFunctions.constEnd())
+ return evaluateFunction(*it, prepareFunctionArgs(arguments), 0);
+
+ //why don't the builtin functions just use args_list? --Sam
+ int pos = 0;
+ return evaluateExpandFunction(func, expandVariableReferences(arguments, &pos, true));
+}
+
+ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
+ const ProString &func, const ProStringList &args)
+{
+ ExpandFunc func_t = ExpandFunc(statics.expands.value(func));
+ if (func_t == 0) {
+ const QString &fn = func.toQString(m_tmp1);
+ const QString &lfn = fn.toLower();
+ if (!fn.isSharedWith(lfn))
+ func_t = ExpandFunc(statics.expands.value(ProString(lfn)));
+ }
+
+ ProStringList ret;
switch (func_t) {
case E_BASENAME:
case E_DIRNAME:
case E_SECTION: {
bool regexp = false;
- QString sep, var;
+ QString sep;
+ ProString var;
int beg = 0;
int end = -1;
if (func_t == E_SECTION) {
if (args.count() != 3 && args.count() != 4) {
- q->logMessage(format("%1(var) section(var, sep, begin, end) "
- "requires three or four arguments.").arg(func));
+ evalError(fL1S("%1(var) section(var, sep, begin, end) requires"
+ " three or four arguments.").arg(func.toQString(m_tmp1)));
} else {
var = args[0];
- sep = args[1];
- beg = args[2].toInt();
+ sep = args.at(1).toQString();
+ beg = args.at(2).toQString(m_tmp2).toInt();
if (args.count() == 4)
- end = args[3].toInt();
+ end = args.at(3).toQString(m_tmp2).toInt();
}
} else {
if (args.count() != 1) {
- q->logMessage(format("%1(var) requires one argument.").arg(func));
+ evalError(fL1S("%1(var) requires one argument.").arg(func.toQString(m_tmp1)));
} else {
var = args[0];
regexp = true;
@@ -1392,67 +2196,81 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
beg = -1;
}
}
- if (!var.isNull()) {
- foreach (const QString str, values(var)) {
- if (regexp)
- ret += str.section(QRegExp(sep), beg, end);
- else
- ret += str.section(sep, beg, end);
+ if (!var.isEmpty()) {
+ if (regexp) {
+ QRegExp sepRx(sep);
+ foreach (const ProString &str, values(map(var))) {
+ const QString &rstr = str.toQString(m_tmp1).section(sepRx, beg, end);
+ ret << (rstr.isSharedWith(m_tmp1) ? str : ProString(rstr, NoHash).setSource(str));
+ }
+ } else {
+ foreach (const ProString &str, values(map(var))) {
+ const QString &rstr = str.toQString(m_tmp1).section(sep, beg, end);
+ ret << (rstr.isSharedWith(m_tmp1) ? str : ProString(rstr, NoHash).setSource(str));
+ }
}
}
break;
}
case E_SPRINTF:
if(args.count() < 1) {
- q->logMessage(format("sprintf(format, ...) requires at least one argument"));
+ evalError(fL1S("sprintf(format, ...) requires at least one argument"));
} else {
- QString tmp = args.at(0);
+ QString tmp = args.at(0).toQString(m_tmp1);
for (int i = 1; i < args.count(); ++i)
- tmp = tmp.arg(args.at(i));
+ tmp = tmp.arg(args.at(i).toQString(m_tmp2));
+ // Note: this depends on split_value_list() making a deep copy
ret = split_value_list(tmp);
}
break;
case E_JOIN: {
if (args.count() < 1 || args.count() > 4) {
- q->logMessage(format("join(var, glue, before, after) requires one to four arguments."));
+ evalError(fL1S("join(var, glue, before, after) requires one to four arguments."));
} else {
- QString glue, before, after;
+ QString glue;
+ ProString before, after;
if (args.count() >= 2)
- glue = args[1];
+ glue = args.at(1).toQString(m_tmp1);
if (args.count() >= 3)
before = args[2];
if (args.count() == 4)
after = args[3];
- const QStringList &var = values(args.first());
- if (!var.isEmpty())
- ret.append(before + var.join(glue) + after);
+ const ProStringList &var = values(map(args.at(0)));
+ if (!var.isEmpty()) {
+ const ProFile *src = currentProFile();
+ foreach (const ProString &v, var)
+ if (const ProFile *s = v.sourceFile()) {
+ src = s;
+ break;
+ }
+ ret.append(ProString(before + var.join(glue) + after, NoHash).setSource(src));
+ }
}
break;
}
- case E_SPLIT: {
+ case E_SPLIT:
if (args.count() != 2) {
- q->logMessage(format("split(var, sep) requires one or two arguments"));
+ evalError(fL1S("split(var, sep) requires one or two arguments"));
} else {
- const QString &sep = (args.count() == 2) ? args[1] : QString(Option::field_sep);
- foreach (const QString &var, values(args.first()))
- foreach (const QString &splt, var.split(sep))
- ret.append(splt);
+ const QString &sep = (args.count() == 2) ? args.at(1).toQString(m_tmp1) : statics.field_sep;
+ foreach (const ProString &var, values(map(args.at(0))))
+ foreach (const QString &splt, var.toQString(m_tmp2).split(sep))
+ ret << (splt.isSharedWith(m_tmp2) ? var : ProString(splt, NoHash).setSource(var));
}
break;
- }
- case E_MEMBER: {
+ case E_MEMBER:
if (args.count() < 1 || args.count() > 3) {
- q->logMessage(format("member(var, start, end) requires one to three arguments."));
+ evalError(fL1S("member(var, start, end) requires one to three arguments."));
} else {
bool ok = true;
- const QStringList var = values(args.first());
+ const ProStringList &var = values(map(args.at(0)));
int start = 0, end = 0;
if (args.count() >= 2) {
- QString start_str = args[1];
+ const QString &start_str = args.at(1).toQString(m_tmp1);
start = start_str.toInt(&ok);
if (!ok) {
if (args.count() == 2) {
- int dotdot = start_str.indexOf(QLatin1String(".."));
+ int dotdot = start_str.indexOf(statics.strDotDot);
if (dotdot != -1) {
start = start_str.left(dotdot).toInt(&ok);
if (ok)
@@ -1460,15 +2278,15 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
}
}
if (!ok)
- q->logMessage(format("member() argument 2 (start) '%2' invalid.")
- .arg(start_str));
+ evalError(fL1S("member() argument 2 (start) '%2' invalid.")
+ .arg(start_str));
} else {
end = start;
if (args.count() == 3)
- end = args[2].toInt(&ok);
+ end = args.at(2).toQString(m_tmp1).toInt(&ok);
if (!ok)
- q->logMessage(format("member() argument 3 (end) '%2' invalid.\n")
- .arg(args[2]));
+ evalError(fL1S("member() argument 3 (end) '%2' invalid.\n")
+ .arg(args.at(2).toQString(m_tmp1)));
}
}
if (ok) {
@@ -1488,13 +2306,12 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
}
}
break;
- }
case E_FIRST:
- case E_LAST: {
+ case E_LAST:
if (args.count() != 1) {
- q->logMessage(format("%1(var) requires one argument.").arg(func));
+ evalError(fL1S("%1(var) requires one argument.").arg(func.toQString(m_tmp1)));
} else {
- const QStringList var = values(args.first());
+ const ProStringList &var = values(map(args.at(0)));
if (!var.isEmpty()) {
if (func_t == E_FIRST)
ret.append(var[0]);
@@ -1503,92 +2320,96 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
}
}
break;
- }
+ case E_SIZE:
+ if (args.count() != 1)
+ evalError(fL1S("size(var) requires one argument."));
+ else
+ ret.append(ProString(QString::number(values(map(args.at(0))).size()), NoHash));
+ break;
case E_CAT:
if (args.count() < 1 || args.count() > 2) {
- q->logMessage(format("cat(file, singleline=true) requires one or two arguments."));
+ evalError(fL1S("cat(file, singleline=true) requires one or two arguments."));
} else {
- QString file = args[0];
- file = Option::fixPathToLocalOS(file);
+ const QString &file = args.at(0).toQString(m_tmp1);
bool singleLine = true;
if (args.count() > 1)
- singleLine = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive));
+ singleLine = isTrue(args.at(1), m_tmp2);
- QFile qfile(file);
+ QFile qfile(resolvePath(expandEnvVars(file)));
if (qfile.open(QIODevice::ReadOnly)) {
QTextStream stream(&qfile);
while (!stream.atEnd()) {
ret += split_value_list(stream.readLine().trimmed());
if (!singleLine)
- ret += QLatin1String("\n");
+ ret += ProString("\n", NoHash);
}
qfile.close();
}
}
break;
-#if 0 // Used only by Qt's configure for caching
case E_FROMFILE:
if (args.count() != 2) {
- q->logMessage(format("fromfile(file, variable) requires two arguments."));
+ evalError(fL1S("fromfile(file, variable) requires two arguments."));
} else {
- QString file = args[0], seek_variableName = args[1];
-
- ProFile pro(Option::fixPathToLocalOS(file));
-
- ProFileEvaluator visitor;
- visitor.setVerbose(m_verbose);
- visitor.setCumulative(m_cumulative);
-
- if (!visitor.queryProFile(&pro))
- break;
-
- if (!visitor.accept(&pro))
- break;
-
- ret = visitor.values(seek_variableName);
+ QHash<ProString, ProStringList> vars;
+ QString fn = resolvePath(expandEnvVars(args.at(0).toQString(m_tmp1)));
+ fn.detach();
+ if (evaluateFileInto(fn, ProFileEvaluatorHandler::EvalAuxFile,
+ &vars, &m_functionDefs, EvalWithDefaults))
+ ret = vars.value(map(args.at(1)));
}
break;
-#endif
- case E_EVAL: {
+ case E_EVAL:
if (args.count() != 1) {
- q->logMessage(format("eval(variable) requires one argument"));
-
+ evalError(fL1S("eval(variable) requires one argument"));
} else {
- ret += values(args.at(0));
+ ret += values(map(args.at(0)));
}
- break; }
+ break;
case E_LIST: {
- static int x = 0;
QString tmp;
- tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", x++);
- ret = QStringList(tmp);
- QStringList lst;
- foreach (const QString &arg, args)
- lst += split_value_list(arg);
- m_valuemap[tmp] = lst;
+ tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++);
+ ret = ProStringList(ProString(tmp, NoHash));
+ ProStringList lst;
+ foreach (const ProString &arg, args)
+ lst += split_value_list(arg.toQString(m_tmp1), arg.sourceFile()); // Relies on deep copy
+ m_valuemapStack.top()[ret.at(0)] = lst;
break; }
case E_FIND:
if (args.count() != 2) {
- q->logMessage(format("find(var, str) requires two arguments."));
+ evalError(fL1S("find(var, str) requires two arguments."));
} else {
- QRegExp regx(args[1]);
- foreach (const QString &val, values(args.first()))
- if (regx.indexIn(val) != -1)
+ QRegExp regx(args.at(1).toQString());
+ int t = 0;
+ foreach (const ProString &val, values(map(args.at(0)))) {
+ if (regx.indexIn(val.toQString(m_tmp[t])) != -1)
ret += val;
+ t ^= 1;
+ }
}
break;
case E_SYSTEM:
if (!m_skipLevel) {
if (args.count() < 1 || args.count() > 2) {
- q->logMessage(format("system(execute) requires one or two arguments."));
+ evalError(fL1S("system(execute) requires one or two arguments."));
} else {
- char buff[256];
- FILE *proc = QT_POPEN(args[0].toLatin1(), "r");
bool singleLine = true;
if (args.count() > 1)
- singleLine = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive));
- QString output;
+ singleLine = isTrue(args.at(1), m_tmp2);
+ QByteArray output;
+#ifndef QT_BOOTSTRAPPED
+ QProcess proc;
+ runProcess(&proc, args.at(0).toQString(m_tmp2), QProcess::StandardError);
+ output = proc.readAllStandardOutput();
+ output.replace('\t', ' ');
+ if (singleLine)
+ output.replace('\n', ' ');
+#else
+ char buff[256];
+ FILE *proc = QT_POPEN(QString(QLatin1String("cd ")
+ + IoUtils::shellQuote(currentDirectory())
+ + QLatin1String(" && ") + args[0]).toLocal8Bit(), "r");
while (proc && !feof(proc)) {
int read_in = int(fread(buff, 1, 255, proc));
if (!read_in)
@@ -1597,32 +2418,31 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
if ((singleLine && buff[i] == '\n') || buff[i] == '\t')
buff[i] = ' ';
}
- buff[read_in] = '\0';
- output += QLatin1String(buff);
+ output.append(buff, read_in);
}
- ret += split_value_list(output);
if (proc)
QT_PCLOSE(proc);
+#endif
+ ret += split_value_list(QString::fromLocal8Bit(output));
}
}
break;
case E_UNIQUE:
if(args.count() != 1) {
- q->logMessage(format("unique(var) requires one argument."));
+ evalError(fL1S("unique(var) requires one argument."));
} else {
- foreach (const QString &var, values(args.first()))
- if (!ret.contains(var))
- ret.append(var);
+ ret = values(map(args.at(0)));
+ ret.removeDuplicates();
}
break;
case E_QUOTE:
- for (int i = 0; i < args.count(); ++i)
- ret += QStringList(args.at(i));
+ ret += args;
break;
case E_ESCAPE_EXPAND:
for (int i = 0; i < args.size(); ++i) {
- QChar *i_data = args[i].data();
- int i_len = args[i].length();
+ QString str = args.at(i).toQString();
+ QChar *i_data = str.data();
+ int i_len = str.length();
for (int x = 0; x < i_len; ++x) {
if (*(i_data+x) == QLatin1Char('\\') && x < i_len-1) {
if (*(i_data+x+1) == QLatin1Char('\\')) {
@@ -1648,299 +2468,238 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
}
}
}
- ret.append(QString(i_data, i_len));
+ ret.append(ProString(QString(i_data, i_len), NoHash).setSource(args.at(i)));
}
break;
case E_RE_ESCAPE:
- for (int i = 0; i < args.size(); ++i)
- ret += QRegExp::escape(args[i]);
+ for (int i = 0; i < args.size(); ++i) {
+ const QString &rstr = QRegExp::escape(args.at(i).toQString(m_tmp1));
+ ret << (rstr.isSharedWith(m_tmp1) ? args.at(i) : ProString(rstr, NoHash).setSource(args.at(i)));
+ }
break;
case E_UPPER:
case E_LOWER:
- for (int i = 0; i < args.count(); ++i)
- if (func_t == E_UPPER)
- ret += args[i].toUpper();
- else
- ret += args[i].toLower();
+ for (int i = 0; i < args.count(); ++i) {
+ QString rstr = args.at(i).toQString(m_tmp1);
+ rstr = (func_t == E_UPPER) ? rstr.toUpper() : rstr.toLower();
+ ret << (rstr.isSharedWith(m_tmp1) ? args.at(i) : ProString(rstr, NoHash).setSource(args.at(i)));
+ }
break;
case E_FILES:
if (args.count() != 1 && args.count() != 2) {
- q->logMessage(format("files(pattern, recursive=false) requires one or two arguments"));
+ evalError(fL1S("files(pattern, recursive=false) requires one or two arguments"));
} else {
bool recursive = false;
if (args.count() == 2)
- recursive = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive) || args[1].toInt());
+ recursive = isTrue(args.at(1), m_tmp2);
QStringList dirs;
- QString r = Option::fixPathToLocalOS(args[0]);
+ QString r = fixPathToLocalOS(args.at(0).toQString(m_tmp1));
+ QString pfx;
+ if (IoUtils::isRelativePath(r)) {
+ pfx = currentDirectory();
+ if (!pfx.endsWith(QLatin1Char('/')))
+ pfx += QLatin1Char('/');
+ }
int slash = r.lastIndexOf(QDir::separator());
if (slash != -1) {
- dirs.append(r.left(slash));
+ dirs.append(r.left(slash+1));
r = r.mid(slash+1);
} else {
dirs.append(QString());
}
+ r.detach(); // Keep m_tmp out of QRegExp's cache
const QRegExp regex(r, Qt::CaseSensitive, QRegExp::Wildcard);
for (int d = 0; d < dirs.count(); d++) {
QString dir = dirs[d];
- if (!dir.isEmpty() && !dir.endsWith(Option::dir_sep))
- dir += QLatin1Char('/');
-
- QDir qdir(dir);
+ QDir qdir(pfx + dir);
for (int i = 0; i < (int)qdir.count(); ++i) {
- if (qdir[i] == QLatin1String(".") || qdir[i] == QLatin1String(".."))
+ if (qdir[i] == statics.strDot || qdir[i] == statics.strDotDot)
continue;
QString fname = dir + qdir[i];
- if (QFileInfo(fname).isDir()) {
+ if (IoUtils::fileType(pfx + fname) == IoUtils::FileIsDir) {
if (recursive)
- dirs.append(fname);
+ dirs.append(fname + QDir::separator());
}
if (regex.exactMatch(qdir[i]))
- ret += fname;
+ ret += ProString(fname, NoHash).setSource(currentProFile());
}
}
}
break;
case E_REPLACE:
if(args.count() != 3 ) {
- q->logMessage(format("replace(var, before, after) requires three arguments"));
+ evalError(fL1S("replace(var, before, after) requires three arguments"));
} else {
- const QRegExp before(args[1]);
- const QString after(args[2]);
- foreach (QString val, values(args.first()))
- ret += val.replace(before, after);
+ const QRegExp before(args.at(1).toQString());
+ const QString &after(args.at(2).toQString(m_tmp2));
+ foreach (const ProString &val, values(map(args.at(0)))) {
+ QString rstr = val.toQString(m_tmp1);
+ QString copy = rstr; // Force a detach on modify
+ rstr.replace(before, after);
+ ret << (rstr.isSharedWith(m_tmp1) ? val : ProString(rstr, NoHash).setSource(val));
+ }
}
break;
- case 0:
- q->logMessage(format("'%1' is not a recognized replace function").arg(func));
+ case E_INVALID:
+ evalError(fL1S("'%1' is not a recognized replace function")
+ .arg(func.toQString(m_tmp1)));
break;
default:
- q->logMessage(format("Function '%1' is not implemented").arg(func));
+ evalError(fL1S("Function '%1' is not implemented").arg(func.toQString(m_tmp1)));
break;
}
return ret;
}
-ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
- const QString &function, const QString &arguments)
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(
+ const ProString &function, const ProString &arguments)
{
- QStringList argumentsList = split_arg_list(arguments);
+ QHash<ProString, FunctionDef>::ConstIterator it =
+ m_functionDefs.testFunctions.constFind(function);
+ if (it != m_functionDefs.testFunctions.constEnd())
+ return evaluateBoolFunction(*it, prepareFunctionArgs(arguments), function);
- if (ProBlock *funcPtr = m_testFunctions.value(function, 0)) {
- bool ok;
- QStringList ret = evaluateFunction(funcPtr, argumentsList, &ok);
- if (ok) {
- if (ret.isEmpty()) {
- return ProItem::ReturnTrue;
- } else {
- if (ret.first() != QLatin1String("false")) {
- if (ret.first() == QLatin1String("true")) {
- return ProItem::ReturnTrue;
- } else {
- bool ok;
- int val = ret.first().toInt(&ok);
- if (ok) {
- if (val)
- return ProItem::ReturnTrue;
- } else {
- q->logMessage(format("Unexpected return value from test '%1': %2")
- .arg(function).arg(ret.join(QLatin1String(" :: "))));
- }
- }
- }
- }
- }
- return ProItem::ReturnFalse;
- }
+ //why don't the builtin functions just use args_list? --Sam
+ int pos = 0;
+ return evaluateConditionalFunction(function, expandVariableReferences(arguments, &pos, true));
+}
- QString sep;
- sep.append(Option::field_sep);
- QStringList args;
- for (int i = 0; i < argumentsList.count(); ++i)
- args += expandVariableReferences(argumentsList[i]).join(sep);
-
- enum TestFunc { T_REQUIRES=1, T_GREATERTHAN, T_LESSTHAN, T_EQUALS,
- T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM,
- T_RETURN, T_BREAK, T_NEXT, T_DEFINED, T_CONTAINS, T_INFILE,
- T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_MESSAGE, T_IF,
- T_FOR, T_DEFINE_TEST, T_DEFINE_REPLACE };
-
- static QHash<QString, int> functions;
- if (functions.isEmpty()) {
- functions.insert(QLatin1String("requires"), T_REQUIRES);
- functions.insert(QLatin1String("greaterThan"), T_GREATERTHAN);
- functions.insert(QLatin1String("lessThan"), T_LESSTHAN);
- functions.insert(QLatin1String("equals"), T_EQUALS);
- functions.insert(QLatin1String("isEqual"), T_EQUALS);
- functions.insert(QLatin1String("exists"), T_EXISTS);
- functions.insert(QLatin1String("export"), T_EXPORT);
- functions.insert(QLatin1String("clear"), T_CLEAR);
- functions.insert(QLatin1String("unset"), T_UNSET);
- functions.insert(QLatin1String("eval"), T_EVAL);
- functions.insert(QLatin1String("CONFIG"), T_CONFIG);
- functions.insert(QLatin1String("if"), T_IF);
- functions.insert(QLatin1String("isActiveConfig"), T_CONFIG);
- functions.insert(QLatin1String("system"), T_SYSTEM);
- functions.insert(QLatin1String("return"), T_RETURN);
- functions.insert(QLatin1String("break"), T_BREAK);
- functions.insert(QLatin1String("next"), T_NEXT);
- functions.insert(QLatin1String("defined"), T_DEFINED);
- functions.insert(QLatin1String("contains"), T_CONTAINS);
- functions.insert(QLatin1String("infile"), T_INFILE);
- functions.insert(QLatin1String("count"), T_COUNT);
- functions.insert(QLatin1String("isEmpty"), T_ISEMPTY);
- functions.insert(QLatin1String("load"), T_LOAD); //v
- functions.insert(QLatin1String("include"), T_INCLUDE); //v
- functions.insert(QLatin1String("debug"), T_DEBUG);
- functions.insert(QLatin1String("message"), T_MESSAGE); //v
- functions.insert(QLatin1String("warning"), T_MESSAGE); //v
- functions.insert(QLatin1String("error"), T_MESSAGE); //v
- functions.insert(QLatin1String("for"), T_FOR); //v
- functions.insert(QLatin1String("defineTest"), T_DEFINE_TEST); //v
- functions.insert(QLatin1String("defineReplace"), T_DEFINE_REPLACE); //v
- }
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(
+ const ProString &function, const ushort *&tokPtr)
+{
+ QHash<ProString, FunctionDef>::ConstIterator it =
+ m_functionDefs.testFunctions.constFind(function);
+ if (it != m_functionDefs.testFunctions.constEnd())
+ return evaluateBoolFunction(*it, prepareFunctionArgs(tokPtr), function);
+
+ //why don't the builtin functions just use args_list? --Sam
+ return evaluateConditionalFunction(function, expandVariableReferences(tokPtr, 5, true));
+}
- TestFunc func_t = (TestFunc)functions.value(function);
+ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(
+ const ProString &function, const ProStringList &args)
+{
+ TestFunc func_t = (TestFunc)statics.functions.value(function);
switch (func_t) {
- case T_DEFINE_TEST:
- m_definingTest = true;
- goto defineFunc;
- case T_DEFINE_REPLACE:
- m_definingTest = false;
- defineFunc:
- if (args.count() != 1) {
- q->logMessage(format("%s(function) requires one argument.").arg(function));
- return ProItem::ReturnFalse;
- }
- m_definingFunc = args.first();
- return ProItem::ReturnTrue;
case T_DEFINED:
if (args.count() < 1 || args.count() > 2) {
- q->logMessage(format("defined(function, [\"test\"|\"replace\"])"
- " requires one or two arguments."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("defined(function, [\"test\"|\"replace\"])"
+ " requires one or two arguments."));
+ return ReturnFalse;
}
if (args.count() > 1) {
if (args[1] == QLatin1String("test"))
- return returnBool(m_testFunctions.contains(args[0]));
+ return returnBool(m_functionDefs.testFunctions.contains(args[0]));
else if (args[1] == QLatin1String("replace"))
- return returnBool(m_replaceFunctions.contains(args[0]));
- q->logMessage(format("defined(function, type):"
- " unexpected type [%1].\n").arg(args[1]));
- return ProItem::ReturnFalse;
+ return returnBool(m_functionDefs.replaceFunctions.contains(args[0]));
+ evalError(fL1S("defined(function, type): unexpected type [%1].\n")
+ .arg(args.at(1).toQString(m_tmp1)));
+ return ReturnFalse;
}
- return returnBool(m_replaceFunctions.contains(args[0])
- || m_testFunctions.contains(args[0]));
+ return returnBool(m_functionDefs.replaceFunctions.contains(args[0])
+ || m_functionDefs.testFunctions.contains(args[0]));
case T_RETURN:
m_returnValue = args;
// It is "safe" to ignore returns - due to qmake brokeness
// they cannot be used to terminate loops anyway.
if (m_skipLevel || m_cumulative)
- return ProItem::ReturnTrue;
+ return ReturnTrue;
if (m_valuemapStack.isEmpty()) {
- q->logMessage(format("unexpected return()."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("unexpected return()."));
+ return ReturnFalse;
}
- return ProItem::ReturnReturn;
- case T_EXPORT:
+ return ReturnReturn;
+ case T_EXPORT: {
if (m_skipLevel && !m_cumulative)
- return ProItem::ReturnTrue;
+ return ReturnTrue;
if (args.count() != 1) {
- q->logMessage(format("export(variable) requires one argument."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("export(variable) requires one argument."));
+ return ReturnFalse;
+ }
+ const ProString &var = map(args.at(0));
+ for (int i = m_valuemapStack.size(); --i > 0; ) {
+ QHash<ProString, ProStringList>::Iterator it = m_valuemapStack[i].find(var);
+ if (it != m_valuemapStack.at(i).end()) {
+ if (it->constBegin() == statics.fakeValue.constBegin()) {
+ // This is stupid, but qmake doesn't propagate deletions
+ m_valuemapStack[0][var] = ProStringList();
+ } else {
+ m_valuemapStack[0][var] = *it;
+ }
+ m_valuemapStack[i].erase(it);
+ while (--i)
+ m_valuemapStack[i].remove(var);
+ break;
+ }
}
- for (int i = 0; i < m_valuemapStack.size(); ++i) {
- m_valuemapStack[i][args[0]] = m_valuemap[args[0]];
- m_filevaluemapStack[i][currentProFile()][args[0]] =
- m_filevaluemap[currentProFile()][args[0]];
+ return ReturnTrue;
+ }
+ case T_INFILE:
+ if (args.count() < 2 || args.count() > 3) {
+ evalError(fL1S("infile(file, var, [values]) requires two or three arguments."));
+ } else {
+ QHash<ProString, ProStringList> vars;
+ QString fn = resolvePath(expandEnvVars(args.at(0).toQString(m_tmp1)));
+ fn.detach();
+ if (!evaluateFileInto(fn, ProFileEvaluatorHandler::EvalAuxFile,
+ &vars, &m_functionDefs, EvalWithDefaults))
+ return ReturnFalse;
+ if (args.count() == 2)
+ return returnBool(vars.contains(args.at(1)));
+ QRegExp regx;
+ const QString &qry = args.at(2).toQString(m_tmp1);
+ if (qry != QRegExp::escape(qry)) {
+ QString copy = qry;
+ copy.detach();
+ regx.setPattern(copy);
+ }
+ int t = 0;
+ foreach (const ProString &s, vars.value(map(args.at(1)))) {
+ if ((!regx.isEmpty() && regx.exactMatch(s.toQString(m_tmp[t]))) || s == qry)
+ return ReturnTrue;
+ t ^= 1;
+ }
}
- return ProItem::ReturnTrue;
+ return ReturnFalse;
#if 0
- case T_INFILE:
case T_REQUIRES:
- case T_EVAL:
#endif
- case T_FOR: {
- if (m_cumulative) // This is a no-win situation, so just pretend it's no loop
- return ProItem::ReturnTrue;
- if (m_skipLevel)
- return ProItem::ReturnFalse;
- if (args.count() > 2 || args.count() < 1) {
- q->logMessage(format("for({var, list|var, forever|ever})"
- " requires one or two arguments."));
- return ProItem::ReturnFalse;
- }
- ProLoop loop;
- loop.infinite = false;
- loop.index = 0;
- QString it_list;
- if (args.count() == 1) {
- doVariableReplace(&args[0]);
- it_list = args[0];
- if (args[0] != QLatin1String("ever")) {
- q->logMessage(format("for({var, list|var, forever|ever})"
- " requires one or two arguments."));
- return ProItem::ReturnFalse;
- }
- it_list = QLatin1String("forever");
- } else {
- loop.variable = args[0];
- loop.oldVarVal = m_valuemap.value(loop.variable);
- doVariableReplace(&args[1]);
- it_list = args[1];
- }
- loop.list = m_valuemap[it_list];
- if (loop.list.isEmpty()) {
- if (it_list == QLatin1String("forever")) {
- loop.infinite = true;
- } else {
- int dotdot = it_list.indexOf(QLatin1String(".."));
- if (dotdot != -1) {
- bool ok;
- int start = it_list.left(dotdot).toInt(&ok);
- if (ok) {
- int end = it_list.mid(dotdot+2).toInt(&ok);
- if (ok) {
- if (start < end) {
- for (int i = start; i <= end; i++)
- loop.list << QString::number(i);
- } else {
- for (int i = start; i >= end; i--)
- loop.list << QString::number(i);
- }
- }
- }
- }
- }
+ case T_EVAL: {
+ ProFile *pro = m_parser->parsedProBlock(fL1S("(eval)"),
+ args.join(statics.field_sep));
+ if (!pro)
+ return ReturnFalse;
+ m_locationStack.push(m_current);
+ VisitReturn ret = visitProBlock(pro, pro->tokPtr());
+ m_current = m_locationStack.pop();
+ pro->deref();
+ return ret;
}
- m_loopStack.push(loop);
- m_sts.condition = true;
- return ProItem::ReturnLoop;
- }
case T_BREAK:
if (m_skipLevel)
- return ProItem::ReturnFalse;
- if (!m_loopStack.isEmpty())
- return ProItem::ReturnBreak;
- // ### missing: breaking out of multiline blocks
- q->logMessage(format("unexpected break()."));
- return ProItem::ReturnFalse;
+ return ReturnFalse;
+ if (m_loopLevel)
+ return ReturnBreak;
+ evalError(fL1S("unexpected break()."));
+ return ReturnFalse;
case T_NEXT:
if (m_skipLevel)
- return ProItem::ReturnFalse;
- if (!m_loopStack.isEmpty())
- return ProItem::ReturnNext;
- q->logMessage(format("unexpected next()."));
- return ProItem::ReturnFalse;
+ return ReturnFalse;
+ if (m_loopLevel)
+ return ReturnNext;
+ evalError(fL1S("unexpected next()."));
+ return ReturnFalse;
case T_IF: {
+ if (m_skipLevel && !m_cumulative)
+ return ReturnFalse;
if (args.count() != 1) {
- q->logMessage(format("if(condition) requires one argument."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("if(condition) requires one argument."));
+ return ReturnFalse;
}
- QString cond = args.first();
- bool escaped = false; // This is more than qmake does
+ const ProString &cond = args.at(0);
bool quoted = false;
bool ret = true;
bool orOp = false;
@@ -1949,83 +2708,69 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
int parens = 0;
QString test;
test.reserve(20);
- QString args;
- args.reserve(50);
- const QChar *d = cond.unicode();
- const QChar *ed = d + cond.length();
+ QString argsString;
+ argsString.reserve(50);
+ const QChar *d = cond.constData();
+ const QChar *ed = d + cond.size();
while (d < ed) {
ushort c = (d++)->unicode();
- if (!escaped) {
- if (c == '\\') {
- escaped = true;
- args += c; // Assume no-one quotes the test name
- continue;
- } else if (c == '"') {
- quoted = !quoted;
- args += c; // Ditto
- continue;
- }
- } else {
- escaped = false;
- }
+ bool isOp = false;
if (quoted) {
- args += c; // Ditto
+ if (c == '"')
+ quoted = false;
+ else if (c == '!' && test.isEmpty())
+ invert = true;
+ else
+ test += c;
+ } else if (c == '(') {
+ isFunc = true;
+ if (parens)
+ argsString += c;
+ ++parens;
+ } else if (c == ')') {
+ --parens;
+ if (parens)
+ argsString += c;
+ } else if (!parens) {
+ if (c == '"')
+ quoted = true;
+ else if (c == ':' || c == '|')
+ isOp = true;
+ else if (c == '!' && test.isEmpty())
+ invert = true;
+ else
+ test += c;
} else {
- bool isOp = false;
- if (c == '(') {
- isFunc = true;
- if (parens)
- args += c;
- ++parens;
- } else if (c == ')') {
- --parens;
- if (parens)
- args += c;
- } else if (!parens) {
- if (c == ':' || c == '|')
- isOp = true;
- else if (c == '!')
- invert = true;
- else
- test += c;
- } else {
- args += c;
- }
- if (!parens && (isOp || d == ed)) {
- // Yes, qmake doesn't shortcut evaluations here. We can't, either,
- // as some test functions have side effects.
- bool success;
- if (isFunc) {
- success = evaluateConditionalFunction(test, args);
- } else {
- success = isActiveConfig(test, true);
- }
- success ^= invert;
- if (orOp)
- ret |= success;
+ argsString += c;
+ }
+ if (!quoted && !parens && (isOp || d == ed)) {
+ if (m_cumulative || (orOp != ret)) {
+ test = test.trimmed();
+ if (isFunc)
+ ret = evaluateConditionalFunction(ProString(test), ProString(argsString, NoHash));
else
- ret &= success;
- orOp = (c == '|');
- invert = false;
- isFunc = false;
- test.clear();
- args.clear();
+ ret = isActiveConfig(test, true);
+ ret ^= invert;
}
+ orOp = (c == '|');
+ invert = false;
+ isFunc = false;
+ test.clear();
+ argsString.clear();
}
}
return returnBool(ret);
}
case T_CONFIG: {
if (args.count() < 1 || args.count() > 2) {
- q->logMessage(format("CONFIG(config) requires one or two arguments."));
- return ProItem::ReturnFalse;
- }
- if (args.count() == 1) {
- //cond = isActiveConfig(args.first()); XXX
- return ProItem::ReturnFalse;
+ evalError(fL1S("CONFIG(config) requires one or two arguments."));
+ return ReturnFalse;
}
- const QStringList mutuals = args[1].split(QLatin1Char('|'));
- const QStringList &configs = valuesDirect(QLatin1String("CONFIG"));
+ if (args.count() == 1)
+ return returnBool(isActiveConfig(args.at(0).toQString(m_tmp2)));
+ const QStringList &mutuals = args.at(1).toQString(m_tmp2).split(QLatin1Char('|'));
+ const ProStringList &configs = valuesDirect(statics.strCONFIG);
+
for (int i = configs.size() - 1; i >= 0; i--) {
for (int mut = 0; mut < mutuals.count(); mut++) {
if (configs[i] == mutuals[mut].trimmed()) {
@@ -2033,68 +2778,81 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
}
}
}
- return ProItem::ReturnFalse;
+ return ReturnFalse;
}
case T_CONTAINS: {
if (args.count() < 2 || args.count() > 3) {
- q->logMessage(format("contains(var, val) requires two or three arguments."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("contains(var, val) requires two or three arguments."));
+ return ReturnFalse;
}
- QRegExp regx(args[1]);
- const QStringList &l = values(args.first());
+ const QString &qry = args.at(1).toQString(m_tmp1);
+ QRegExp regx;
+ if (qry != QRegExp::escape(qry)) {
+ QString copy = qry;
+ copy.detach();
+ regx.setPattern(copy);
+ }
+ const ProStringList &l = values(map(args.at(0)));
if (args.count() == 2) {
+ int t = 0;
for (int i = 0; i < l.size(); ++i) {
- const QString val = l[i];
- if (regx.exactMatch(val) || val == args[1]) {
- return ProItem::ReturnTrue;
- }
+ const ProString &val = l[i];
+ if ((!regx.isEmpty() && regx.exactMatch(val.toQString(m_tmp[t]))) || val == qry)
+ return ReturnTrue;
+ t ^= 1;
}
} else {
- const QStringList mutuals = args[2].split(QLatin1Char('|'));
+ const QStringList &mutuals = args.at(2).toQString(m_tmp3).split(QLatin1Char('|'));
for (int i = l.size() - 1; i >= 0; i--) {
- const QString val = l[i];
+ const ProString val = l[i];
for (int mut = 0; mut < mutuals.count(); mut++) {
if (val == mutuals[mut].trimmed()) {
- return returnBool(regx.exactMatch(val) || val == args[1]);
+ return returnBool((!regx.isEmpty()
+ && regx.exactMatch(val.toQString(m_tmp2)))
+ || val == qry);
}
}
}
}
- return ProItem::ReturnFalse;
+ return ReturnFalse;
}
case T_COUNT: {
if (args.count() != 2 && args.count() != 3) {
- q->logMessage(format("count(var, count, op=\"equals\") requires two or three arguments."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("count(var, count, op=\"equals\") requires two or three arguments."));
+ return ReturnFalse;
}
+ int cnt = values(map(args.at(0))).count();
if (args.count() == 3) {
- QString comp = args[2];
+ const ProString &comp = args.at(2);
+ const int val = args.at(1).toQString(m_tmp1).toInt();
if (comp == QLatin1String(">") || comp == QLatin1String("greaterThan")) {
- return returnBool(values(args.first()).count() > args[1].toInt());
+ return returnBool(cnt > val);
} else if (comp == QLatin1String(">=")) {
- return returnBool(values(args.first()).count() >= args[1].toInt());
+ return returnBool(cnt >= val);
} else if (comp == QLatin1String("<") || comp == QLatin1String("lessThan")) {
- return returnBool(values(args.first()).count() < args[1].toInt());
+ return returnBool(cnt < val);
} else if (comp == QLatin1String("<=")) {
- return returnBool(values(args.first()).count() <= args[1].toInt());
+ return returnBool(cnt <= val);
} else if (comp == QLatin1String("equals") || comp == QLatin1String("isEqual")
|| comp == QLatin1String("=") || comp == QLatin1String("==")) {
- return returnBool(values(args.first()).count() == args[1].toInt());
+ return returnBool(cnt == val);
} else {
- q->logMessage(format("unexpected modifier to count(%2)").arg(comp));
- return ProItem::ReturnFalse;
+ evalError(fL1S("unexpected modifier to count(%2)").arg(comp.toQString(m_tmp1)));
+ return ReturnFalse;
}
}
- return returnBool(values(args.first()).count() == args[1].toInt());
+ return returnBool(cnt == args.at(1).toQString(m_tmp1).toInt());
}
case T_GREATERTHAN:
case T_LESSTHAN: {
if (args.count() != 2) {
- q->logMessage(format("%1(variable, value) requires two arguments.").arg(function));
- return ProItem::ReturnFalse;
+ evalError(fL1S("%1(variable, value) requires two arguments.")
+ .arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
}
- QString rhs(args[1]), lhs(values(args[0]).join(QString(Option::field_sep)));
+ const QString &rhs(args.at(1).toQString(m_tmp1)),
+ &lhs(values(map(args.at(0))).join(statics.field_sep));
bool ok;
int rhs_int = rhs.toInt(&ok);
if (ok) { // do integer compare
@@ -2111,206 +2869,300 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
}
case T_EQUALS:
if (args.count() != 2) {
- q->logMessage(format("%1(variable, value) requires two arguments.").arg(function));
- return ProItem::ReturnFalse;
+ evalError(fL1S("%1(variable, value) requires two arguments.")
+ .arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
}
- return returnBool(values(args[0]).join(QString(Option::field_sep)) == args[1]);
+ return returnBool(values(map(args.at(0))).join(statics.field_sep)
+ == args.at(1).toQString(m_tmp1));
case T_CLEAR: {
if (m_skipLevel && !m_cumulative)
- return ProItem::ReturnFalse;
+ return ReturnFalse;
if (args.count() != 1) {
- q->logMessage(format("%1(variable) requires one argument.").arg(function));
- return ProItem::ReturnFalse;
- }
- QHash<QString, QStringList>::Iterator it = m_valuemap.find(args[0]);
- if (it == m_valuemap.end())
- return ProItem::ReturnFalse;
- it->clear();
- return ProItem::ReturnTrue;
+ evalError(fL1S("%1(variable) requires one argument.")
+ .arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
+ }
+ QHash<ProString, ProStringList> *hsh;
+ QHash<ProString, ProStringList>::Iterator it;
+ const ProString &var = map(args.at(0));
+ if (!(hsh = findValues(var, &it)))
+ return ReturnFalse;
+ if (hsh == &m_valuemapStack.top())
+ it->clear();
+ else
+ m_valuemapStack.top()[var].clear();
+ return ReturnTrue;
}
case T_UNSET: {
if (m_skipLevel && !m_cumulative)
- return ProItem::ReturnFalse;
+ return ReturnFalse;
if (args.count() != 1) {
- q->logMessage(format("%1(variable) requires one argument.").arg(function));
- return ProItem::ReturnFalse;
- }
- QHash<QString, QStringList>::Iterator it = m_valuemap.find(args[0]);
- if (it == m_valuemap.end())
- return ProItem::ReturnFalse;
- m_valuemap.erase(it);
- return ProItem::ReturnTrue;
+ evalError(fL1S("%1(variable) requires one argument.")
+ .arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
+ }
+ QHash<ProString, ProStringList> *hsh;
+ QHash<ProString, ProStringList>::Iterator it;
+ const ProString &var = map(args.at(0));
+ if (!(hsh = findValues(var, &it)))
+ return ReturnFalse;
+ if (m_valuemapStack.size() == 1)
+ hsh->erase(it);
+ else if (hsh == &m_valuemapStack.top())
+ *it = statics.fakeValue;
+ else
+ m_valuemapStack.top()[var] = statics.fakeValue;
+ return ReturnTrue;
}
case T_INCLUDE: {
if (m_skipLevel && !m_cumulative)
- return ProItem::ReturnFalse;
+ return ReturnFalse;
QString parseInto;
// the third optional argument to include() controls warnings
// and is not used here
- if ((args.count() == 2) || (args.count() == 3)) {
- parseInto = args[1];
+ if ((args.count() == 2) || (args.count() == 3) ) {
+ parseInto = args.at(1).toQString(m_tmp2);
} else if (args.count() != 1) {
- q->logMessage(format("include(file) requires one, two or three arguments."));
- return ProItem::ReturnFalse;
- }
- QString fileName = args.first();
- // ### this breaks if we have include(c:/reallystupid.pri) but IMHO that's really bad style.
- QDir currentProPath(currentDirectory());
- fileName = QDir::cleanPath(currentProPath.absoluteFilePath(fileName));
- State sts = m_sts;
- bool ok = evaluateFile(fileName);
- m_sts = sts;
+ evalError(fL1S("include(file, into, silent) requires one, two or three arguments."));
+ return ReturnFalse;
+ }
+ QString fn = resolvePath(expandEnvVars(args.at(0).toQString(m_tmp1)));
+ fn.detach();
+ bool ok;
+ if (parseInto.isEmpty()) {
+ ok = evaluateFile(fn, ProFileEvaluatorHandler::EvalIncludeFile,
+ ProFileEvaluator::LoadProOnly);
+ } else {
+ QHash<ProString, ProStringList> symbols;
+ if ((ok = evaluateFileInto(fn, ProFileEvaluatorHandler::EvalAuxFile,
+ &symbols, 0, EvalWithSetup))) {
+ QHash<ProString, ProStringList> newMap;
+ for (QHash<ProString, ProStringList>::ConstIterator
+ it = m_valuemapStack.top().constBegin(),
+ end = m_valuemapStack.top().constEnd();
+ it != end; ++it) {
+ const QString &ky = it.key().toQString(m_tmp1);
+ if (!(ky.startsWith(parseInto) &&
+ (ky.length() == parseInto.length()
+ || ky.at(parseInto.length()) == QLatin1Char('.'))))
+ newMap[it.key()] = it.value();
+ }
+ for (QHash<ProString, ProStringList>::ConstIterator it = symbols.constBegin();
+ it != symbols.constEnd(); ++it) {
+ const QString &ky = it.key().toQString(m_tmp1);
+ if (!ky.startsWith(QLatin1Char('.')))
+ newMap.insert(ProString(parseInto + QLatin1Char('.') + ky), it.value());
+ }
+ m_valuemapStack.top() = newMap;
+ }
+ }
return returnBool(ok);
}
case T_LOAD: {
if (m_skipLevel && !m_cumulative)
- return ProItem::ReturnFalse;
- QString parseInto;
+ return ReturnFalse;
bool ignore_error = false;
if (args.count() == 2) {
- QString sarg = args[1];
- ignore_error = (!sarg.compare(QLatin1String("true"), Qt::CaseInsensitive) || sarg.toInt());
+ ignore_error = isTrue(args.at(1), m_tmp2);
} else if (args.count() != 1) {
- q->logMessage(format("load(feature) requires one or two arguments."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("load(feature) requires one or two arguments."));
+ return ReturnFalse;
}
// XXX ignore_error unused
- return returnBool(evaluateFeatureFile(args.first()));
+ return returnBool(evaluateFeatureFile(expandEnvVars(args.at(0).toQString())));
}
case T_DEBUG:
// Yup - do nothing. Nothing is going to enable debug output anyway.
- return ProItem::ReturnFalse;
+ return ReturnFalse;
case T_MESSAGE: {
if (args.count() != 1) {
- q->logMessage(format("%1(message) requires one argument.").arg(function));
- return ProItem::ReturnFalse;
- }
- QString msg = fixEnvVariables(args.first());
- q->fileMessage(QString::fromLatin1("Project %1: %2").arg(function.toUpper(), msg));
+ evalError(fL1S("%1(message) requires one argument.")
+ .arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
+ }
+ const QString &msg = expandEnvVars(args.at(0).toQString(m_tmp2));
+ if (!m_skipLevel)
+ m_handler->fileMessage(fL1S("Project %1: %2")
+ .arg(function.toQString(m_tmp1).toUpper(), msg));
// ### Consider real termination in non-cumulative mode
return returnBool(function != QLatin1String("error"));
}
#if 0 // Way too dangerous to enable.
case T_SYSTEM: {
if (args.count() != 1) {
- q->logMessage(format("system(exec) requires one argument."));
- ProItem::ReturnFalse;
- }
- return returnBool(system(args.first().toLatin1().constData()) == 0);
+ evalError(fL1S("system(exec) requires one argument."));
+ return ReturnFalse;
+ }
+#ifndef QT_BOOTSTRAPPED
+ QProcess proc;
+ proc.setProcessChannelMode(QProcess::MergedChannels);
+ runProcess(&proc, args.at(0).toQString(m_tmp2), QProcess::StandardOutput);
+ return returnBool(proc.exitStatus() == QProcess::NormalExit && proc.exitCode() == 0);
+#else
+ return returnBool(system((QLatin1String("cd ")
+ + IoUtils::shellQuote(currentDirectory())
+ + QLatin1String(" && ") + args.at(0)).toLocal8Bit().constData()) == 0);
+#endif
}
#endif
case T_ISEMPTY: {
if (args.count() != 1) {
- q->logMessage(format("isEmpty(var) requires one argument."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("isEmpty(var) requires one argument."));
+ return ReturnFalse;
}
- QStringList sl = values(args.first());
+ const ProStringList &sl = values(map(args.at(0)));
if (sl.count() == 0) {
- return ProItem::ReturnTrue;
+ return ReturnTrue;
} else if (sl.count() > 0) {
- QString var = sl.first();
+ const ProString &var = sl.first();
if (var.isEmpty())
- return ProItem::ReturnTrue;
+ return ReturnTrue;
}
- return ProItem::ReturnFalse;
+ return ReturnFalse;
}
case T_EXISTS: {
if (args.count() != 1) {
- q->logMessage(format("exists(file) requires one argument."));
- return ProItem::ReturnFalse;
+ evalError(fL1S("exists(file) requires one argument."));
+ return ReturnFalse;
}
- QString file = args.first();
- file = Option::fixPathToLocalOS(file);
+ const QString &file = resolvePath(expandEnvVars(args.at(0).toQString(m_tmp1)));
- if (QFile::exists(file)) {
- return ProItem::ReturnTrue;
+ if (IoUtils::exists(file)) {
+ return ReturnTrue;
}
- //regular expression I guess
- QString dirstr = currentDirectory();
- int slsh = file.lastIndexOf(Option::dir_sep);
- if (slsh != -1) {
- dirstr = file.left(slsh+1);
- file = file.right(file.length() - slsh - 1);
+ int slsh = file.lastIndexOf(QLatin1Char('/'));
+ QString fn = file.mid(slsh+1);
+ if (fn.contains(QLatin1Char('*')) || fn.contains(QLatin1Char('?'))) {
+ QString dirstr = file.left(slsh+1);
+ if (!QDir(dirstr).entryList(QStringList(fn)).isEmpty())
+ return ReturnTrue;
}
- if (file.contains(QLatin1Char('*')) || file.contains(QLatin1Char('?')))
- if (!QDir(dirstr).entryList(QStringList(file)).isEmpty())
- return ProItem::ReturnTrue;
- return ProItem::ReturnFalse;
+ return ReturnFalse;
}
- case 0:
- q->logMessage(format("'%1' is not a recognized test function").arg(function));
- return ProItem::ReturnFalse;
+ case T_INVALID:
+ evalError(fL1S("'%1' is not a recognized test function")
+ .arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
default:
- q->logMessage(format("Function '%1' is not implemented").arg(function));
- return ProItem::ReturnFalse;
+ evalError(fL1S("Function '%1' is not implemented").arg(function.toQString(m_tmp1)));
+ return ReturnFalse;
+ }
+}
+
+QHash<ProString, ProStringList> *ProFileEvaluator::Private::findValues(
+ const ProString &variableName, QHash<ProString, ProStringList>::Iterator *rit)
+{
+ for (int i = m_valuemapStack.size(); --i >= 0; ) {
+ QHash<ProString, ProStringList>::Iterator it = m_valuemapStack[i].find(variableName);
+ if (it != m_valuemapStack[i].end()) {
+ if (it->constBegin() == statics.fakeValue.constBegin())
+ return 0;
+ *rit = it;
+ return &m_valuemapStack[i];
+ }
+ }
+ return 0;
+}
+
+ProStringList &ProFileEvaluator::Private::valuesRef(const ProString &variableName)
+{
+ QHash<ProString, ProStringList>::Iterator it = m_valuemapStack.top().find(variableName);
+ if (it != m_valuemapStack.top().end())
+ return *it;
+ for (int i = m_valuemapStack.size() - 1; --i >= 0; ) {
+ QHash<ProString, ProStringList>::ConstIterator it = m_valuemapStack.at(i).constFind(variableName);
+ if (it != m_valuemapStack.at(i).constEnd()) {
+ ProStringList &ret = m_valuemapStack.top()[variableName];
+ ret = *it;
+ return ret;
+ }
+ }
+ return m_valuemapStack.top()[variableName];
+}
+
+ProStringList ProFileEvaluator::Private::valuesDirect(const ProString &variableName) const
+{
+ for (int i = m_valuemapStack.size(); --i >= 0; ) {
+ QHash<ProString, ProStringList>::ConstIterator it = m_valuemapStack.at(i).constFind(variableName);
+ if (it != m_valuemapStack.at(i).constEnd()) {
+ if (it->constBegin() == statics.fakeValue.constBegin())
+ break;
+ return *it;
+ }
}
+ return ProStringList();
}
-QStringList ProFileEvaluator::Private::values(const QString &variableName,
- const QHash<QString, QStringList> &place,
- const ProFile *pro) const
-{
- if (variableName == QLatin1String("LITERAL_WHITESPACE")) //a real space in a token
- return QStringList(QLatin1String("\t"));
- if (variableName == QLatin1String("LITERAL_DOLLAR")) //a real $
- return QStringList(QLatin1String("$"));
- if (variableName == QLatin1String("LITERAL_HASH")) //a real #
- return QStringList(QLatin1String("#"));
- if (variableName == QLatin1String("OUT_PWD")) //the out going dir
- return QStringList(m_outputDir);
- if (variableName == QLatin1String("PWD") || //current working dir (of _FILE_)
- variableName == QLatin1String("IN_PWD"))
- return QStringList(currentDirectory());
- if (variableName == QLatin1String("DIR_SEPARATOR"))
- return QStringList(Option::dir_sep);
- if (variableName == QLatin1String("DIRLIST_SEPARATOR"))
- return QStringList(Option::dirlist_sep);
- if (variableName == QLatin1String("_LINE_")) //parser line number
- return QStringList(QString::number(m_lineNo));
- if (variableName == QLatin1String("_FILE_")) //parser file; qmake is a bit weird here
- return QStringList(m_profileStack.size() == 1 ? pro->fileName() : QFileInfo(pro->fileName()).fileName());
- if (variableName == QLatin1String("_DATE_")) //current date/time
- return QStringList(QDateTime::currentDateTime().toString());
- if (variableName == QLatin1String("_PRO_FILE_"))
- return QStringList(m_origfile);
- if (variableName == QLatin1String("_PRO_FILE_PWD_"))
- return QStringList(QFileInfo(m_origfile).absolutePath());
- if (variableName == QLatin1String("_QMAKE_CACHE_"))
- return QStringList(); // FIXME?
- if (variableName.startsWith(QLatin1String("QMAKE_HOST."))) {
- QString ret, type = variableName.mid(11);
+ProStringList ProFileEvaluator::Private::values(const ProString &variableName) const
+{
+ QHash<ProString, int>::ConstIterator vli = statics.varList.find(variableName);
+ if (vli != statics.varList.constEnd()) {
+ int vlidx = *vli;
+ QString ret;
+ switch ((VarName)vlidx) {
+ case V_LITERAL_WHITESPACE: ret = QLatin1String("\t"); break;
+ case V_LITERAL_DOLLAR: ret = QLatin1String("$"); break;
+ case V_LITERAL_HASH: ret = QLatin1String("#"); break;
+ case V_OUT_PWD: // the outgoing dir (shadow of _PRO_FILE_PWD_)
+ ret = m_outputDir;
+ break;
+ case V_PWD: // containing directory of most nested project/include file
+ case V_IN_PWD:
+ ret = currentDirectory();
+ break;
+ case V_DIR_SEPARATOR:
+ validateModes();
+ ret = m_option->dir_sep;
+ break;
+ case V_DIRLIST_SEPARATOR:
+ ret = m_option->dirlist_sep;
+ break;
+ case V__LINE_: // currently executed line number
+ ret = QString::number(m_current.line);
+ break;
+ case V__FILE_: // currently executed file
+ ret = m_current.pro->fileName();
+ break;
+ case V__DATE_: //current date/time
+ ret = QDateTime::currentDateTime().toString();
+ break;
+ case V__PRO_FILE_:
+ ret = m_profileStack.first()->fileName();
+ break;
+ case V__PRO_FILE_PWD_:
+ ret = m_profileStack.first()->directoryName();
+ break;
+ case V__QMAKE_CACHE_:
+ ret = m_option->cachefile;
+ break;
#if defined(Q_OS_WIN32)
- if (type == QLatin1String("os")) {
- ret = QLatin1String("Windows");
- } else if (type == QLatin1String("name")) {
+ case V_QMAKE_HOST_os: ret = QLatin1String("Windows"); break;
+ case V_QMAKE_HOST_name: {
DWORD name_length = 1024;
- wchar_t name[1024];
+ TCHAR name[1024];
if (GetComputerName(name, &name_length))
- ret = QString::fromWCharArray(name);
- } else if (type == QLatin1String("version") || type == QLatin1String("version_string")) {
- QSysInfo::WinVersion ver = QSysInfo::WindowsVersion;
- if (type == QLatin1String("version"))
- ret = QString::number(ver);
- else if (ver == QSysInfo::WV_Me)
- ret = QLatin1String("WinMe");
- else if (ver == QSysInfo::WV_95)
- ret = QLatin1String("Win95");
- else if (ver == QSysInfo::WV_98)
- ret = QLatin1String("Win98");
- else if (ver == QSysInfo::WV_NT)
- ret = QLatin1String("WinNT");
- else if (ver == QSysInfo::WV_2000)
- ret = QLatin1String("Win2000");
- else if (ver == QSysInfo::WV_2000)
- ret = QLatin1String("Win2003");
- else if (ver == QSysInfo::WV_XP)
- ret = QLatin1String("WinXP");
- else if (ver == QSysInfo::WV_VISTA)
- ret = QLatin1String("WinVista");
- else
- ret = QLatin1String("Unknown");
- } else if (type == QLatin1String("arch")) {
+ ret = QString::fromUtf16((ushort*)name, name_length);
+ break;
+ }
+ case V_QMAKE_HOST_version:
+ ret = QString::number(QSysInfo::WindowsVersion);
+ break;
+ case V_QMAKE_HOST_version_string:
+ switch (QSysInfo::WindowsVersion) {
+ case QSysInfo::WV_Me: ret = QLatin1String("WinMe"); break;
+ case QSysInfo::WV_95: ret = QLatin1String("Win95"); break;
+ case QSysInfo::WV_98: ret = QLatin1String("Win98"); break;
+ case QSysInfo::WV_NT: ret = QLatin1String("WinNT"); break;
+ case QSysInfo::WV_2000: ret = QLatin1String("Win2000"); break;
+ case QSysInfo::WV_2003: ret = QLatin1String("Win2003"); break;
+ case QSysInfo::WV_XP: ret = QLatin1String("WinXP"); break;
+ case QSysInfo::WV_VISTA: ret = QLatin1String("WinVista"); break;
+ default: ret = QLatin1String("Unknown"); break;
+ }
+ break;
+ case V_QMAKE_HOST_arch:
SYSTEM_INFO info;
GetSystemInfo(&info);
switch(info.wProcessorArchitecture) {
@@ -2332,115 +3184,154 @@ QStringList ProFileEvaluator::Private::values(const QString &variableName,
ret = QLatin1String("Unknown");
break;
}
- }
+ break;
#elif defined(Q_OS_UNIX)
- struct utsname name;
- if (!uname(&name)) {
- if (type == QLatin1String("os"))
- ret = QString::fromLatin1(name.sysname);
- else if (type == QLatin1String("name"))
- ret = QString::fromLatin1(name.nodename);
- else if (type == QLatin1String("version"))
- ret = QString::fromLatin1(name.release);
- else if (type == QLatin1String("version_string"))
- ret = QString::fromLatin1(name.version);
- else if (type == QLatin1String("arch"))
- ret = QString::fromLatin1(name.machine);
- }
+ case V_QMAKE_HOST_os:
+ case V_QMAKE_HOST_name:
+ case V_QMAKE_HOST_version:
+ case V_QMAKE_HOST_version_string:
+ case V_QMAKE_HOST_arch:
+ {
+ struct utsname name;
+ const char *what;
+ if (!uname(&name)) {
+ switch (vlidx) {
+ case V_QMAKE_HOST_os: what = name.sysname; break;
+ case V_QMAKE_HOST_name: what = name.nodename; break;
+ case V_QMAKE_HOST_version: what = name.release; break;
+ case V_QMAKE_HOST_version_string: what = name.version; break;
+ case V_QMAKE_HOST_arch: what = name.machine; break;
+ }
+ ret = QString::fromLocal8Bit(what);
+ }
+ }
#endif
- return QStringList(ret);
+ }
+ return ProStringList(ProString(ret, NoHash));
}
- QStringList result = place[variableName];
+ ProStringList result = valuesDirect(variableName);
if (result.isEmpty()) {
- if (variableName == QLatin1String("TARGET")) {
- result.append(QFileInfo(m_origfile).baseName());
- } else if (variableName == QLatin1String("TEMPLATE")) {
- result.append(QLatin1String("app"));
- } else if (variableName == QLatin1String("QMAKE_DIR_SEP")) {
- result.append(Option::dirlist_sep);
+ if (variableName == statics.strTEMPLATE) {
+ result.append(ProString("app", NoHash));
+ } else if (variableName == statics.strQMAKE_DIR_SEP) {
+ result.append(ProString(m_option->dirlist_sep, NoHash));
}
}
return result;
}
-QStringList ProFileEvaluator::Private::values(const QString &variableName) const
+bool ProFileEvaluator::Private::evaluateFileDirect(
+ const QString &fileName, ProFileEvaluatorHandler::EvalFileType type,
+ ProFileEvaluator::LoadFlags flags)
{
- return values(variableName, m_valuemap, currentProFile());
-}
-
-QStringList ProFileEvaluator::Private::values(const QString &variableName, const ProFile *pro) const
-{
- return values(variableName, m_filevaluemap[pro], pro);
-}
-
-ProFile *ProFileEvaluator::parsedProFile(const QString &fileName)
-{
- QFileInfo fi(fileName);
- if (fi.exists()) {
- QString fn = QDir::cleanPath(fi.absoluteFilePath());
- foreach (const ProFile *pf, d->m_profileStack)
- if (pf->fileName() == fn) {
- errorMessage(d->format("circular inclusion of %1").arg(fn));
- return 0;
- }
- ProFile *pro = new ProFile(fn);
- if (d->read(pro))
- return pro;
- delete pro;
+ if (ProFile *pro = m_parser->parsedProFile(fileName, true)) {
+ m_locationStack.push(m_current);
+ bool ok = (visitProFile(pro, type, flags) == ReturnTrue);
+ m_current = m_locationStack.pop();
+ pro->deref();
+ return ok;
+ } else {
+ return false;
}
- return 0;
}
-void ProFileEvaluator::releaseParsedProFile(ProFile *proFile)
+bool ProFileEvaluator::Private::evaluateFile(
+ const QString &fileName, ProFileEvaluatorHandler::EvalFileType type,
+ ProFileEvaluator::LoadFlags flags)
{
- delete proFile;
-}
-
-bool ProFileEvaluator::Private::evaluateFile(const QString &fileName)
-{
- ProFile *pro = q->parsedProFile(fileName);
- if (pro) {
- m_profileStack.push(pro);
- bool ok = (pro->Accept(this) == ProItem::ReturnTrue);
- m_profileStack.pop();
- q->releaseParsedProFile(pro);
- return ok;
- } else {
+ if (fileName.isEmpty())
return false;
- }
+ foreach (const ProFile *pf, m_profileStack)
+ if (pf->fileName() == fileName) {
+ evalError(fL1S("circular inclusion of %1").arg(fileName));
+ return false;
+ }
+ return evaluateFileDirect(fileName, type, flags);
}
bool ProFileEvaluator::Private::evaluateFeatureFile(const QString &fileName)
{
- QString fn;
- foreach (const QString &path, qmakeFeaturePaths()) {
- QString fname = path + QLatin1Char('/') + fileName;
- if (QFileInfo(fname).exists()) {
- fn = fname;
- break;
+ QString fn = fileName;
+ if (!fn.endsWith(QLatin1String(".prf")))
+ fn += QLatin1String(".prf");
+
+ if ((!fileName.contains((ushort)'/') && !fileName.contains((ushort)'\\'))
+ || !IoUtils::exists(resolvePath(fn))) {
+ if (m_option->feature_roots.isEmpty())
+ m_option->feature_roots = qmakeFeaturePaths();
+ int start_root = 0;
+ QString currFn = currentFileName();
+ if (IoUtils::fileName(currFn) == IoUtils::fileName(fn)) {
+ for (int root = 0; root < m_option->feature_roots.size(); ++root)
+ if (currFn == m_option->feature_roots.at(root) + fn) {
+ start_root = root + 1;
+ break;
+ }
}
- fname += QLatin1String(".prf");
- if (QFileInfo(fname).exists()) {
- fn = fname;
- break;
+ for (int root = start_root; root < m_option->feature_roots.size(); ++root) {
+ QString fname = m_option->feature_roots.at(root) + fn;
+ if (IoUtils::exists(fname)) {
+ fn = fname;
+ goto cool;
+ }
}
- }
- if (fn.isEmpty())
return false;
+
+ cool:
+ // It's beyond me why qmake has this inside this if ...
+ ProStringList &already = valuesRef(ProString("QMAKE_INTERNAL_INCLUDED_FEATURES"));
+ ProString afn(fn, NoHash);
+ if (already.contains(afn))
+ return true;
+ already.append(afn);
+ } else {
+ fn = resolvePath(fn);
+ }
+
+#ifdef PROEVALUATOR_CUMULATIVE
bool cumulative = m_cumulative;
m_cumulative = false;
- bool ok = evaluateFile(fn);
+#endif
+
+ // The path is fully normalized already.
+ bool ok = evaluateFileDirect(fn, ProFileEvaluatorHandler::EvalFeatureFile,
+ ProFileEvaluator::LoadProOnly);
+
+#ifdef PROEVALUATOR_CUMULATIVE
m_cumulative = cumulative;
+#endif
return ok;
}
-QString ProFileEvaluator::Private::format(const char *fmt) const
+bool ProFileEvaluator::Private::evaluateFileInto(
+ const QString &fileName, ProFileEvaluatorHandler::EvalFileType type,
+ QHash<ProString, ProStringList> *values, FunctionDefs *funcs, EvalIntoMode mode)
{
- ProFile *pro = currentProFile();
- QString fileName = pro ? pro->fileName() : QLatin1String("Not a file");
- int lineNumber = pro ? m_lineNo : 0;
- return QString::fromLatin1("%1(%2):").arg(fileName).arg(lineNumber) + QString::fromAscii(fmt);
+ ProFileEvaluator visitor(m_option, m_parser, m_handler);
+#ifdef PROEVALUATOR_CUMULATIVE
+ visitor.d->m_cumulative = false;
+#endif
+ visitor.d->m_outputDir = m_outputDir;
+// visitor.d->m_valuemapStack.top() = *values;
+ if (funcs)
+ visitor.d->m_functionDefs = *funcs;
+ if (mode == EvalWithDefaults)
+ visitor.d->evaluateFeatureFile(QLatin1String("default_pre.prf"));
+ if (!visitor.d->evaluateFile(fileName, type,
+ (mode == EvalWithSetup) ? ProFileEvaluator::LoadAll : ProFileEvaluator::LoadProOnly))
+ return false;
+ *values = visitor.d->m_valuemapStack.top();
+// if (funcs)
+// *funcs = visitor.d->m_functionDefs;
+ return true;
+}
+
+void ProFileEvaluator::Private::evalError(const QString &message) const
+{
+ if (!m_skipLevel)
+ m_handler->evalError(m_current.line ? m_current.pro->fileName() : QString(),
+ m_current.line, message);
}
@@ -2450,10 +3341,15 @@ QString ProFileEvaluator::Private::format(const char *fmt) const
//
///////////////////////////////////////////////////////////////////////
-ProFileEvaluator::ProFileEvaluator()
- : d(new Private(this))
+void ProFileEvaluator::initialize()
+{
+ Private::initStatics();
+}
+
+ProFileEvaluator::ProFileEvaluator(ProFileOption *option, ProFileParser *parser,
+ ProFileEvaluatorHandler *handler)
+ : d(new Private(this, option, parser, handler))
{
- Option::init();
}
ProFileEvaluator::~ProFileEvaluator()
@@ -2463,26 +3359,38 @@ ProFileEvaluator::~ProFileEvaluator()
bool ProFileEvaluator::contains(const QString &variableName) const
{
- return d->m_valuemap.contains(variableName);
+ return d->m_valuemapStack.top().contains(ProString(variableName));
}
-inline QStringList fixEnvVariables(const QStringList &x)
+QString ProFileEvaluator::value(const QString &variable) const
{
- QStringList ret;
- foreach (const QString &str, x)
- ret << Option::fixString(str, Option::FixEnvVars);
- return ret;
-}
+ const QStringList &vals = values(variable);
+ if (!vals.isEmpty())
+ return vals.first();
+ return QString();
+}
QStringList ProFileEvaluator::values(const QString &variableName) const
{
- return fixEnvVariables(d->values(variableName));
+ const ProStringList &values = d->values(ProString(variableName));
+ QStringList ret;
+ ret.reserve(values.size());
+ foreach (const ProString &str, values)
+ ret << d->expandEnvVars(str.toQString());
+ return ret;
}
QStringList ProFileEvaluator::values(const QString &variableName, const ProFile *pro) const
{
- return fixEnvVariables(d->values(variableName, pro));
+ // It makes no sense to put any kind of magic into expanding these
+ const ProStringList &values = d->m_valuemapStack.at(0).value(ProString(variableName));
+ QStringList ret;
+ ret.reserve(values.size());
+ foreach (const ProString &str, values)
+ if (str.sourceFile() == pro)
+ ret << d->expandEnvVars(str.toQString());
+ return ret;
}
QStringList ProFileEvaluator::absolutePathValues(
@@ -2490,9 +3398,10 @@ QStringList ProFileEvaluator::absolutePathValues(
{
QStringList result;
foreach (const QString &el, values(variable)) {
- const QFileInfo info = QFileInfo(baseDirectory, el);
- if (info.isDir())
- result << QDir::cleanPath(info.absoluteFilePath());
+ QString absEl = IoUtils::isAbsolutePath(el)
+ ? d->sysrootify(el, baseDirectory) : IoUtils::resolvePath(baseDirectory, el);
+ if (IoUtils::fileType(absEl) == IoUtils::FileIsDir)
+ result << QDir::cleanPath(absEl);
}
return result;
}
@@ -2503,34 +3412,40 @@ QStringList ProFileEvaluator::absoluteFileValues(
{
QStringList result;
foreach (const QString &el, pro ? values(variable, pro) : values(variable)) {
- QFileInfo info(el);
- if (info.isAbsolute()) {
- if (info.exists()) {
- result << QDir::cleanPath(el);
+ QString absEl;
+ if (IoUtils::isAbsolutePath(el)) {
+ const QString elWithSysroot = d->sysrootify(el, baseDirectory);
+ if (IoUtils::exists(elWithSysroot)) {
+ result << QDir::cleanPath(elWithSysroot);
goto next;
}
+ absEl = elWithSysroot;
} else {
foreach (const QString &dir, searchDirs) {
- QFileInfo info(dir, el);
- if (info.isFile()) {
- result << QDir::cleanPath(info.filePath());
+ QString fn = dir + QLatin1Char('/') + el;
+ if (IoUtils::exists(fn)) {
+ result << QDir::cleanPath(fn);
goto next;
}
}
if (baseDirectory.isEmpty())
goto next;
- info = QFileInfo(baseDirectory, el);
+ absEl = baseDirectory + QLatin1Char('/') + el;
}
{
- QFileInfo baseInfo(info.absolutePath());
- if (baseInfo.exists()) {
- QString wildcard = info.fileName();
+ absEl = QDir::cleanPath(absEl);
+ int nameOff = absEl.lastIndexOf(QLatin1Char('/'));
+ QString absDir = d->m_tmp1.setRawData(absEl.constData(), nameOff);
+ if (IoUtils::exists(absDir)) {
+ QString wildcard = d->m_tmp2.setRawData(absEl.constData() + nameOff + 1,
+ absEl.length() - nameOff - 1);
if (wildcard.contains(QLatin1Char('*')) || wildcard.contains(QLatin1Char('?'))) {
- QDir theDir(QDir::cleanPath(baseInfo.filePath()));
+ wildcard.detach(); // Keep m_tmp out of QRegExp's cache
+ QDir theDir(absDir);
foreach (const QString &fn, theDir.entryList(QStringList(wildcard)))
- if (fn != QLatin1String(".") && fn != QLatin1String(".."))
- result << theDir.absoluteFilePath(fn);
- }
+ if (fn != statics.strDot && fn != statics.strDotDot)
+ result << absDir + QLatin1Char('/') + fn;
+ } // else if (acceptMissing)
}
}
next: ;
@@ -2538,86 +3453,41 @@ QStringList ProFileEvaluator::absoluteFileValues(
return result;
}
-ProFileEvaluator::TemplateType ProFileEvaluator::templateType()
+ProFileEvaluator::TemplateType ProFileEvaluator::templateType() const
{
- QStringList templ = values(QLatin1String("TEMPLATE"));
+ const ProStringList &templ = d->values(statics.strTEMPLATE);
if (templ.count() >= 1) {
- const QString &t = templ.last();
+ const QString &t = templ.at(0).toQString();
if (!t.compare(QLatin1String("app"), Qt::CaseInsensitive))
return TT_Application;
if (!t.compare(QLatin1String("lib"), Qt::CaseInsensitive))
return TT_Library;
if (!t.compare(QLatin1String("script"), Qt::CaseInsensitive))
return TT_Script;
+ if (!t.compare(QLatin1String("aux"), Qt::CaseInsensitive))
+ return TT_Aux;
if (!t.compare(QLatin1String("subdirs"), Qt::CaseInsensitive))
return TT_Subdirs;
}
return TT_Unknown;
}
-bool ProFileEvaluator::queryProFile(ProFile *pro)
-{
- return d->read(pro);
-}
-
-bool ProFileEvaluator::accept(ProFile *pro)
+bool ProFileEvaluator::accept(ProFile *pro, LoadFlags flags)
{
- return pro->Accept(d);
+ return d->visitProFile(pro, ProFileEvaluatorHandler::EvalProjectFile, flags) == Private::ReturnTrue;
}
QString ProFileEvaluator::propertyValue(const QString &name) const
{
- return d->propertyValue(name);
-}
-
-namespace {
- template<class K, class T> void insert(QHash<K,T> *out, const QHash<K,T> &in)
- {
- typename QHash<K,T>::const_iterator i = in.begin();
- while (i != in.end()) {
- out->insert(i.key(), i.value());
- ++i;
- }
- }
-} // anon namespace
-
-void ProFileEvaluator::addVariables(const QHash<QString, QStringList> &variables)
-{
- insert(&(d->m_valuemap), variables);
-}
-
-void ProFileEvaluator::addProperties(const QHash<QString, QString> &properties)
-{
- insert(&(d->m_properties), properties);
-}
-
-void ProFileEvaluator::logMessage(const QString &message)
-{
- if (d->m_verbose && !d->m_skipLevel)
- fprintf(stderr, "%s\n", qPrintable(message));
-}
-
-void ProFileEvaluator::fileMessage(const QString &message)
-{
- if (!d->m_skipLevel)
- fprintf(stderr, "%s\n", qPrintable(message));
-}
-
-void ProFileEvaluator::errorMessage(const QString &message)
-{
- if (!d->m_skipLevel)
- fprintf(stderr, "%s\n", qPrintable(message));
-}
-
-void ProFileEvaluator::setVerbose(bool on)
-{
- d->m_verbose = on;
+ return d->propertyValue(name, false);
}
+#ifdef PROEVALUATOR_CUMULATIVE
void ProFileEvaluator::setCumulative(bool on)
{
d->m_cumulative = on;
}
+#endif
void ProFileEvaluator::setOutputDir(const QString &dir)
{
diff --git a/tools/linguist/shared/profileevaluator.h b/tools/linguist/shared/profileevaluator.h
index d4cdbcd36c..b3086bf42e 100644
--- a/tools/linguist/shared/profileevaluator.h
+++ b/tools/linguist/shared/profileevaluator.h
@@ -42,52 +42,104 @@
#ifndef PROFILEEVALUATOR_H
#define PROFILEEVALUATOR_H
+#include "proparser_global.h"
#include "proitems.h"
-#include "abstractproitemvisitor.h"
-#include <QtCore/QIODevice>
#include <QtCore/QHash>
#include <QtCore/QStringList>
-#include <QtCore/QStack>
-
-#if (!defined(__GNUC__) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)) && !defined(__SUNPRO_CC)
-# define HAVE_TEMPLATE_CLASS_FRIENDS
+#ifndef QT_BOOTSTRAPPED
+# include <QtCore/QProcess>
+#endif
+#ifdef PROEVALUATOR_THREAD_SAFE
+# include <QtCore/QMutex>
+# include <QtCore/QWaitCondition>
#endif
QT_BEGIN_NAMESPACE
-class ProFileEvaluator
+struct ProFileOption;
+class ProFileParser;
+
+class PROPARSER_EXPORT ProFileEvaluatorHandler
{
-#ifdef HAVE_TEMPLATE_CLASS_FRIENDS
-private:
-#else
public:
-#endif
+ // qmake/project configuration error
+ virtual void configError(const QString &msg) = 0;
+ // Some error during evaluation
+ virtual void evalError(const QString &filename, int lineNo, const QString &msg) = 0;
+ // error() and message() from .pro file
+ virtual void fileMessage(const QString &msg) = 0;
+
+ enum EvalFileType { EvalProjectFile, EvalIncludeFile, EvalConfigFile, EvalFeatureFile, EvalAuxFile };
+ virtual void aboutToEval(ProFile *parent, ProFile *proFile, EvalFileType type) = 0;
+ virtual void doneWithEval(ProFile *parent) = 0;
+};
+
+
+class PROPARSER_EXPORT ProFileEvaluator
+{
class Private;
public:
+ class FunctionDef {
+ public:
+ FunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); }
+ FunctionDef(const FunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); }
+ ~FunctionDef() { m_pro->deref(); }
+ FunctionDef &operator=(const FunctionDef &o)
+ {
+ if (this != &o) {
+ m_pro->deref();
+ m_pro = o.m_pro;
+ m_pro->ref();
+ m_offset = o.m_offset;
+ }
+ return *this;
+ }
+ ProFile *pro() const { return m_pro; }
+ const ushort *tokPtr() const { return m_pro->tokPtr() + m_offset; }
+ private:
+ ProFile *m_pro;
+ int m_offset;
+ };
+
+ struct FunctionDefs {
+ QHash<ProString, FunctionDef> testFunctions;
+ QHash<ProString, FunctionDef> replaceFunctions;
+ };
+
enum TemplateType {
TT_Unknown = 0,
TT_Application,
TT_Library,
TT_Script,
+ TT_Aux,
TT_Subdirs
};
- ProFileEvaluator();
- virtual ~ProFileEvaluator();
+ // Call this from a concurrency-free context
+ static void initialize();
+
+ ProFileEvaluator(ProFileOption *option, ProFileParser *parser, ProFileEvaluatorHandler *handler);
+ ~ProFileEvaluator();
- ProFileEvaluator::TemplateType templateType();
- virtual bool contains(const QString &variableName) const;
- void setVerbose(bool on); // Default is false
+ ProFileEvaluator::TemplateType templateType() const;
+#ifdef PROEVALUATOR_CUMULATIVE
void setCumulative(bool on); // Default is true!
+#endif
void setOutputDir(const QString &dir); // Default is empty
- bool queryProFile(ProFile *pro);
- bool accept(ProFile *pro);
+ enum LoadFlag {
+ LoadProOnly = 0,
+ LoadPreFiles = 1,
+ LoadPostFiles = 2,
+ LoadAll = LoadPreFiles|LoadPostFiles
+ };
+ Q_DECLARE_FLAGS(LoadFlags, LoadFlag)
+ bool accept(ProFile *pro, LoadFlags flags = LoadAll);
- void addVariables(const QHash<QString, QStringList> &variables);
- void addProperties(const QHash<QString, QString> &properties);
+ bool contains(const QString &variableName) const;
+ QString value(const QString &variableName) const;
QStringList values(const QString &variableName) const;
QStringList values(const QString &variableName, const ProFile *pro) const;
QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const;
@@ -96,21 +148,83 @@ public:
const ProFile *pro) const;
QString propertyValue(const QString &val) const;
- // for our descendents
- virtual ProFile *parsedProFile(const QString &fileName);
- virtual void releaseParsedProFile(ProFile *proFile);
- virtual void logMessage(const QString &msg);
- virtual void errorMessage(const QString &msg); // .pro parse errors
- virtual void fileMessage(const QString &msg); // error() and message() from .pro file
-
private:
Private *d;
-#ifdef HAVE_TEMPLATE_CLASS_FRIENDS
- template<typename T> friend class QTypeInfo;
+ friend struct ProFileOption;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(ProFileEvaluator::LoadFlags)
+
+// This struct is from qmake, but we are not using everything.
+struct PROPARSER_EXPORT ProFileOption
+{
+ ProFileOption();
+ ~ProFileOption();
+
+ //simply global convenience
+ //QString libtool_ext;
+ //QString pkgcfg_ext;
+ //QString prf_ext;
+ //QString prl_ext;
+ //QString ui_ext;
+ //QStringList h_ext;
+ //QStringList cpp_ext;
+ //QString h_moc_ext;
+ //QString cpp_moc_ext;
+ //QString obj_ext;
+ //QString lex_ext;
+ //QString yacc_ext;
+ //QString h_moc_mod;
+ //QString cpp_moc_mod;
+ //QString lex_mod;
+ //QString yacc_mod;
+ QString dir_sep;
+ QString dirlist_sep;
+ QString qmakespec;
+ QString cachefile;
+ QHash<QString, QString> properties;
+#ifndef QT_BOOTSTRAPPED
+ QProcessEnvironment environment;
+#endif
+ QString sysroot;
+
+ //QString pro_ext;
+ //QString res_ext;
+
+ // -nocache, -cache, -spec, QMAKESPEC
+ // -set persistent value
+ void setCommandLineArguments(const QStringList &args);
+#ifdef PROEVALUATOR_INIT_PROPS
+ bool initProperties(const QString &qmake);
+#endif
+
+ private:
+ friend class ProFileEvaluator;
+ friend class ProFileEvaluator::Private;
+
+ void applyHostMode();
+ QString getEnv(const QString &) const;
+
+ QHash<ProString, ProStringList> base_valuemap; // Cached results of qmake.conf, .qmake.cache & default_pre.prf
+ ProFileEvaluator::FunctionDefs base_functions;
+ QStringList feature_roots;
+ QString qmakespec_name;
+ QString precmds, postcmds;
+ enum HOST_MODE { HOST_UNKNOWN_MODE, HOST_UNIX_MODE, HOST_WIN_MODE, HOST_MACX_MODE };
+ HOST_MODE host_mode;
+ enum TARG_MODE { TARG_UNKNOWN_MODE, TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE,
+ TARG_SYMBIAN_MODE };
+ TARG_MODE target_mode;
+#ifdef PROEVALUATOR_THREAD_SAFE
+ QMutex mutex;
+ QWaitCondition cond;
+ bool base_inProgress;
#endif
};
+Q_DECLARE_TYPEINFO(ProFileEvaluator::FunctionDef, Q_MOVABLE_TYPE);
+
QT_END_NAMESPACE
#endif // PROFILEEVALUATOR_H
diff --git a/tools/linguist/shared/profileparser.cpp b/tools/linguist/shared/profileparser.cpp
new file mode 100644
index 0000000000..5ba33fc8a4
--- /dev/null
+++ b/tools/linguist/shared/profileparser.cpp
@@ -0,0 +1,1037 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "profileparser.h"
+
+#include "ioutils.h"
+using namespace ProFileEvaluatorInternal;
+
+#include <QtCore/QFile>
+#ifdef PROPARSER_THREAD_SAFE
+# include <QtCore/QThreadPool>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+///////////////////////////////////////////////////////////////////////
+//
+// ProFileCache
+//
+///////////////////////////////////////////////////////////////////////
+
+ProFileCache::~ProFileCache()
+{
+ foreach (const Entry &ent, parsed_files)
+ if (ent.pro)
+ ent.pro->deref();
+}
+
+void ProFileCache::discardFile(const QString &fileName)
+{
+#ifdef PROPARSER_THREAD_SAFE
+ QMutexLocker lck(&mutex);
+#endif
+ QHash<QString, Entry>::Iterator it = parsed_files.find(fileName);
+ if (it != parsed_files.end()) {
+ if (it->pro)
+ it->pro->deref();
+ parsed_files.erase(it);
+ }
+}
+
+void ProFileCache::discardFiles(const QString &prefix)
+{
+#ifdef PROPARSER_THREAD_SAFE
+ QMutexLocker lck(&mutex);
+#endif
+ QHash<QString, Entry>::Iterator
+ it = parsed_files.begin(),
+ end = parsed_files.end();
+ while (it != end)
+ if (it.key().startsWith(prefix)) {
+ if (it->pro)
+ it->pro->deref();
+ it = parsed_files.erase(it);
+ } else {
+ ++it;
+ }
+}
+
+
+////////// Parser ///////////
+
+#define fL1S(s) QString::fromLatin1(s)
+
+namespace { // MSVC2010 doesn't seem to know the semantics of "static" ...
+
+static struct {
+ QString strelse;
+ QString strfor;
+ QString strdefineTest;
+ QString strdefineReplace;
+} statics;
+
+}
+
+void ProFileParser::initialize()
+{
+ if (!statics.strelse.isNull())
+ return;
+
+ statics.strelse = QLatin1String("else");
+ statics.strfor = QLatin1String("for");
+ statics.strdefineTest = QLatin1String("defineTest");
+ statics.strdefineReplace = QLatin1String("defineReplace");
+}
+
+ProFileParser::ProFileParser(ProFileCache *cache, ProFileParserHandler *handler)
+ : m_cache(cache)
+ , m_handler(handler)
+{
+ // So that single-threaded apps don't have to call initialize() for now.
+ initialize();
+}
+
+ProFile *ProFileParser::parsedProFile(const QString &fileName, bool cache, const QString *contents)
+{
+ ProFile *pro;
+ if (cache && m_cache) {
+ ProFileCache::Entry *ent;
+#ifdef PROPARSER_THREAD_SAFE
+ QMutexLocker locker(&m_cache->mutex);
+#endif
+ QHash<QString, ProFileCache::Entry>::Iterator it = m_cache->parsed_files.find(fileName);
+ if (it != m_cache->parsed_files.end()) {
+ ent = &*it;
+#ifdef PROPARSER_THREAD_SAFE
+ if (ent->locker && !ent->locker->done) {
+ ++ent->locker->waiters;
+ QThreadPool::globalInstance()->releaseThread();
+ ent->locker->cond.wait(locker.mutex());
+ QThreadPool::globalInstance()->reserveThread();
+ if (!--ent->locker->waiters) {
+ delete ent->locker;
+ ent->locker = 0;
+ }
+ }
+#endif
+ if ((pro = ent->pro))
+ pro->ref();
+ } else {
+ ent = &m_cache->parsed_files[fileName];
+#ifdef PROPARSER_THREAD_SAFE
+ ent->locker = new ProFileCache::Entry::Locker;
+ locker.unlock();
+#endif
+ pro = new ProFile(fileName);
+ if (!(!contents ? read(pro) : read(pro, *contents))) {
+ delete pro;
+ pro = 0;
+ } else {
+ pro->ref();
+ }
+ ent->pro = pro;
+#ifdef PROPARSER_THREAD_SAFE
+ locker.relock();
+ if (ent->locker->waiters) {
+ ent->locker->done = true;
+ ent->locker->cond.wakeAll();
+ } else {
+ delete ent->locker;
+ ent->locker = 0;
+ }
+#endif
+ }
+ } else {
+ pro = new ProFile(fileName);
+ if (!(!contents ? read(pro) : read(pro, *contents))) {
+ delete pro;
+ pro = 0;
+ }
+ }
+ return pro;
+}
+
+bool ProFileParser::read(ProFile *pro)
+{
+ QFile file(pro->fileName());
+ if (!file.open(QIODevice::ReadOnly)) {
+ if (m_handler && IoUtils::exists(pro->fileName()))
+ m_handler->parseError(QString(), 0, fL1S("%1 not readable.").arg(pro->fileName()));
+ return false;
+ }
+
+ QString content(QString::fromLocal8Bit(file.readAll()));
+ file.close();
+ return read(pro, content);
+}
+
+void ProFileParser::putTok(ushort *&tokPtr, ushort tok)
+{
+ *tokPtr++ = tok;
+}
+
+void ProFileParser::putBlockLen(ushort *&tokPtr, uint len)
+{
+ *tokPtr++ = (ushort)len;
+ *tokPtr++ = (ushort)(len >> 16);
+}
+
+void ProFileParser::putBlock(ushort *&tokPtr, const ushort *buf, uint len)
+{
+ memcpy(tokPtr, buf, len * 2);
+ tokPtr += len;
+}
+
+void ProFileParser::putHashStr(ushort *&pTokPtr, const ushort *buf, uint len)
+{
+ uint hash = ProString::hash((const QChar *)buf, len);
+ ushort *tokPtr = pTokPtr;
+ *tokPtr++ = (ushort)hash;
+ *tokPtr++ = (ushort)(hash >> 16);
+ *tokPtr++ = (ushort)len;
+ memcpy(tokPtr, buf, len * 2);
+ pTokPtr = tokPtr + len;
+}
+
+void ProFileParser::finalizeHashStr(ushort *buf, uint len)
+{
+ buf[-4] = TokHashLiteral;
+ buf[-1] = len;
+ uint hash = ProString::hash((const QChar *)buf, len);
+ buf[-3] = (ushort)hash;
+ buf[-2] = (ushort)(hash >> 16);
+}
+
+bool ProFileParser::read(ProFile *pro, const QString &in)
+{
+ m_proFile = pro;
+ m_lineNo = 1;
+
+ // Final precompiled token stream buffer
+ QString tokBuff;
+ // Worst-case size calculations:
+ // - line marker adds 1 (2-nl) to 1st token of each line
+ // - empty assignment "A=":2 =>
+ // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) +
+ // TokValueTerminator(1) == 7 (8)
+ // - non-empty assignment "A=B C":5 =>
+ // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) +
+ // TokLiteral(1) + len(1) + "B"(1) +
+ // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 13 (14)
+ // - variable expansion: "$$f":3 =>
+ // TokVariable(1) + hash(2) + len(1) + "f"(1) = 5
+ // - function expansion: "$$f()":5 =>
+ // TokFuncName(1) + hash(2) + len(1) + "f"(1) + TokFuncTerminator(1) = 6
+ // - scope: "X:":2 =>
+ // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokCondition(1) +
+ // TokBranch(1) + len(2) + ... + len(2) + ... == 10
+ // - test: "X():":4 =>
+ // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokTestCall(1) + TokFuncTerminator(1) +
+ // TokBranch(1) + len(2) + ... + len(2) + ... == 11
+ // - "for(A,B):":9 =>
+ // TokForLoop(1) + hash(2) + len(1) + "A"(1) +
+ // len(2) + TokLiteral(1) + len(1) + "B"(1) + TokValueTerminator(1) +
+ // len(2) + ... + TokTerminator(1) == 14 (15)
+ tokBuff.reserve((in.size() + 1) * 5);
+ ushort *tokPtr = (ushort *)tokBuff.constData(); // Current writing position
+
+ // Expression precompiler buffer.
+ QString xprBuff;
+ xprBuff.reserve(tokBuff.capacity()); // Excessive, but simple
+ ushort * const buf = (ushort *)xprBuff.constData();
+
+ // Parser state
+ m_blockstack.clear();
+ m_blockstack.resize(1);
+
+ QStack<ParseCtx> xprStack;
+ xprStack.reserve(10);
+
+ // We rely on QStrings being null-terminated, so don't maintain a global end pointer.
+ const ushort *cur = (const ushort *)in.unicode();
+ m_canElse = false;
+ freshLine:
+ m_state = StNew;
+ m_invert = false;
+ m_operator = NoOperator;
+ m_markLine = m_lineNo;
+ m_inError = false;
+ Context context = CtxTest;
+ int parens = 0; // Braces in value context
+ int argc = 0;
+ int wordCount = 0; // Number of words in currently accumulated expression
+ bool putSpace = false; // Only ever true inside quoted string
+ bool lineMarked = true; // For in-expression markers
+ ushort needSep = TokNewStr; // Complementary to putSpace: separator outside quotes
+ ushort quote = 0;
+ ushort term = 0;
+
+ ushort *ptr = buf;
+ ptr += 4;
+ ushort *xprPtr = ptr;
+
+#define FLUSH_LHS_LITERAL() \
+ do { \
+ if ((tlen = ptr - xprPtr)) { \
+ finalizeHashStr(xprPtr, tlen); \
+ if (needSep) { \
+ wordCount++; \
+ needSep = 0; \
+ } \
+ } else { \
+ ptr -= 4; \
+ } \
+ } while (0)
+
+#define FLUSH_RHS_LITERAL() \
+ do { \
+ if ((tlen = ptr - xprPtr)) { \
+ xprPtr[-2] = TokLiteral | needSep; \
+ xprPtr[-1] = tlen; \
+ if (needSep) { \
+ wordCount++; \
+ needSep = 0; \
+ } \
+ } else { \
+ ptr -= 2; \
+ } \
+ } while (0)
+
+#define FLUSH_LITERAL() \
+ do { \
+ if (context == CtxTest) \
+ FLUSH_LHS_LITERAL(); \
+ else \
+ FLUSH_RHS_LITERAL(); \
+ } while (0)
+
+#define FLUSH_VALUE_LIST() \
+ do { \
+ if (wordCount > 1) { \
+ xprPtr = tokPtr; \
+ if (*xprPtr == TokLine) \
+ xprPtr += 2; \
+ tokPtr[-1] = ((*xprPtr & TokMask) == TokLiteral) ? wordCount : 0; \
+ } else { \
+ tokPtr[-1] = 0; \
+ } \
+ tokPtr = ptr; \
+ putTok(tokPtr, TokValueTerminator); \
+ } while (0)
+
+ forever {
+ ushort c;
+
+ // First, skip leading whitespace
+ for (;; ++cur) {
+ c = *cur;
+ if (c == '\n') {
+ ++cur;
+ goto flushLine;
+ } else if (!c) {
+ goto flushLine;
+ } else if (c != ' ' && c != '\t' && c != '\r') {
+ break;
+ }
+ }
+
+ // Then strip comments. Yep - no escaping is possible.
+ const ushort *end; // End of this line
+ const ushort *cptr; // Start of next line
+ for (cptr = cur;; ++cptr) {
+ c = *cptr;
+ if (c == '#') {
+ for (end = cptr; (c = *++cptr);) {
+ if (c == '\n') {
+ ++cptr;
+ break;
+ }
+ }
+ if (end == cur) { // Line with only a comment (sans whitespace)
+ if (m_markLine == m_lineNo)
+ m_markLine++;
+ // Qmake bizarreness: such lines do not affect line continuations
+ goto ignore;
+ }
+ break;
+ }
+ if (!c) {
+ end = cptr;
+ break;
+ }
+ if (c == '\n') {
+ end = cptr++;
+ break;
+ }
+ }
+
+ // Then look for line continuations. Yep - no escaping here as well.
+ bool lineCont;
+ forever {
+ // We don't have to check for underrun here, as we already determined
+ // that the line is non-empty.
+ ushort ec = *(end - 1);
+ if (ec == '\\') {
+ --end;
+ lineCont = true;
+ break;
+ }
+ if (ec != ' ' && ec != '\t' && ec != '\r') {
+ lineCont = false;
+ break;
+ }
+ --end;
+ }
+
+ // Finally, do the tokenization
+ ushort tok, rtok;
+ int tlen;
+ newWord:
+ do {
+ if (cur == end)
+ goto lineEnd;
+ c = *cur++;
+ } while (c == ' ' || c == '\t');
+ forever {
+ if (c == '$') {
+ if (*cur == '$') { // may be EOF, EOL, WS, '#' or '\\' if past end
+ cur++;
+ if (putSpace) {
+ putSpace = false;
+ *ptr++ = ' ';
+ }
+ FLUSH_LITERAL();
+ if (!lineMarked) {
+ lineMarked = true;
+ *ptr++ = TokLine;
+ *ptr++ = (ushort)m_lineNo;
+ }
+ term = 0;
+ tok = TokVariable;
+ c = *cur;
+ if (c == '[') {
+ ptr += 2;
+ tok = TokProperty;
+ term = ']';
+ c = *++cur;
+ } else if (c == '{') {
+ ptr += 4;
+ term = '}';
+ c = *++cur;
+ } else if (c == '(') {
+ // FIXME: could/should expand this immediately
+ ptr += 2;
+ tok = TokEnvVar;
+ term = ')';
+ c = *++cur;
+ } else {
+ ptr += 4;
+ }
+ xprPtr = ptr;
+ rtok = tok;
+ while ((c & 0xFF00) || c == '.' || c == '_' ||
+ (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
+ (c >= '0' && c <= '9')) {
+ *ptr++ = c;
+ if (++cur == end) {
+ c = 0;
+ goto notfunc;
+ }
+ c = *cur;
+ }
+ if (tok == TokVariable && c == '(')
+ tok = TokFuncName;
+ notfunc:
+ if (quote)
+ tok |= TokQuoted;
+ if (needSep) {
+ tok |= needSep;
+ wordCount++;
+ }
+ tlen = ptr - xprPtr;
+ if (rtok == TokVariable) {
+ xprPtr[-4] = tok;
+ uint hash = ProString::hash((const QChar *)xprPtr, tlen);
+ xprPtr[-3] = (ushort)hash;
+ xprPtr[-2] = (ushort)(hash >> 16);
+ } else {
+ xprPtr[-2] = tok;
+ }
+ xprPtr[-1] = tlen;
+ if ((tok & TokMask) == TokFuncName) {
+ cur++;
+ funcCall:
+ {
+ xprStack.resize(xprStack.size() + 1);
+ ParseCtx &top = xprStack.top();
+ top.parens = parens;
+ top.quote = quote;
+ top.terminator = term;
+ top.context = context;
+ top.argc = argc;
+ top.wordCount = wordCount;
+ }
+ parens = 0;
+ quote = 0;
+ term = 0;
+ argc = 1;
+ context = CtxArgs;
+ nextToken:
+ wordCount = 0;
+ nextWord:
+ ptr += (context == CtxTest) ? 4 : 2;
+ xprPtr = ptr;
+ needSep = TokNewStr;
+ goto newWord;
+ }
+ if (term) {
+ cur++;
+ checkTerm:
+ if (c != term) {
+ parseError(fL1S("Missing %1 terminator [found %2]")
+ .arg(QChar(term))
+ .arg(c ? QString(c) : QString::fromLatin1("end-of-line")));
+ pro->setOk(false);
+ m_inError = true;
+ if (c)
+ cur--;
+ // Just parse on, as if there was a terminator ...
+ }
+ }
+ joinToken:
+ ptr += (context == CtxTest) ? 4 : 2;
+ xprPtr = ptr;
+ needSep = 0;
+ goto nextChr;
+ }
+ } else if (c == '\\' && cur != end) {
+ static const char symbols[] = "[]{}()$\\'\"";
+ ushort c2 = *cur;
+ if (!(c2 & 0xff00) && strchr(symbols, c2)) {
+ c = c2;
+ cur++;
+ }
+ } else if (quote) {
+ if (c == quote) {
+ quote = 0;
+ if (putSpace) {
+ putSpace = false;
+ *ptr++ = ' ';
+ }
+ goto nextChr;
+ } else if (c == ' ' || c == '\t') {
+ putSpace = true;
+ goto nextChr;
+ } else if (c == '!' && ptr == xprPtr && context == CtxTest) {
+ m_invert ^= true;
+ goto nextChr;
+ }
+ } else if (c == '\'' || c == '"') {
+ quote = c;
+ goto nextChr;
+ } else if (c == ' ' || c == '\t') {
+ FLUSH_LITERAL();
+ goto nextWord;
+ } else if (context == CtxArgs) {
+ // Function arg context
+ if (c == '(') {
+ ++parens;
+ } else if (c == ')') {
+ if (--parens < 0) {
+ FLUSH_RHS_LITERAL();
+ *ptr++ = TokFuncTerminator;
+ int theargc = argc;
+ {
+ ParseCtx &top = xprStack.top();
+ parens = top.parens;
+ quote = top.quote;
+ term = top.terminator;
+ context = top.context;
+ argc = top.argc;
+ wordCount = top.wordCount;
+ xprStack.resize(xprStack.size() - 1);
+ }
+ if (term == ':') {
+ finalizeCall(tokPtr, buf, ptr, theargc);
+ goto nextItem;
+ } else if (term == '}') {
+ c = (cur == end) ? 0 : *cur++;
+ goto checkTerm;
+ } else {
+ Q_ASSERT(!term);
+ goto joinToken;
+ }
+ }
+ } else if (!parens && c == ',') {
+ FLUSH_RHS_LITERAL();
+ *ptr++ = TokArgSeparator;
+ argc++;
+ goto nextToken;
+ }
+ } else if (context == CtxTest) {
+ // Test or LHS context
+ if (c == '(') {
+ FLUSH_LHS_LITERAL();
+ if (wordCount != 1) {
+ if (wordCount)
+ parseError(fL1S("Extra characters after test expression."));
+ else
+ parseError(fL1S("Opening parenthesis without prior test name."));
+ pro->setOk(false);
+ ptr = buf; // Put empty function name
+ }
+ *ptr++ = TokTestCall;
+ term = ':';
+ goto funcCall;
+ } else if (c == '!' && ptr == xprPtr) {
+ m_invert ^= true;
+ goto nextChr;
+ } else if (c == ':') {
+ FLUSH_LHS_LITERAL();
+ finalizeCond(tokPtr, buf, ptr, wordCount);
+ if (m_state == StNew)
+ parseError(fL1S("And operator without prior condition."));
+ else
+ m_operator = AndOperator;
+ nextItem:
+ ptr = buf;
+ goto nextToken;
+ } else if (c == '|') {
+ FLUSH_LHS_LITERAL();
+ finalizeCond(tokPtr, buf, ptr, wordCount);
+ if (m_state != StCond)
+ parseError(fL1S("Or operator without prior condition."));
+ else
+ m_operator = OrOperator;
+ goto nextItem;
+ } else if (c == '{') {
+ FLUSH_LHS_LITERAL();
+ finalizeCond(tokPtr, buf, ptr, wordCount);
+ flushCond(tokPtr);
+ ++m_blockstack.top().braceLevel;
+ goto nextItem;
+ } else if (c == '}') {
+ FLUSH_LHS_LITERAL();
+ finalizeCond(tokPtr, buf, ptr, wordCount);
+ flushScopes(tokPtr);
+ closeScope:
+ if (!m_blockstack.top().braceLevel) {
+ parseError(fL1S("Excess closing brace."));
+ } else if (!--m_blockstack.top().braceLevel
+ && m_blockstack.count() != 1) {
+ leaveScope(tokPtr);
+ m_state = StNew;
+ m_canElse = false;
+ m_markLine = m_lineNo;
+ }
+ goto nextItem;
+ } else if (c == '+') {
+ tok = TokAppend;
+ goto do2Op;
+ } else if (c == '-') {
+ tok = TokRemove;
+ goto do2Op;
+ } else if (c == '*') {
+ tok = TokAppendUnique;
+ goto do2Op;
+ } else if (c == '~') {
+ tok = TokReplace;
+ do2Op:
+ if (*cur == '=') {
+ cur++;
+ goto doOp;
+ }
+ } else if (c == '=') {
+ tok = TokAssign;
+ doOp:
+ FLUSH_LHS_LITERAL();
+ flushCond(tokPtr);
+ putLineMarker(tokPtr);
+ if (wordCount != 1) {
+ parseError(fL1S("Assignment needs exactly one word on the left hand side."));
+ pro->setOk(false);
+ // Put empty variable name.
+ } else {
+ putBlock(tokPtr, buf, ptr - buf);
+ }
+ putTok(tokPtr, tok);
+ context = CtxValue;
+ ptr = ++tokPtr;
+ goto nextToken;
+ }
+ } else { // context == CtxValue
+ if (c == '{') {
+ ++parens;
+ } else if (c == '}') {
+ if (!parens) {
+ FLUSH_RHS_LITERAL();
+ FLUSH_VALUE_LIST();
+ context = CtxTest;
+ goto closeScope;
+ }
+ --parens;
+ }
+ }
+ if (putSpace) {
+ putSpace = false;
+ *ptr++ = ' ';
+ }
+ *ptr++ = c;
+ nextChr:
+ if (cur == end)
+ goto lineEnd;
+ c = *cur++;
+ }
+
+ lineEnd:
+ if (lineCont) {
+ if (quote) {
+ putSpace = true;
+ } else {
+ FLUSH_LITERAL();
+ needSep = TokNewStr;
+ ptr += (context == CtxTest) ? 4 : 2;
+ xprPtr = ptr;
+ }
+ } else {
+ c = '\n';
+ cur = cptr;
+ flushLine:
+ FLUSH_LITERAL();
+ if (quote) {
+ parseError(fL1S("Missing closing %1 quote").arg(QChar(quote)));
+ if (!xprStack.isEmpty()) {
+ context = xprStack.at(0).context;
+ xprStack.clear();
+ }
+ goto flErr;
+ } else if (!xprStack.isEmpty()) {
+ parseError(fL1S("Missing closing parenthesis in function call"));
+ context = xprStack.at(0).context;
+ xprStack.clear();
+ flErr:
+ pro->setOk(false);
+ if (context == CtxValue) {
+ tokPtr[-1] = 0; // sizehint
+ putTok(tokPtr, TokValueTerminator);
+ } else {
+ bogusTest(tokPtr);
+ }
+ } else if (context == CtxValue) {
+ FLUSH_VALUE_LIST();
+ } else {
+ finalizeCond(tokPtr, buf, ptr, wordCount);
+ }
+ if (!c)
+ break;
+ ++m_lineNo;
+ goto freshLine;
+ }
+
+ if (!lineCont) {
+ cur = cptr;
+ ++m_lineNo;
+ goto freshLine;
+ }
+ lineMarked = false;
+ ignore:
+ cur = cptr;
+ ++m_lineNo;
+ }
+
+ flushScopes(tokPtr);
+ if (m_blockstack.size() > 1) {
+ parseError(fL1S("Missing closing brace(s)."));
+ pro->setOk(false);
+ }
+ while (m_blockstack.size())
+ leaveScope(tokPtr);
+ xprBuff.clear();
+ *pro->itemsRef() = QString(tokBuff.constData(), tokPtr - (ushort *)tokBuff.constData());
+ return true;
+
+#undef FLUSH_VALUE_LIST
+#undef FLUSH_LITERAL
+#undef FLUSH_LHS_LITERAL
+#undef FLUSH_RHS_LITERAL
+}
+
+void ProFileParser::putLineMarker(ushort *&tokPtr)
+{
+ if (m_markLine) {
+ *tokPtr++ = TokLine;
+ *tokPtr++ = (ushort)m_markLine;
+ m_markLine = 0;
+ }
+}
+
+void ProFileParser::enterScope(ushort *&tokPtr, bool special, ScopeState state)
+{
+ m_blockstack.resize(m_blockstack.size() + 1);
+ m_blockstack.top().special = special;
+ m_blockstack.top().start = tokPtr;
+ tokPtr += 2;
+ m_state = state;
+ m_canElse = false;
+ if (special)
+ m_markLine = m_lineNo;
+}
+
+void ProFileParser::leaveScope(ushort *&tokPtr)
+{
+ if (m_blockstack.top().inBranch) {
+ // Put empty else block
+ putBlockLen(tokPtr, 0);
+ }
+ if (ushort *start = m_blockstack.top().start) {
+ putTok(tokPtr, TokTerminator);
+ uint len = tokPtr - start - 2;
+ start[0] = (ushort)len;
+ start[1] = (ushort)(len >> 16);
+ }
+ m_blockstack.resize(m_blockstack.size() - 1);
+}
+
+// If we are on a fresh line, close all open one-line scopes.
+void ProFileParser::flushScopes(ushort *&tokPtr)
+{
+ if (m_state == StNew) {
+ while (!m_blockstack.top().braceLevel && m_blockstack.size() > 1)
+ leaveScope(tokPtr);
+ if (m_blockstack.top().inBranch) {
+ m_blockstack.top().inBranch = false;
+ // Put empty else block
+ putBlockLen(tokPtr, 0);
+ }
+ m_canElse = false;
+ }
+}
+
+// If there is a pending conditional, enter a new scope, otherwise flush scopes.
+void ProFileParser::flushCond(ushort *&tokPtr)
+{
+ if (m_state == StCond) {
+ putTok(tokPtr, TokBranch);
+ m_blockstack.top().inBranch = true;
+ enterScope(tokPtr, false, StNew);
+ } else {
+ flushScopes(tokPtr);
+ }
+}
+
+void ProFileParser::finalizeTest(ushort *&tokPtr)
+{
+ flushScopes(tokPtr);
+ putLineMarker(tokPtr);
+ if (m_operator != NoOperator) {
+ putTok(tokPtr, (m_operator == AndOperator) ? TokAnd : TokOr);
+ m_operator = NoOperator;
+ }
+ if (m_invert) {
+ putTok(tokPtr, TokNot);
+ m_invert = false;
+ }
+ m_state = StCond;
+ m_canElse = true;
+}
+
+void ProFileParser::bogusTest(ushort *&tokPtr)
+{
+ flushScopes(tokPtr);
+ m_operator = NoOperator;
+ m_invert = false;
+ m_state = StCond;
+ m_canElse = true;
+ m_proFile->setOk(false);
+}
+
+void ProFileParser::finalizeCond(ushort *&tokPtr, ushort *uc, ushort *ptr, int wordCount)
+{
+ if (wordCount != 1) {
+ if (wordCount) {
+ parseError(fL1S("Extra characters after test expression."));
+ bogusTest(tokPtr);
+ }
+ return;
+ }
+
+ // Check for magic tokens
+ if (*uc == TokHashLiteral) {
+ uint nlen = uc[3];
+ ushort *uce = uc + 4 + nlen;
+ if (uce == ptr) {
+ m_tmp.setRawData((QChar *)uc + 4, nlen);
+ if (!m_tmp.compare(statics.strelse, Qt::CaseInsensitive)) {
+ if (m_invert || m_operator != NoOperator) {
+ parseError(fL1S("Unexpected operator in front of else."));
+ return;
+ }
+ BlockScope &top = m_blockstack.top();
+ if (m_canElse && (!top.special || top.braceLevel)) {
+ // A list of tests (the last one likely with side effects),
+ // but no assignment, scope, etc.
+ putTok(tokPtr, TokBranch);
+ // Put empty then block
+ putBlockLen(tokPtr, 0);
+ enterScope(tokPtr, false, StCtrl);
+ return;
+ }
+ forever {
+ BlockScope &top = m_blockstack.top();
+ if (top.inBranch && (!top.special || top.braceLevel)) {
+ top.inBranch = false;
+ enterScope(tokPtr, false, StCtrl);
+ return;
+ }
+ if (top.braceLevel || m_blockstack.size() == 1)
+ break;
+ leaveScope(tokPtr);
+ }
+ parseError(fL1S("Unexpected 'else'."));
+ return;
+ }
+ }
+ }
+
+ finalizeTest(tokPtr);
+ putBlock(tokPtr, uc, ptr - uc);
+ putTok(tokPtr, TokCondition);
+}
+
+void ProFileParser::finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int argc)
+{
+ // Check for magic tokens
+ if (*uc == TokHashLiteral) {
+ uint nlen = uc[3];
+ ushort *uce = uc + 4 + nlen;
+ if (*uce == TokTestCall) {
+ uce++;
+ m_tmp.setRawData((QChar *)uc + 4, nlen);
+ const QString *defName;
+ ushort defType;
+ if (m_tmp == statics.strfor) {
+ flushCond(tokPtr);
+ putLineMarker(tokPtr);
+ if (m_invert || m_operator == OrOperator) {
+ // '|' could actually work reasonably, but qmake does nonsense here.
+ parseError(fL1S("Unexpected operator in front of for()."));
+ return;
+ }
+ if (*uce == (TokLiteral|TokNewStr)) {
+ nlen = uce[1];
+ uc = uce + 2 + nlen;
+ if (*uc == TokFuncTerminator) {
+ // for(literal) (only "ever" would be legal if qmake was sane)
+ putTok(tokPtr, TokForLoop);
+ putHashStr(tokPtr, (ushort *)0, (uint)0);
+ putBlockLen(tokPtr, 1 + 3 + nlen + 1);
+ putTok(tokPtr, TokHashLiteral);
+ putHashStr(tokPtr, uce + 2, nlen);
+ didFor:
+ putTok(tokPtr, TokValueTerminator);
+ enterScope(tokPtr, true, StCtrl);
+ return;
+ } else if (*uc == TokArgSeparator && argc == 2) {
+ // for(var, something)
+ uc++;
+ putTok(tokPtr, TokForLoop);
+ putHashStr(tokPtr, uce + 2, nlen);
+ doFor:
+ nlen = ptr - uc;
+ putBlockLen(tokPtr, nlen + 1);
+ putBlock(tokPtr, uc, nlen);
+ goto didFor;
+ }
+ } else if (argc == 1) {
+ // for(non-literal) (this wouldn't be here if qmake was sane)
+ putTok(tokPtr, TokForLoop);
+ putHashStr(tokPtr, (ushort *)0, (uint)0);
+ uc = uce;
+ goto doFor;
+ }
+ parseError(fL1S("Syntax is for(var, list), for(var, forever) or for(ever)."));
+ return;
+ } else if (m_tmp == statics.strdefineReplace) {
+ defName = &statics.strdefineReplace;
+ defType = TokReplaceDef;
+ goto deffunc;
+ } else if (m_tmp == statics.strdefineTest) {
+ defName = &statics.strdefineTest;
+ defType = TokTestDef;
+ deffunc:
+ flushScopes(tokPtr);
+ putLineMarker(tokPtr);
+ if (m_invert) {
+ parseError(fL1S("Unexpected operator in front of function definition."));
+ return;
+ }
+ if (*uce == (TokLiteral|TokNewStr)) {
+ uint nlen = uce[1];
+ if (uce[nlen + 2] == TokFuncTerminator) {
+ if (m_operator != NoOperator) {
+ putTok(tokPtr, (m_operator == AndOperator) ? TokAnd : TokOr);
+ m_operator = NoOperator;
+ }
+ putTok(tokPtr, defType);
+ putHashStr(tokPtr, uce + 2, nlen);
+ uc = uce + 2 + nlen + 1;
+ enterScope(tokPtr, true, StCtrl);
+ return;
+ }
+ }
+ parseError(fL1S("%1(function) requires one literal argument.").arg(*defName));
+ return;
+ }
+ }
+ }
+
+ finalizeTest(tokPtr);
+ putBlock(tokPtr, uc, ptr - uc);
+}
+
+void ProFileParser::parseError(const QString &msg) const
+{
+ if (!m_inError && m_handler)
+ m_handler->parseError(m_proFile->fileName(), m_lineNo, msg);
+}
+
+QT_END_NAMESPACE
diff --git a/tools/linguist/shared/profileparser.h b/tools/linguist/shared/profileparser.h
new file mode 100644
index 0000000000..643e339b31
--- /dev/null
+++ b/tools/linguist/shared/profileparser.h
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PROFILEPARSER_H
+#define PROFILEPARSER_H
+
+#include "proparser_global.h"
+#include "proitems.h"
+#include <QtCore/QHash>
+#include <QtCore/QStack>
+#ifdef PROPARSER_THREAD_SAFE
+# include <QtCore/QMutex>
+# include <QtCore/QWaitCondition>
+#endif
+
+// Be fast even for debug builds
+#ifdef __GNUC__
+# define ALWAYS_INLINE inline __attribute__((always_inline))
+#elif defined(_MSC_VER)
+# define ALWAYS_INLINE __forceinline
+#else
+# define ALWAYS_INLINE inline
+#endif
+
+QT_BEGIN_NAMESPACE
+class PROPARSER_EXPORT ProFileParserHandler
+{
+public:
+ // Some error during parsing
+ virtual void parseError(const QString &filename, int lineNo, const QString &msg) = 0;
+};
+
+class ProFileCache;
+
+class PROPARSER_EXPORT ProFileParser
+{
+public:
+ // Call this from a concurrency-free context
+ static void initialize();
+
+ ProFileParser(ProFileCache *cache, ProFileParserHandler *handler);
+
+ // fileName is expected to be absolute and cleanPath()ed.
+ // If contents is non-null, it will be used instead of the file's actual content
+ ProFile *parsedProFile(const QString &fileName, bool cache = false,
+ const QString *contents = 0);
+ ProFile *parsedProBlock(const QString &name, const QString &contents)
+ { return parsedProFile(name, false, &contents); }
+
+private:
+ struct BlockScope {
+ BlockScope() : start(0), braceLevel(0), special(false), inBranch(false) {}
+ BlockScope(const BlockScope &other) { *this = other; }
+ ushort *start; // Where this block started; store length here
+ int braceLevel; // Nesting of braces in scope
+ bool special; // Single-line conditionals inside loops, etc. cannot have else branches
+ bool inBranch; // The 'else' branch of the previous TokBranch is still open
+ };
+
+ enum ScopeState {
+ StNew, // Fresh scope
+ StCtrl, // Control statement (for or else) met on current line
+ StCond // Conditionals met on current line
+ };
+
+ enum Context { CtxTest, CtxValue, CtxArgs };
+ struct ParseCtx {
+ int parens; // Nesting of non-functional parentheses
+ int argc; // Number of arguments in current function call
+ int wordCount; // Number of words in current expression
+ Context context;
+ ushort quote; // Enclosing quote type
+ ushort terminator; // '}' if replace function call is braced, ':' if test function
+ };
+
+ bool read(ProFile *pro);
+ bool read(ProFile *pro, const QString &content);
+
+ ALWAYS_INLINE void putTok(ushort *&tokPtr, ushort tok);
+ ALWAYS_INLINE void putBlockLen(ushort *&tokPtr, uint len);
+ ALWAYS_INLINE void putBlock(ushort *&tokPtr, const ushort *buf, uint len);
+ void putHashStr(ushort *&pTokPtr, const ushort *buf, uint len);
+ void finalizeHashStr(ushort *buf, uint len);
+ void putLineMarker(ushort *&tokPtr);
+ void finalizeCond(ushort *&tokPtr, ushort *uc, ushort *ptr, int wordCount);
+ void finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int argc);
+ void finalizeTest(ushort *&tokPtr);
+ void bogusTest(ushort *&tokPtr);
+ void enterScope(ushort *&tokPtr, bool special, ScopeState state);
+ void leaveScope(ushort *&tokPtr);
+ void flushCond(ushort *&tokPtr);
+ void flushScopes(ushort *&tokPtr);
+
+ void parseError(const QString &msg) const;
+
+ // Current location
+ ProFile *m_proFile;
+ int m_lineNo;
+
+ QStack<BlockScope> m_blockstack;
+ ScopeState m_state;
+ int m_markLine; // Put marker for this line
+ bool m_inError; // Current line had a parsing error; suppress followup error messages
+ bool m_canElse; // Conditionals met on previous line, but no scope was opened
+ bool m_invert; // Pending conditional is negated
+ enum { NoOperator, AndOperator, OrOperator } m_operator; // Pending conditional is ORed/ANDed
+
+ QString m_tmp; // Temporary for efficient toQString
+
+ ProFileCache *m_cache;
+ ProFileParserHandler *m_handler;
+
+ // This doesn't help gcc 3.3 ...
+ template<typename T> friend class QTypeInfo;
+
+ friend class ProFileCache;
+};
+
+class PROPARSER_EXPORT ProFileCache
+{
+public:
+ ProFileCache() {}
+ ~ProFileCache();
+
+ void discardFile(const QString &fileName);
+ void discardFiles(const QString &prefix);
+
+private:
+ struct Entry {
+ ProFile *pro;
+#ifdef PROPARSER_THREAD_SAFE
+ struct Locker {
+ Locker() : waiters(0), done(false) {}
+ QWaitCondition cond;
+ int waiters;
+ bool done;
+ };
+ Locker *locker;
+#endif
+ };
+
+ QHash<QString, Entry> parsed_files;
+#ifdef PROPARSER_THREAD_SAFE
+ QMutex mutex;
+#endif
+
+ friend class ProFileParser;
+};
+
+#if !defined(__GNUC__) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)
+Q_DECLARE_TYPEINFO(ProFileParser::BlockScope, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(ProFileParser::Context, Q_PRIMITIVE_TYPE);
+#endif
+
+QT_END_NAMESPACE
+
+#endif // PROFILEPARSER_H
diff --git a/tools/linguist/shared/proitems.cpp b/tools/linguist/shared/proitems.cpp
index 5c88686321..103a788d91 100644
--- a/tools/linguist/shared/proitems.cpp
+++ b/tools/linguist/shared/proitems.cpp
@@ -40,319 +40,335 @@
****************************************************************************/
#include "proitems.h"
-#include "abstractproitemvisitor.h"
#include <QtCore/QFileInfo>
+#include <QtCore/QSet>
QT_BEGIN_NAMESPACE
-// --------------- ProItem ------------
-void ProItem::setComment(const QString &comment)
-{
- m_comment = comment;
-}
-
-QString ProItem::comment() const
-{
- return m_comment;
-}
-
-// --------------- ProBlock ----------------
-
-ProBlock::ProBlock(ProBlock *parent)
-{
- m_blockKind = 0;
- m_parent = parent;
- m_refCount = 1;
-}
-
-ProBlock::~ProBlock()
-{
- foreach (ProItem *itm, m_proitems)
- if (itm->kind() == BlockKind)
- static_cast<ProBlock *>(itm)->deref();
- else
- delete itm;
-}
-
-void ProBlock::appendItem(ProItem *proitem)
-{
- m_proitems << proitem;
-}
+using namespace ProStringConstants;
-void ProBlock::setItems(const QList<ProItem *> &proitems)
+// from qhash.cpp
+uint ProString::hash(const QChar *p, int n)
{
- m_proitems = proitems;
-}
+ uint h = 0;
-QList<ProItem *> ProBlock::items() const
-{
- return m_proitems;
-}
-
-void ProBlock::setBlockKind(int blockKind)
-{
- m_blockKind = blockKind;
+ while (n--) {
+ h = (h << 4) + (*p++).unicode();
+ h ^= (h & 0xf0000000) >> 23;
+ h &= 0x0fffffff;
+ }
+ return h;
}
-int ProBlock::blockKind() const
+ProString::ProString() :
+ m_offset(0), m_length(0), m_file(0), m_hash(0x80000000)
{
- return m_blockKind;
}
-void ProBlock::setParent(ProBlock *parent)
+ProString::ProString(const ProString &other) :
+ m_string(other.m_string), m_offset(other.m_offset), m_length(other.m_length), m_file(other.m_file), m_hash(other.m_hash)
{
- m_parent = parent;
}
-ProBlock *ProBlock::parent() const
+ProString::ProString(const ProString &other, OmitPreHashing) :
+ m_string(other.m_string), m_offset(other.m_offset), m_length(other.m_length), m_file(other.m_file), m_hash(0x80000000)
{
- return m_parent;
}
-ProItem::ProItemKind ProBlock::kind() const
+ProString::ProString(const QString &str) :
+ m_string(str), m_offset(0), m_length(str.length()), m_file(0)
{
- return ProItem::BlockKind;
+ updatedHash();
}
-ProItem::ProItemReturn ProBlock::Accept(AbstractProItemVisitor *visitor)
+ProString::ProString(const QString &str, OmitPreHashing) :
+ m_string(str), m_offset(0), m_length(str.length()), m_file(0), m_hash(0x80000000)
{
- if (visitor->visitBeginProBlock(this) == ReturnSkip)
- return ReturnTrue;
- ProItemReturn rt = ReturnTrue;
- for (int i = 0; i < m_proitems.count(); ++i) {
- rt = m_proitems.at(i)->Accept(visitor);
- if (rt != ReturnTrue && rt != ReturnFalse) {
- if (rt == ReturnLoop) {
- rt = ReturnTrue;
- while (visitor->visitProLoopIteration())
- for (int j = i; ++j < m_proitems.count(); ) {
- rt = m_proitems.at(j)->Accept(visitor);
- if (rt != ReturnTrue && rt != ReturnFalse) {
- if (rt == ReturnNext) {
- rt = ReturnTrue;
- break;
- }
- if (rt == ReturnBreak)
- rt = ReturnTrue;
- goto do_break;
- }
- }
- do_break:
- visitor->visitProLoopCleanup();
- }
- break;
- }
- }
- visitor->visitEndProBlock(this);
- return rt;
}
-// --------------- ProVariable ----------------
-ProVariable::ProVariable(const QString &name, ProBlock *parent)
- : ProBlock(parent)
+ProString::ProString(const char *str) :
+ m_string(QString::fromLatin1(str)), m_offset(0), m_length(qstrlen(str)), m_file(0)
{
- setBlockKind(ProBlock::VariableKind);
- m_variable = name;
- m_variableKind = SetOperator;
+ updatedHash();
}
-void ProVariable::setVariableOperator(VariableOperator variableKind)
+ProString::ProString(const char *str, OmitPreHashing) :
+ m_string(QString::fromLatin1(str)), m_offset(0), m_length(qstrlen(str)), m_file(0), m_hash(0x80000000)
{
- m_variableKind = variableKind;
}
-ProVariable::VariableOperator ProVariable::variableOperator() const
+ProString::ProString(const QString &str, int offset, int length) :
+ m_string(str), m_offset(offset), m_length(length), m_file(0)
{
- return m_variableKind;
+ updatedHash();
}
-void ProVariable::setVariable(const QString &name)
+ProString::ProString(const QString &str, int offset, int length, uint hash) :
+ m_string(str), m_offset(offset), m_length(length), m_file(0), m_hash(hash)
{
- m_variable = name;
}
-QString ProVariable::variable() const
+ProString::ProString(const QString &str, int offset, int length, ProStringConstants::OmitPreHashing) :
+ m_string(str), m_offset(offset), m_length(length), m_file(0), m_hash(0x80000000)
{
- return m_variable;
}
-ProItem::ProItemReturn ProVariable::Accept(AbstractProItemVisitor *visitor)
+void ProString::setValue(const QString &str)
{
- visitor->visitBeginProVariable(this);
- foreach (ProItem *item, m_proitems)
- item->Accept(visitor); // cannot fail
- visitor->visitEndProVariable(this);
- return ReturnTrue;
+ m_string = str, m_offset = 0, m_length = str.length();
+ updatedHash();
}
-// --------------- ProValue ----------------
-ProValue::ProValue(const QString &value, ProVariable *variable)
+void ProString::setValue(const QString &str, OmitPreHashing)
{
- m_variable = variable;
- m_value = value;
+ m_string = str, m_offset = 0, m_length = str.length(), m_hash = 0x80000000;
}
-void ProValue::setValue(const QString &value)
+uint ProString::updatedHash() const
{
- m_value = value;
+ return (m_hash = hash(m_string.constData() + m_offset, m_length));
}
-QString ProValue::value() const
+uint qHash(const ProString &str)
{
- return m_value;
+ if (!(str.m_hash & 0x80000000))
+ return str.m_hash;
+ return str.updatedHash();
}
-void ProValue::setVariable(ProVariable *variable)
+QString ProString::toQString() const
{
- m_variable = variable;
+ return m_string.mid(m_offset, m_length);
}
-ProVariable *ProValue::variable() const
+QString &ProString::toQString(QString &tmp) const
{
- return m_variable;
+ return tmp.setRawData(m_string.constData() + m_offset, m_length);
}
-ProItem::ProItemKind ProValue::kind() const
+bool ProString::operator==(const ProString &other) const
{
- return ProItem::ValueKind;
+ if (m_length != other.m_length)
+ return false;
+ return !memcmp(m_string.constData() + m_offset,
+ other.m_string.constData() + other.m_offset, m_length * 2);
}
-ProItem::ProItemReturn ProValue::Accept(AbstractProItemVisitor *visitor)
+bool ProString::operator==(const QString &other) const
{
- visitor->visitProValue(this);
- return ReturnTrue;
+ if (m_length != other.length())
+ return false;
+ return !memcmp(m_string.constData() + m_offset, other.constData(), m_length * 2);
}
-// --------------- ProFunction ----------------
-ProFunction::ProFunction(const QString &text)
+bool ProString::operator==(const QLatin1String &other) const
{
- m_text = text;
-}
+ const ushort *uc = (ushort *)m_string.constData() + m_offset;
+ const ushort *e = uc + m_length;
+ const uchar *c = (uchar *)other.latin1();
-void ProFunction::setText(const QString &text)
-{
- m_text = text;
-}
+ if (!c)
+ return isEmpty();
-QString ProFunction::text() const
-{
- return m_text;
-}
-
-ProItem::ProItemKind ProFunction::kind() const
-{
- return ProItem::FunctionKind;
-}
-
-ProItem::ProItemReturn ProFunction::Accept(AbstractProItemVisitor *visitor)
-{
- return visitor->visitProFunction(this);
+ while (*c) {
+ if (uc == e || *uc != *c)
+ return false;
+ ++uc;
+ ++c;
+ }
+ return (uc == e);
+}
+
+QChar *ProString::prepareAppend(int extraLen)
+{
+ if (m_string.isDetached() && m_length + extraLen <= m_string.capacity()) {
+ m_string.reserve(0); // Prevent the resize() below from reallocating
+ QChar *ptr = (QChar *)m_string.constData();
+ if (m_offset)
+ memmove(ptr, ptr + m_offset, m_length * 2);
+ ptr += m_length;
+ m_offset = 0;
+ m_length += extraLen;
+ m_string.resize(m_length);
+ m_hash = 0x80000000;
+ return ptr;
+ } else {
+ QString neu(m_length + extraLen, Qt::Uninitialized);
+ QChar *ptr = (QChar *)neu.constData();
+ memcpy(ptr, m_string.constData() + m_offset, m_length * 2);
+ ptr += m_length;
+ *this = ProString(neu, NoHash);
+ return ptr;
+ }
}
-// --------------- ProCondition ----------------
-ProCondition::ProCondition(const QString &text)
+// If pending != 0, prefix with space if appending to non-empty non-pending
+ProString &ProString::append(const ProString &other, bool *pending)
{
- m_text = text;
+ if (other.m_length) {
+ if (!m_length) {
+ *this = other;
+ } else {
+ QChar *ptr;
+ if (pending && !*pending) {
+ ptr = prepareAppend(1 + other.m_length);
+ *ptr++ = 32;
+ } else {
+ ptr = prepareAppend(other.m_length);
+ }
+ memcpy(ptr, other.m_string.constData() + other.m_offset, other.m_length * 2);
+ if (other.m_file)
+ m_file = other.m_file;
+ }
+ if (pending)
+ *pending = true;
+ }
+ return *this;
}
-void ProCondition::setText(const QString &text)
+ProString &ProString::append(const ProStringList &other, bool *pending, bool skipEmpty1st)
{
- m_text = text;
+ if (const int sz = other.size()) {
+ int startIdx = 0;
+ if (pending && !*pending && skipEmpty1st && other.at(0).isEmpty()) {
+ if (sz == 1)
+ return *this;
+ startIdx = 1;
+ }
+ if (!m_length && sz == startIdx + 1) {
+ *this = other.at(startIdx);
+ } else {
+ int totalLength = sz - startIdx;
+ for (int i = startIdx; i < sz; ++i)
+ totalLength += other.at(i).size();
+ bool putSpace = false;
+ if (pending && !*pending && m_length)
+ putSpace = true;
+ else
+ totalLength--;
+
+ QChar *ptr = prepareAppend(totalLength);
+ for (int i = startIdx; i < sz; ++i) {
+ if (putSpace)
+ *ptr++ = 32;
+ else
+ putSpace = true;
+ const ProString &str = other.at(i);
+ memcpy(ptr, str.m_string.constData() + str.m_offset, str.m_length * 2);
+ ptr += str.m_length;
+ }
+ if (other.last().m_file)
+ m_file = other.last().m_file;
+ }
+ if (pending)
+ *pending = true;
+ }
+ return *this;
}
-QString ProCondition::text() const
+QString operator+(const ProString &one, const ProString &two)
{
- return m_text;
+ if (two.m_length) {
+ if (!one.m_length) {
+ return two.toQString();
+ } else {
+ QString neu(one.m_length + two.m_length, Qt::Uninitialized);
+ ushort *ptr = (ushort *)neu.constData();
+ memcpy(ptr, one.m_string.constData() + one.m_offset, one.m_length * 2);
+ memcpy(ptr + one.m_length, two.m_string.constData() + two.m_offset, two.m_length * 2);
+ return neu;
+ }
+ }
+ return one.toQString();
}
-ProItem::ProItemKind ProCondition::kind() const
-{
- return ProItem::ConditionKind;
-}
-ProItem::ProItemReturn ProCondition::Accept(AbstractProItemVisitor *visitor)
+ProString ProString::mid(int off, int len) const
{
- visitor->visitProCondition(this);
- return ReturnTrue;
+ ProString ret(*this, NoHash);
+ if (off > m_length)
+ off = m_length;
+ ret.m_offset += off;
+ ret.m_length -= off;
+ if (ret.m_length > len)
+ ret.m_length = len;
+ return ret;
}
-// --------------- ProOperator ----------------
-ProOperator::ProOperator(OperatorKind operatorKind)
+ProString ProString::trimmed() const
{
- m_operatorKind = operatorKind;
+ ProString ret(*this, NoHash);
+ int cur = m_offset;
+ int end = cur + m_length;
+ const QChar *data = m_string.constData();
+ for (; cur < end; cur++)
+ if (!data[cur].isSpace()) {
+ // No underrun check - we know there is at least one non-whitespace
+ while (data[end - 1].isSpace())
+ end--;
+ break;
+ }
+ ret.m_offset = cur;
+ ret.m_length = end - cur;
+ return ret;
}
-void ProOperator::setOperatorKind(OperatorKind operatorKind)
+QString ProStringList::join(const QString &sep) const
{
- m_operatorKind = operatorKind;
-}
+ int totalLength = 0;
+ const int sz = size();
-ProOperator::OperatorKind ProOperator::operatorKind() const
-{
- return m_operatorKind;
-}
+ for (int i = 0; i < sz; ++i)
+ totalLength += at(i).size();
-ProItem::ProItemKind ProOperator::kind() const
-{
- return ProItem::OperatorKind;
-}
+ if (sz)
+ totalLength += sep.size() * (sz - 1);
-ProItem::ProItemReturn ProOperator::Accept(AbstractProItemVisitor *visitor)
-{
- visitor->visitProOperator(this);
- return ReturnTrue;
+ QString res(totalLength, Qt::Uninitialized);
+ QChar *ptr = (QChar *)res.constData();
+ for (int i = 0; i < sz; ++i) {
+ if (i) {
+ memcpy(ptr, sep.constData(), sep.size() * 2);
+ ptr += sep.size();
+ }
+ memcpy(ptr, at(i).constData(), at(i).size() * 2);
+ ptr += at(i).size();
+ }
+ return res;
+}
+
+void ProStringList::removeDuplicates()
+{
+ int n = size();
+ int j = 0;
+ QSet<ProString> seen;
+ seen.reserve(n);
+ for (int i = 0; i < n; ++i) {
+ const ProString &s = at(i);
+ if (seen.contains(s))
+ continue;
+ seen.insert(s);
+ if (j != i)
+ (*this)[j] = s;
+ ++j;
+ }
+ if (n != j)
+ erase(begin() + j, end());
}
-// --------------- ProFile ----------------
ProFile::ProFile(const QString &fileName)
- : ProBlock(0)
+ : m_refCount(1),
+ m_fileName(fileName),
+ m_ok(true)
{
- m_modified = false;
- setBlockKind(ProBlock::ProFileKind);
- m_fileName = fileName;
-
- QFileInfo fi(fileName);
- m_displayFileName = fi.fileName();
- m_directoryName = fi.absolutePath();
+ if (!fileName.startsWith(QLatin1Char('(')))
+ m_directoryName = QFileInfo( // qmake sickness: canonicalize only the directory!
+ fileName.left(fileName.lastIndexOf(QLatin1Char('/')))).canonicalFilePath();
}
ProFile::~ProFile()
{
}
-QString ProFile::displayFileName() const
-{
- return m_displayFileName;
-}
-
-QString ProFile::fileName() const
-{
- return m_fileName;
-}
-
-QString ProFile::directoryName() const
-{
- return m_directoryName;
-}
-
-void ProFile::setModified(bool modified)
-{
- m_modified = modified;
-}
-
-bool ProFile::isModified() const
-{
- return m_modified;
-}
-
-ProItem::ProItemReturn ProFile::Accept(AbstractProItemVisitor *visitor)
-{
- ProItemReturn rt;
- if ((rt = visitor->visitBeginProFile(this)) != ReturnTrue)
- return rt;
- ProBlock::Accept(visitor); // cannot fail
- return visitor->visitEndProFile(this);
-}
-
QT_END_NAMESPACE
diff --git a/tools/linguist/shared/proitems.h b/tools/linguist/shared/proitems.h
index f4bf183946..a687410e45 100644
--- a/tools/linguist/shared/proitems.h
+++ b/tools/linguist/shared/proitems.h
@@ -42,205 +42,188 @@
#ifndef PROITEMS_H
#define PROITEMS_H
+#include "proparser_global.h"
#include <QtCore/QString>
-#include <QtCore/QList>
+#include <QtCore/QVector>
QT_BEGIN_NAMESPACE
-struct AbstractProItemVisitor;
-
-class ProItem
-{
+#ifdef PROPARSER_THREAD_SAFE
+typedef QAtomicInt ProItemRefCount;
+#else
+class ProItemRefCount {
public:
- enum ProItemKind {
- ValueKind,
- FunctionKind,
- ConditionKind,
- OperatorKind,
- BlockKind
- };
-
- enum ProItemReturn {
- ReturnFalse,
- ReturnTrue,
- ReturnBreak,
- ReturnNext,
- ReturnLoop,
- ReturnSkip,
- ReturnReturn
- };
-
- ProItem() : m_lineNumber(0) {}
- virtual ~ProItem() {}
-
- virtual ProItemKind kind() const = 0;
-
- void setComment(const QString &comment);
- QString comment() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor) = 0;
- int lineNumber() const { return m_lineNumber; }
- void setLineNumber(int lineNumber) { m_lineNumber = lineNumber; }
-
+ ProItemRefCount(int cnt = 0) : m_cnt(cnt) {}
+ bool ref() { return ++m_cnt != 0; }
+ bool deref() { return --m_cnt != 0; }
+ ProItemRefCount &operator=(int value) { m_cnt = value; return *this; }
private:
- QString m_comment;
- int m_lineNumber;
+ int m_cnt;
};
+#endif
-class ProBlock : public ProItem
-{
-public:
- enum ProBlockKind {
- NormalKind = 0x00,
- ScopeKind = 0x01,
- ScopeContentsKind = 0x02,
- VariableKind = 0x04,
- ProFileKind = 0x08,
- FunctionBodyKind = 0x10,
- SingleLine = 0x80
- };
-
- ProBlock(ProBlock *parent);
- ~ProBlock();
+namespace ProStringConstants {
+enum OmitPreHashing { NoHash };
+}
- void appendItem(ProItem *proitem);
- void setItems(const QList<ProItem *> &proitems);
- QList<ProItem *> items() const;
+class ProStringList;
+class ProFile;
- void setBlockKind(int blockKind);
- int blockKind() const;
-
- void setParent(ProBlock *parent);
- ProBlock *parent() const;
-
- void ref() { ++m_refCount; }
- void deref() { if (!--m_refCount) delete this; }
-
- ProItem::ProItemKind kind() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
-protected:
- QList<ProItem *> m_proitems;
-private:
- ProBlock *m_parent;
- int m_blockKind;
- int m_refCount;
-};
-
-class ProVariable : public ProBlock
-{
+class ProString {
public:
- enum VariableOperator {
- AddOperator = 0,
- RemoveOperator = 1,
- ReplaceOperator = 2,
- SetOperator = 3,
- UniqueAddOperator = 4
- };
-
- ProVariable(const QString &name, ProBlock *parent);
+ ProString();
+ ProString(const ProString &other);
+ ProString(const ProString &other, ProStringConstants::OmitPreHashing);
+ explicit ProString(const QString &str);
+ ProString(const QString &str, ProStringConstants::OmitPreHashing);
+ explicit ProString(const char *str);
+ ProString(const char *str, ProStringConstants::OmitPreHashing);
+ ProString(const QString &str, int offset, int length);
+ ProString(const QString &str, int offset, int length, uint hash);
+ ProString(const QString &str, int offset, int length, ProStringConstants::OmitPreHashing);
+ void setValue(const QString &str);
+ void setValue(const QString &str, ProStringConstants::OmitPreHashing);
+ ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; }
+ ProString &setSource(const ProFile *pro) { m_file = pro; return *this; }
+ const ProFile *sourceFile() const { return m_file; }
+ QString toQString() const;
+ QString &toQString(QString &tmp) const;
+ ProString &operator+=(const ProString &other);
+ ProString &append(const ProString &other, bool *pending = 0);
+ ProString &append(const ProStringList &other, bool *pending = 0, bool skipEmpty1st = false);
+ bool operator==(const ProString &other) const;
+ bool operator==(const QString &other) const;
+ bool operator==(const QLatin1String &other) const;
+ bool operator!=(const ProString &other) const { return !(*this == other); }
+ bool operator!=(const QString &other) const { return !(*this == other); }
+ bool operator!=(const QLatin1String &other) const { return !(*this == other); }
+ bool isEmpty() const { return !m_length; }
+ int size() const { return m_length; }
+ const QChar *constData() const { return m_string.constData() + m_offset; }
+ ProString mid(int off, int len = -1) const;
+ ProString left(int len) const { return mid(0, len); }
+ ProString right(int len) const { return mid(qMax(0, size() - len)); }
+ ProString trimmed() const;
+ void clear() { m_string.clear(); m_length = 0; }
+
+ static uint hash(const QChar *p, int n);
- void setVariableOperator(VariableOperator variableKind);
- VariableOperator variableOperator() const;
-
- void setVariable(const QString &name);
- QString variable() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
private:
- VariableOperator m_variableKind;
- QString m_variable;
+ QString m_string;
+ int m_offset, m_length;
+ const ProFile *m_file;
+ mutable uint m_hash;
+ QChar *prepareAppend(int extraLen);
+ uint updatedHash() const;
+ friend uint qHash(const ProString &str);
+ friend QString operator+(const ProString &one, const ProString &two);
};
+Q_DECLARE_TYPEINFO(ProString, Q_MOVABLE_TYPE);
-class ProValue : public ProItem
-{
-public:
- ProValue(const QString &value, ProVariable *variable);
-
- void setValue(const QString &value);
- QString value() const;
-
- void setVariable(ProVariable *variable);
- ProVariable *variable() const;
+uint qHash(const ProString &str);
+QString operator+(const ProString &one, const ProString &two);
+inline QString operator+(const ProString &one, const QString &two)
+ { return one + ProString(two, ProStringConstants::NoHash); }
+inline QString operator+(const QString &one, const ProString &two)
+ { return ProString(one, ProStringConstants::NoHash) + two; }
- ProItem::ProItemKind kind() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
-private:
- QString m_value;
- ProVariable *m_variable;
-};
-
-class ProFunction : public ProItem
-{
-public:
- explicit ProFunction(const QString &text);
-
- void setText(const QString &text);
- QString text() const;
-
- ProItem::ProItemKind kind() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
-private:
- QString m_text;
-};
-
-class ProCondition : public ProItem
-{
+class ProStringList : public QVector<ProString> {
public:
- explicit ProCondition(const QString &text);
-
- void setText(const QString &text);
- QString text() const;
-
- ProItem::ProItemKind kind() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
-private:
- QString m_text;
+ ProStringList() {}
+ ProStringList(const ProString &str) { *this << str; }
+ QString join(const QString &sep) const;
+ void removeDuplicates();
};
-class ProOperator : public ProItem
-{
-public:
- enum OperatorKind {
- OrOperator = 1,
- NotOperator = 2
- };
-
- explicit ProOperator(OperatorKind operatorKind);
-
- void setOperatorKind(OperatorKind operatorKind);
- OperatorKind operatorKind() const;
-
- ProItem::ProItemKind kind() const;
-
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
-private:
- OperatorKind m_operatorKind;
+// These token definitions affect both ProFileEvaluator and ProWriter
+enum ProToken {
+ TokTerminator = 0, // end of stream (possibly not included in length; must be zero)
+ TokLine, // line marker:
+ // - line (1)
+ TokAssign, // variable =
+ TokAppend, // variable +=
+ TokAppendUnique, // variable *=
+ TokRemove, // variable -=
+ TokReplace, // variable ~=
+ // previous literal/expansion is a variable manipulation
+ // - value expression + TokValueTerminator
+ TokValueTerminator, // assignment value terminator
+ TokLiteral, // literal string (fully dequoted)
+ // - length (1)
+ // - string data (length; unterminated)
+ TokHashLiteral, // literal string with hash (fully dequoted)
+ // - hash (2)
+ // - length (1)
+ // - string data (length; unterminated)
+ TokVariable, // qmake variable expansion
+ // - hash (2)
+ // - name length (1)
+ // - name (name length; unterminated)
+ TokProperty, // qmake property expansion
+ // - name length (1)
+ // - name (name length; unterminated)
+ TokEnvVar, // environment variable expansion
+ // - name length (1)
+ // - name (name length; unterminated)
+ TokFuncName, // replace function expansion
+ // - hash (2)
+ // - name length (1)
+ // - name (name length; unterminated)
+ // - ((nested expansion + TokArgSeparator)* + nested expansion)?
+ // - TokFuncTerminator
+ TokArgSeparator, // function argument separator
+ TokFuncTerminator, // function argument list terminator
+ TokCondition, // previous literal/expansion is a conditional
+ TokTestCall, // previous literal/expansion is a test function call
+ // - ((nested expansion + TokArgSeparator)* + nested expansion)?
+ // - TokFuncTerminator
+ TokNot, // '!' operator
+ TokAnd, // ':' operator
+ TokOr, // '|' operator
+ TokBranch, // branch point:
+ // - then block length (2)
+ // - then block + TokTerminator (then block length)
+ // - else block length (2)
+ // - else block + TokTerminator (else block length)
+ TokForLoop, // for loop:
+ // - variable name: hash (2), length (1), chars (length)
+ // - expression: length (2), bytes + TokValueTerminator (length)
+ // - body length (2)
+ // - body + TokTerminator (body length)
+ TokTestDef, // test function definition:
+ TokReplaceDef, // replace function definition:
+ // - function name: hash (2), length (1), chars (length)
+ // - body length (2)
+ // - body + TokTerminator (body length)
+ TokMask = 0xff,
+ TokQuoted = 0x100, // The expression is quoted => join expanded stringlist
+ TokNewStr = 0x200 // Next stringlist element
};
-class ProFile : public ProBlock
+class PROPARSER_EXPORT ProFile
{
public:
explicit ProFile(const QString &fileName);
~ProFile();
- QString displayFileName() const;
- QString fileName() const;
- QString directoryName() const;
+ QString fileName() const { return m_fileName; }
+ QString directoryName() const { return m_directoryName; }
+ const QString &items() const { return m_proitems; }
+ QString *itemsRef() { return &m_proitems; }
+ const ushort *tokPtr() const { return (const ushort *)m_proitems.constData(); }
- void setModified(bool modified);
- bool isModified() const;
+ void ref() { m_refCount.ref(); }
+ void deref() { if (!m_refCount.deref()) delete this; }
- virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
+ bool isOk() const { return m_ok; }
+ void setOk(bool ok) { m_ok = ok; }
private:
+ ProItemRefCount m_refCount;
+ QString m_proitems;
QString m_fileName;
- QString m_displayFileName;
QString m_directoryName;
- bool m_modified;
+ bool m_ok;
};
QT_END_NAMESPACE
diff --git a/tools/linguist/shared/proparser.pri b/tools/linguist/shared/proparser.pri
index 372247e46c..829c8cde7f 100644
--- a/tools/linguist/shared/proparser.pri
+++ b/tools/linguist/shared/proparser.pri
@@ -1,12 +1,17 @@
INCLUDEPATH *= $$PWD
+DEFINES += PROEVALUATOR_CUMULATIVE PROEVALUATOR_INIT_PROPS
+
HEADERS += \
- $$PWD/abstractproitemvisitor.h \
+ $$PWD/proparser_global.h \
+ $$PWD/ioutils.h \
$$PWD/proitems.h \
- $$PWD/profileevaluator.h \
- $$PWD/proparserutils.h
+ $$PWD/profileparser.h \
+ $$PWD/profileevaluator.h
SOURCES += \
+ $$PWD/ioutils.cpp \
$$PWD/proitems.cpp \
- $$PWD/profileevaluator.cpp
+ $$PWD/profileparser.cpp \
+ $$PWD/profileevaluator.cpp
diff --git a/tools/linguist/shared/proparser_global.h b/tools/linguist/shared/proparser_global.h
new file mode 100644
index 0000000000..2b0b6dbebc
--- /dev/null
+++ b/tools/linguist/shared/proparser_global.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PROPARSER_GLOBAL_H
+#define PROPARSER_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(PROPARSER_AS_LIBRARY)
+# if defined(PROPARSER_LIBRARY)
+# define PROPARSER_EXPORT Q_DECL_EXPORT
+# else
+# define PROPARSER_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define PROPARSER_EXPORT
+#endif
+
+#endif
diff --git a/tools/linguist/shared/proparserutils.h b/tools/linguist/shared/proparserutils.h
deleted file mode 100644
index d567a731df..0000000000
--- a/tools/linguist/shared/proparserutils.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Linguist of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PROPARSERUTILS_H
-#define PROPARSERUTILS_H
-
-#include <QtCore/QDir>
-#ifndef QT_BOOTSTRAPPED
-#include <QtCore/QLibraryInfo>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-#ifdef QT_BOOTSTRAPPED
-// this is a stripped down version of the one found in QtCore
-class QLibraryInfo
-{
-public:
- enum LibraryLocation
- {
- PrefixPath,
- DocumentationPath,
- HeadersPath,
- LibrariesPath,
- BinariesPath,
- PluginsPath,
- DataPath,
- TranslationsPath,
- SettingsPath,
- DemosPath,
- ExamplesPath
- };
- static QString location(LibraryLocation);
-};
-#endif
-
-// Pre- and postcondition macros
-#define PRE(cond) do {if (!(cond))qt_assert(#cond,__FILE__,__LINE__);} while (0)
-#define POST(cond) do {if (!(cond))qt_assert(#cond,__FILE__,__LINE__);} while (0)
-
-// This struct is from qmake, but we are not using everything.
-struct Option
-{
- //simply global convenience
- //static QString libtool_ext;
- //static QString pkgcfg_ext;
- //static QString prf_ext;
- //static QString prl_ext;
- //static QString ui_ext;
- //static QStringList h_ext;
- //static QStringList cpp_ext;
- //static QString h_moc_ext;
- //static QString cpp_moc_ext;
- //static QString obj_ext;
- //static QString lex_ext;
- //static QString yacc_ext;
- //static QString h_moc_mod;
- //static QString cpp_moc_mod;
- //static QString lex_mod;
- //static QString yacc_mod;
- static QString dir_sep;
- static QString dirlist_sep;
- static QString qmakespec;
- static QChar field_sep;
-
- enum TARG_MODE { TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, TARG_MAC9_MODE, TARG_QNX6_MODE };
- static TARG_MODE target_mode;
- //static QString pro_ext;
- //static QString res_ext;
-
- static void init()
- {
-#ifdef Q_OS_WIN
- Option::dirlist_sep = QLatin1Char(';');
- Option::dir_sep = QLatin1Char('\\');
-#else
- Option::dirlist_sep = QLatin1Char(':');
- Option::dir_sep = QLatin1Char(QLatin1Char('/'));
-#endif
- Option::qmakespec = QString::fromLatin1(qgetenv("QMAKESPEC").data());
- Option::field_sep = QLatin1Char(' ');
- }
-
- enum StringFixFlags {
- FixNone = 0x00,
- FixEnvVars = 0x01,
- FixPathCanonicalize = 0x02,
- FixPathToLocalSeparators = 0x04,
- FixPathToTargetSeparators = 0x08
- };
- static QString fixString(QString string, uchar flags);
-
- inline static QString fixPathToLocalOS(const QString &in, bool fix_env = true, bool canonical = true)
- {
- uchar flags = FixPathToLocalSeparators;
- if (fix_env)
- flags |= FixEnvVars;
- if (canonical)
- flags |= FixPathCanonicalize;
- return fixString(in, flags);
- }
-};
-#if defined(Q_OS_WIN32)
-Option::TARG_MODE Option::target_mode = Option::TARG_WIN_MODE;
-#elif defined(Q_OS_MAC)
-Option::TARG_MODE Option::target_mode = Option::TARG_MACX_MODE;
-#elif defined(Q_OS_QNX6)
-Option::TARG_MODE Option::target_mode = Option::TARG_QNX6_MODE;
-#else
-Option::TARG_MODE Option::target_mode = Option::TARG_UNIX_MODE;
-#endif
-
-QString Option::qmakespec;
-QString Option::dirlist_sep;
-QString Option::dir_sep;
-QChar Option::field_sep;
-
-static void insertUnique(QHash<QString, QStringList> *map,
- const QString &key, const QStringList &value)
-{
- QStringList &sl = (*map)[key];
- foreach (const QString &str, value)
- if (!sl.contains(str))
- sl.append(str);
-}
-
-static void removeEach(QHash<QString, QStringList> *map,
- const QString &key, const QStringList &value)
-{
- QStringList &sl = (*map)[key];
- foreach (const QString &str, value)
- sl.removeAll(str);
-}
-
-/*
- See ProFileEvaluator::Private::visitProValue(...)
-
-static QStringList replaceInList(const QStringList &varList, const QRegExp &regexp,
- const QString &replace, bool global)
-{
- QStringList resultList = varList;
-
- for (QStringList::Iterator varit = resultList.begin(); varit != resultList.end();) {
- if (varit->contains(regexp)) {
- *varit = varit->replace(regexp, replace);
- if (varit->isEmpty())
- varit = resultList.erase(varit);
- else
- ++varit;
- if (!global)
- break;
- } else {
- ++varit;
- }
- }
- return resultList;
-}
-*/
-
-inline QString fixEnvVariables(const QString &x)
-{
- return Option::fixString(x, Option::FixEnvVars);
-}
-
-inline QStringList splitPathList(const QString &paths)
-{
- return paths.split(Option::dirlist_sep);
-}
-
-static QStringList split_arg_list(QString params)
-{
- int quote = 0;
- QStringList args;
-
- const ushort LPAREN = '(';
- const ushort RPAREN = ')';
- const ushort SINGLEQUOTE = '\'';
- const ushort DOUBLEQUOTE = '"';
- const ushort COMMA = ',';
- const ushort SPACE = ' ';
- //const ushort TAB = '\t';
-
- ushort unicode;
- const QChar *params_data = params.data();
- const int params_len = params.length();
- int last = 0;
- while (last < params_len && ((params_data+last)->unicode() == SPACE
- /*|| (params_data+last)->unicode() == TAB*/))
- ++last;
- for (int x = last, parens = 0; x <= params_len; x++) {
- unicode = (params_data+x)->unicode();
- if (x == params_len) {
- while (x && (params_data+(x-1))->unicode() == SPACE)
- --x;
- QString mid(params_data+last, x-last);
- if (quote) {
- if (mid[0] == quote && mid[(int)mid.length()-1] == quote)
- mid = mid.mid(1, mid.length()-2);
- quote = 0;
- }
- args << mid;
- break;
- }
- if (unicode == LPAREN) {
- --parens;
- } else if (unicode == RPAREN) {
- ++parens;
- } else if (quote && unicode == quote) {
- quote = 0;
- } else if (!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) {
- quote = unicode;
- }
- if (!parens && !quote && unicode == COMMA) {
- QString mid = params.mid(last, x - last).trimmed();
- args << mid;
- last = x+1;
- while (last < params_len && ((params_data+last)->unicode() == SPACE
- /*|| (params_data+last)->unicode() == TAB*/))
- ++last;
- }
- }
- return args;
-}
-
-static QStringList split_value_list(const QString &vals, bool do_semicolon=false)
-{
- QString build;
- QStringList ret;
- QStack<char> quote;
-
- const ushort LPAREN = '(';
- const ushort RPAREN = ')';
- const ushort SINGLEQUOTE = '\'';
- const ushort DOUBLEQUOTE = '"';
- const ushort BACKSLASH = '\\';
- const ushort SEMICOLON = ';';
-
- ushort unicode;
- const QChar *vals_data = vals.data();
- const int vals_len = vals.length();
- for (int x = 0, parens = 0; x < vals_len; x++) {
- unicode = vals_data[x].unicode();
- if (x != (int)vals_len-1 && unicode == BACKSLASH &&
- (vals_data[x+1].unicode() == SINGLEQUOTE || vals_data[x+1].unicode() == DOUBLEQUOTE)) {
- build += vals_data[x++]; //get that 'escape'
- } else if (!quote.isEmpty() && unicode == quote.top()) {
- quote.pop();
- } else if (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE) {
- quote.push(unicode);
- } else if (unicode == RPAREN) {
- --parens;
- } else if (unicode == LPAREN) {
- ++parens;
- }
-
- if (!parens && quote.isEmpty() && ((do_semicolon && unicode == SEMICOLON) ||
- vals_data[x] == Option::field_sep)) {
- ret << build;
- build.clear();
- } else {
- build += vals_data[x];
- }
- }
- if (!build.isEmpty())
- ret << build;
- return ret;
-}
-
-static QStringList qmake_mkspec_paths()
-{
- QStringList ret;
- const QString concat = QDir::separator() + QLatin1String("mkspecs");
- QByteArray qmakepath = qgetenv("QMAKEPATH");
- if (!qmakepath.isEmpty()) {
- const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath));
- for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
- ret << ((*it) + concat);
- }
- ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat;
-
- return ret;
-}
-
-QT_END_NAMESPACE
-
-#endif // PROPARSERUTILS_H
diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp
index b8cfeca70d..85af251dce 100644
--- a/tools/linguist/shared/qm.cpp
+++ b/tools/linguist/shared/qm.cpp
@@ -503,12 +503,7 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd)
// for squeezed but non-file data, this is what needs to be deleted
const uchar *messageArray = 0;
const uchar *offsetArray = 0;
- const uchar *contextArray = 0;
- const uchar *numerusRulesArray = 0;
- uint messageLength = 0;
uint offsetLength = 0;
- uint contextLength = 0;
- uint numerusRulesLength = 0;
bool ok = true;
const uchar *end = data + len;
@@ -527,22 +522,13 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd)
break;
}
- if (tag == Contexts) {
- contextArray = data;
- contextLength = blockLen;
- //qDebug() << "CONTEXTS: " << contextLength << QByteArray((const char *)contextArray, contextLength).toHex();
- } else if (tag == Hashes) {
+ if (tag == Hashes) {
offsetArray = data;
offsetLength = blockLen;
- //qDebug() << "HASHES: " << offsetLength << QByteArray((const char *)offsetArray, offsetLength).toHex();
+ //qDebug() << "HASHES: " << blockLen << QByteArray((const char *)data, blockLen).toHex();
} else if (tag == Messages) {
messageArray = data;
- messageLength = blockLen;
- //qDebug() << "MESSAGES: " << messageLength << QByteArray((const char *)messageArray, messageLength).toHex();
- } else if (tag == NumerusRules) {
- numerusRulesArray = data;
- numerusRulesLength = blockLen;
- //qDebug() << "NUMERUSRULES: " << numerusRulesLength << QByteArray((const char *)numerusRulesArray, numerusRulesLength).toHex();
+ //qDebug() << "MESSAGES: " << blockLen << QByteArray((const char *)data, blockLen).toHex();
}
data += blockLen;
@@ -697,7 +683,7 @@ static bool containsStripped(const Translator &translator, const TranslatorMessa
return false;
}
-static bool saveQM(const Translator &translator, QIODevice &dev, ConversionData &cd)
+bool saveQM(const Translator &translator, QIODevice &dev, ConversionData &cd)
{
Releaser releaser;
QLocale::Language l;
diff --git a/tools/linguist/shared/simtexth.cpp b/tools/linguist/shared/simtexth.cpp
index 31253d657e..89335071fc 100644
--- a/tools/linguist/shared/simtexth.cpp
+++ b/tools/linguist/shared/simtexth.cpp
@@ -238,9 +238,7 @@ CandidateList similarTextHeuristicCandidates(const Translator *tor,
QList<int> scores;
CandidateList candidates;
- TML all = tor->translatedMessages();
-
- foreach (const TranslatorMessage &mtm, all) {
+ foreach (const TranslatorMessage &mtm, tor->messages()) {
if (mtm.type() == TranslatorMessage::Unfinished
|| mtm.translation().isEmpty())
continue;
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index a29372a090..bd13bf7260 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -79,7 +79,8 @@ QString QObject::tr(const char *sourceText, const char *, int n)
Translator::Translator() :
m_codec(QTextCodec::codecForName("ISO-8859-1")),
- m_locationsType(AbsoluteLocations)
+ m_locationsType(AbsoluteLocations),
+ m_indexOk(true)
{
}
@@ -101,20 +102,58 @@ QList<Translator::FileFormat> &Translator::registeredFileFormats()
return theFormats;
}
+void Translator::addIndex(int idx, const TranslatorMessage &msg) const
+{
+ if (msg.sourceText().isEmpty() && msg.id().isEmpty()) {
+ m_ctxCmtIdx[msg.context()] = idx;
+ } else {
+ m_msgIdx[TMMKey(msg)] = idx;
+ if (!msg.id().isEmpty())
+ m_idMsgIdx[msg.id()] = idx;
+ }
+}
+
+void Translator::delIndex(int idx) const
+{
+ const TranslatorMessage &msg = m_messages.at(idx);
+ if (msg.sourceText().isEmpty() && msg.id().isEmpty()) {
+ m_ctxCmtIdx.remove(msg.context());
+ } else {
+ m_msgIdx.remove(TMMKey(msg));
+ if (!msg.id().isEmpty())
+ m_idMsgIdx.remove(msg.id());
+ }
+}
+
+void Translator::ensureIndexed() const
+{
+ if (!m_indexOk) {
+ m_indexOk = true;
+ m_ctxCmtIdx.clear();
+ m_idMsgIdx.clear();
+ m_msgIdx.clear();
+ for (int i = 0; i < m_messages.count(); i++)
+ addIndex(i, m_messages.at(i));
+ }
+}
+
void Translator::replaceSorted(const TranslatorMessage &msg)
{
int index = find(msg);
- if (index == -1)
+ if (index == -1) {
appendSorted(msg);
- else
+ } else {
+ delIndex(index);
m_messages[index] = msg;
+ addIndex(index, msg);
+ }
}
void Translator::extend(const TranslatorMessage &msg)
{
int index = find(msg);
if (index == -1) {
- m_messages.append(msg);
+ append(msg);
} else {
TranslatorMessage &emsg = m_messages[index];
emsg.addReferenceUniq(msg.fileName(), msg.lineNumber());
@@ -132,16 +171,22 @@ void Translator::extend(const TranslatorMessage &msg)
}
}
+void Translator::insert(int idx, const TranslatorMessage &msg)
+{
+ addIndex(idx, msg);
+ m_messages.insert(idx, msg);
+}
+
void Translator::append(const TranslatorMessage &msg)
{
- m_messages.append(msg);
+ insert(m_messages.count(), msg);
}
void Translator::appendSorted(const TranslatorMessage &msg)
{
int msgLine = msg.lineNumber();
if (msgLine < 0) {
- m_messages.append(msg);
+ append(msg);
return;
}
@@ -189,11 +234,11 @@ void Translator::appendSorted(const TranslatorMessage &msg)
thisScore = 1;
}
if (thisScore > bestScore || (thisScore == bestScore && thisSize > bestSize))
- m_messages.insert(thisIdx, msg);
+ insert(thisIdx, msg);
else if (bestScore)
- m_messages.insert(bestIdx, msg);
+ insert(bestIdx, msg);
else
- m_messages.append(msg);
+ append(msg);
}
static QString guessFormat(const QString &filename, const QString &format)
@@ -329,34 +374,20 @@ void Translator::languageAndCountry(const QString &languageCode,
}
}
-bool Translator::release(QFile *iod, ConversionData &cd) const
-{
- foreach (const FileFormat &format, registeredFileFormats()) {
- if (format.extension == QLatin1String("qm"))
- return (*format.saver)(*this, *iod, cd);
- }
- cd.appendError(QLatin1String("No .qm saver available."));
- return false;
-}
-
int Translator::find(const TranslatorMessage &msg) const
{
- for (int i = 0; i < m_messages.count(); ++i) {
- const TranslatorMessage &tmsg = m_messages.at(i);
- if (msg.id().isEmpty() || tmsg.id().isEmpty()) {
- if (msg.context() == tmsg.context()
- && msg.sourceText() == tmsg.sourceText()
- && msg.comment() == tmsg.comment())
- return i;
- } else {
- if (msg.id() == tmsg.id())
- return i;
- }
- }
- return -1;
+ ensureIndexed();
+ if (msg.id().isEmpty())
+ return m_msgIdx.value(TMMKey(msg), -1);
+ int i = m_idMsgIdx.value(msg.id(), -1);
+ if (i >= 0)
+ return i;
+ i = m_msgIdx.value(TMMKey(msg), -1);
+ // If both have an id, then find only by id.
+ return i >= 0 && m_messages.at(i).id().isEmpty() ? i : -1;
}
-TranslatorMessage Translator::find(const QString &context,
+int Translator::find(const QString &context,
const QString &comment, const TranslatorMessage::References &refs) const
{
if (!refs.isEmpty()) {
@@ -365,75 +396,68 @@ TranslatorMessage Translator::find(const QString &context,
foreach (const TranslatorMessage::Reference &itref, it->allReferences())
foreach (const TranslatorMessage::Reference &ref, refs)
if (itref == ref)
- return *it;
+ return it - m_messages.constBegin();
}
}
- return TranslatorMessage();
-}
-
-bool Translator::contains(const QString &context) const
-{
- foreach (const TranslatorMessage &msg, m_messages)
- if (msg.context() == context && msg.sourceText().isEmpty() && msg.id().isEmpty())
- return true;
- return false;
+ return -1;
}
-TranslatorMessage Translator::find(const QString &context) const
+int Translator::find(const QString &context) const
{
- foreach (const TranslatorMessage &msg, m_messages)
- if (msg.context() == context && msg.sourceText().isEmpty() && msg.id().isEmpty())
- return msg;
- return TranslatorMessage();
+ ensureIndexed();
+ return m_ctxCmtIdx.value(context, -1);
}
void Translator::stripObsoleteMessages()
{
- TMM newmm;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it)
- if (it->type() != TranslatorMessage::Obsolete)
- newmm.append(*it);
- m_messages = newmm;
+ for (TMM::Iterator it = m_messages.begin(); it != m_messages.end(); )
+ if (it->type() == TranslatorMessage::Obsolete)
+ it = m_messages.erase(it);
+ else
+ ++it;
+ m_indexOk = false;
}
void Translator::stripFinishedMessages()
{
- TMM newmm;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it)
- if (it->type() != TranslatorMessage::Finished)
- newmm.append(*it);
- m_messages = newmm;
+ for (TMM::Iterator it = m_messages.begin(); it != m_messages.end(); )
+ if (it->type() == TranslatorMessage::Finished)
+ it = m_messages.erase(it);
+ else
+ ++it;
+ m_indexOk = false;
}
void Translator::stripEmptyContexts()
{
- TMM newmm;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it)
- if (it->sourceText() != QLatin1String(ContextComment))
- newmm.append(*it);
- m_messages = newmm;
+ for (TMM::Iterator it = m_messages.begin(); it != m_messages.end();)
+ if (it->sourceText() == QLatin1String(ContextComment))
+ it = m_messages.erase(it);
+ else
+ ++it;
+ m_indexOk = false;
}
void Translator::stripNonPluralForms()
{
- TMM newmm;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it)
- if (it->isPlural())
- newmm.append(*it);
- m_messages = newmm;
+ for (TMM::Iterator it = m_messages.begin(); it != m_messages.end(); )
+ if (!it->isPlural())
+ it = m_messages.erase(it);
+ else
+ ++it;
+ m_indexOk = false;
}
void Translator::stripIdenticalSourceTranslations()
{
- TMM newmm;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it) {
+ for (TMM::Iterator it = m_messages.begin(); it != m_messages.end(); ) {
// we need to have just one translation, and it be equal to the source
- if (it->translations().count() != 1)
- newmm.append(*it);
- else if (it->translation() != it->sourceText())
- newmm.append(*it);
+ if (it->translations().count() == 1 && it->translation() == it->sourceText())
+ it = m_messages.erase(it);
+ else
+ ++it;
}
- m_messages = newmm;
+ m_indexOk = false;
}
void Translator::dropTranslations()
@@ -579,6 +603,7 @@ Translator::Duplicates Translator::resolveDuplicates()
}
if (!omsg->isTranslated() && msg.isTranslated())
omsg->setTranslations(msg.translations());
+ m_indexOk = false;
m_messages.removeAt(i);
}
return dups;
@@ -610,20 +635,18 @@ void Translator::reportDuplicates(const Duplicates &dupes,
// Used by lupdate to be able to search using absolute paths during merging
void Translator::makeFileNamesAbsolute(const QDir &originalPath)
{
- TMM newmm;
for (TMM::iterator it = m_messages.begin(); it != m_messages.end(); ++it) {
- TranslatorMessage msg = *it;
+ TranslatorMessage &msg = *it;
+ TranslatorMessage::References refs = msg.allReferences();
msg.setReferences(TranslatorMessage::References());
- foreach (const TranslatorMessage::Reference &ref, it->allReferences()) {
+ foreach (const TranslatorMessage::Reference &ref, refs) {
QString fileName = ref.fileName();
QFileInfo fi (fileName);
if (fi.isRelative())
fileName = originalPath.absoluteFilePath(fileName);
msg.addReference(fileName, ref.lineNumber());
}
- newmm.append(msg);
}
- m_messages = newmm;
}
QList<TranslatorMessage> Translator::messages() const
@@ -631,15 +654,6 @@ QList<TranslatorMessage> Translator::messages() const
return m_messages;
}
-QList<TranslatorMessage> Translator::translatedMessages() const
-{
- TMM result;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it)
- if (it->type() == TranslatorMessage::Finished)
- result.append(*it);
- return result;
-}
-
QStringList Translator::normalizedTranslations(const TranslatorMessage &msg, int numPlurals)
{
QStringList translations = msg.translations();
@@ -680,9 +694,7 @@ void Translator::normalizeTranslations(ConversionData &cd)
tlns.removeLast();
truncated = true;
}
- TranslatorMessage msg2(msg);
- msg2.setTranslations(tlns);
- m_messages[i] = msg2;
+ m_messages[i].setTranslations(tlns);
}
}
if (truncated)
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index fb9bd2d1dd..3b7bd640b9 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -118,6 +118,17 @@ public:
TranslatorSaveMode m_saveMode;
};
+class TMMKey {
+public:
+ TMMKey(const TranslatorMessage &msg)
+ { context = msg.context(); source = msg.sourceText(); comment = msg.comment(); }
+ bool operator==(const TMMKey &o) const
+ { return context == o.context && source == o.source && comment == o.comment; }
+ QString context, source, comment;
+};
+Q_DECLARE_TYPEINFO(TMMKey, Q_MOVABLE_TYPE);
+inline uint qHash(const TMMKey &key) { return qHash(key.context) ^ qHash(key.source) ^ qHash(key.comment); }
+
class Translator
{
public:
@@ -125,14 +136,12 @@ public:
bool load(const QString &filename, ConversionData &err, const QString &format /* = "auto" */);
bool save(const QString &filename, ConversionData &err, const QString &format /* = "auto" */) const;
- bool release(QFile *iod, ConversionData &cd) const;
int find(const TranslatorMessage &msg) const;
- TranslatorMessage find(const QString &context,
+ int find(const QString &context,
const QString &comment, const TranslatorMessage::References &refs) const;
- bool contains(const QString &context) const;
- TranslatorMessage find(const QString &context) const;
+ int find(const QString &context) const;
void replaceSorted(const TranslatorMessage &msg);
void extend(const TranslatorMessage &msg); // Only for single-location messages
@@ -171,7 +180,6 @@ public:
void setSourceLanguageCode(const QString &languageCode) { m_sourceLanguage = languageCode; }
static QString guessLanguageCodeFromFileName(const QString &fileName);
QList<TranslatorMessage> messages() const;
- QList<TranslatorMessage> translatedMessages() const;
static QStringList normalizedTranslations(const TranslatorMessage &m, int numPlurals);
void normalizeTranslations(ConversionData &cd);
QStringList normalizedTranslations(const TranslatorMessage &m, ConversionData &cd, bool *ok) const;
@@ -179,6 +187,7 @@ public:
int messageCount() const { return m_messages.size(); }
TranslatorMessage &message(int i) { return m_messages[i]; }
const TranslatorMessage &message(int i) const { return m_messages.at(i); }
+ const TranslatorMessage &constMessage(int i) const { return m_messages.at(i); }
void dump() const;
// additional file format specific data
@@ -212,6 +221,11 @@ public:
};
private:
+ void insert(int idx, const TranslatorMessage &msg);
+ void addIndex(int idx, const TranslatorMessage &msg) const;
+ void delIndex(int idx) const;
+ void ensureIndexed() const;
+
typedef QList<TranslatorMessage> TMM; // int stores the sequence position.
TMM m_messages;
@@ -230,11 +244,18 @@ private:
QString m_language;
QString m_sourceLanguage;
ExtraData m_extra;
+
+ mutable bool m_indexOk;
+ mutable QHash<QString, int> m_ctxCmtIdx;
+ mutable QHash<QString, int> m_idMsgIdx;
+ mutable QHash<TMMKey, int> m_msgIdx;
};
bool getNumerusInfo(QLocale::Language language, QLocale::Country country,
QByteArray *rules, QStringList *forms, const char **gettextRules);
+bool saveQM(const Translator &translator, QIODevice &dev, ConversionData &cd);
+
/*
This is a quick hack. The proper way to handle this would be
to extend Translator's interface.
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index b3dc31aa63..585d6ce455 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -955,7 +955,7 @@ QString CppCodeMarker::addMarkUp(const QString &in,
ident += ch;
finish = i;
readChar();
- } while (isalnum(ch) || ch == '_');
+ } while (ch >= 0 && isalnum(ch) || ch == '_');
if (classRegExp.exactMatch(ident)) {
tag = QLatin1String("type");
diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp
index 6a99a3b3a3..462964465d 100644
--- a/tools/qdoc3/helpprojectwriter.cpp
+++ b/tools/qdoc3/helpprojectwriter.cpp
@@ -48,6 +48,7 @@
#include "config.h"
#include "node.h"
#include "tree.h"
+#include <qdebug.h>
QT_BEGIN_NAMESPACE
diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp
index fe96f9a065..98e188d914 100644
--- a/tools/qdoc3/qmlvisitor.cpp
+++ b/tools/qdoc3/qmlvisitor.cpp
@@ -67,15 +67,15 @@ QmlDocVisitor::~QmlDocVisitor()
{
}
-QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(unsigned offset) const
+QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const
{
QDeclarativeJS::AST::SourceLocation currentLoc;
foreach (const QDeclarativeJS::AST::SourceLocation &loc, engine->comments()) {
- if (loc.begin() > lastEndOffset && loc.end() < offset)
- currentLoc = loc;
- else
+ if (loc.begin() >= offset)
break;
+ else if (loc.begin() > lastEndOffset && loc.end() < offset)
+ currentLoc = loc;
}
if (currentLoc.isValid()) {
QString comment = document.mid(currentLoc.offset, currentLoc.length);
@@ -195,7 +195,7 @@ bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member)
qmlPropGroup->setDefault();
QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup, name, type, false);
qmlPropNode->setWritable(!member->isReadonlyMember);
- applyDocumentation(member->firstSourceLocation(), qmlPropNode);
+ applyDocumentation(member->firstSourceLocation(), qmlPropGroup);
}
}
break;
@@ -204,7 +204,6 @@ bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member)
return false;
}
- //current->doc = precedingComment(member->firstSourceLocation().begin());
return true;
}
diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h
index 34ed8c1cc0..1d3a401eda 100644
--- a/tools/qdoc3/qmlvisitor.h
+++ b/tools/qdoc3/qmlvisitor.h
@@ -67,7 +67,7 @@ public:
bool visit(QDeclarativeJS::AST::IdentifierPropertyName *idproperty);
private:
- QDeclarativeJS::AST::SourceLocation precedingComment(unsigned offset) const;
+ QDeclarativeJS::AST::SourceLocation precedingComment(quint32 offset) const;
void applyDocumentation(QDeclarativeJS::AST::SourceLocation location, Node *node);
QDeclarativeJS::Engine *engine;
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index 4abe40c9c4..2ae2fd6d9d 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -6,7 +6,7 @@ include(qt-defines.qdocconf)
project = Qml
description = Qml Reference Documentation
-url = http://qt.nokia.com/doc/4.7/
+url = http://qt.nokia.com/doc/4.8/
qmlonly = true
edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \
@@ -29,9 +29,9 @@ qhp.Qml.indexTitle = Qml Reference
# See also extraimages.HTML
qhp.Qml.extraFiles = images/bg_l.png \
images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ul_blank.png \
- images/header_bg.png \
+ images/bg_ll_blank.png \
+ images/bg_ul_blank.png \
+ images/header_bg.png \
images/bg_r.png \
images/box_bg.png \
images/breadcrumb.png \
diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf
index 50a355f04c..aaf935ac8d 100644
--- a/tools/qdoc3/test/qt-defines.qdocconf
+++ b/tools/qdoc3/test/qt-defines.qdocconf
@@ -10,7 +10,8 @@ defines = Q_QDOC \
Q_BYTE_ORDER \
QT_DEPRECATED \
Q_NO_USING_KEYWORD \
- __cplusplus
+ __cplusplus \
+ Q_COMPILER_INITIALIZER_LISTS
versionsym = QT_VERSION_STR
diff --git a/tools/qdoc3/test/qt-html-default-styles.qdocconf b/tools/qdoc3/test/qt-html-default-styles.qdocconf
index d37ef5d45f..0db36bc458 100644
--- a/tools/qdoc3/test/qt-html-default-styles.qdocconf
+++ b/tools/qdoc3/test/qt-html-default-styles.qdocconf
@@ -8,8 +8,10 @@ HTML.stylesheets = style/offline.css
HTML.scripts =
-# Files not referenced in any qdoc file (last four needed by qtdemo)
-# See also qhp.Qt.extraFiles
+# Files not referenced in any qdoc file, many needed by style sheets.
+# These also need to be listed in qhp.Qt.extraFiles with the correct
+# directory prefixes.
+
extraimages.HTML = qt-logo.png \
arrow_down.png \
breadcrumb.png \
diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf
index 77ab3c5e8a..03ed6fa251 100644
--- a/tools/qdoc3/test/qt-html-templates-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf
@@ -19,7 +19,7 @@ HTML.postheader = \
" </div>\n" \
" <div id=\"shortCut\">\n" \
" <ul>\n" \
- " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \
+ " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.8</a></span></li>\n" \
" <li class=\"shortCut-topleft-active\"><a href=\"http://doc.qt.nokia.com\">ALL VERSIONS" \
" </a></li>\n" \
" </ul>\n" \
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 8a70f3b3e3..4f0cb1f68d 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -55,256 +55,255 @@ qhp.Qt.extraFiles = index.html \
#QtWebKit Guide files
qhp.Qt.extraFiles += webkit-guide/anim_accord.htm \
-webkit-guide/anim_demo-rotate.htm \
-webkit-guide/anim_demo-scale.htm \
-webkit-guide/anim_demo-skew.htm \
-webkit-guide/anim_gallery.htm \
-webkit-guide/anim_panel.htm \
-webkit-guide/anim_pulse.htm \
-webkit-guide/anim_skew.htm \
-webkit-guide/anim_slide1.htm \
-webkit-guide/anim_slide2.htm \
-webkit-guide/anim_slide3.htm \
-webkit-guide/anim_tabbedSkew.htm \
-webkit-guide/_copyright.txt \
-webkit-guide/css3_backgrounds.htm \
-webkit-guide/css3_border-img.htm \
-webkit-guide/css3_gradientBack.htm \
-webkit-guide/css3_gradientBackStop.htm \
-webkit-guide/css3_gradientButton.htm \
-webkit-guide/css3_grad-radial.htm \
-webkit-guide/css3_mask-grad.htm \
-webkit-guide/css3_mask-img.htm \
-webkit-guide/css3_multicol.htm \
-webkit-guide/css3_reflect.htm \
-webkit-guide/css3_scroll.htm \
-webkit-guide/css3_sel-nth.htm \
-webkit-guide/css3_shadow.htm \
-webkit-guide/css3_text-overflow.htm \
-webkit-guide/css3_text-shadow.htm \
-webkit-guide/css3_text-stroke.htm \
-webkit-guide/form_tapper.htm \
-webkit-guide/form_toggler.htm \
-webkit-guide/_image_assets.htm \
-webkit-guide/_index.html \
-webkit-guide/layout_link-fmt.htm \
-webkit-guide/layout_tbl-keyhole.htm \
-webkit-guide/mob_condjs.htm \
-webkit-guide/mob_layout.htm \
-webkit-guide/mob_mediaquery.htm \
-webkit-guide/storage.htm \
-webkit-guide/css/anim_accord.css \
-webkit-guide/css/anim_demo-rotate.css \
-webkit-guide/css/anim_demo-scale.css \
-webkit-guide/css/anim_demo-skew.css \
-webkit-guide/css/anim_gallery.css \
-webkit-guide/css/anim_panel.css \
-webkit-guide/css/anim_pulse.css \
-webkit-guide/css/anim_skew.css \
-webkit-guide/css/anim_slide.css \
-webkit-guide/css/anim_tabbedSkew.css \
-webkit-guide/css/css3_backgrounds.css \
-webkit-guide/css/css3_border-img.css \
-webkit-guide/css/css3_gradientBack.css \
-webkit-guide/css/css3_gradientBackStop.css \
-webkit-guide/css/css3_gradientButton.css \
-webkit-guide/css/css3_grad-radial.css \
-webkit-guide/css/css3_mask-grad.css \
-webkit-guide/css/css3_mask-img.css \
-webkit-guide/css/css3_multicol.css \
-webkit-guide/css/css3_reflect.css \
-webkit-guide/css/css3_scroll.css \
-webkit-guide/css/css3_sel-nth.css \
-webkit-guide/css/css3_shadowBlur.css \
-webkit-guide/css/css3_shadow.css \
-webkit-guide/css/css3_text-overflow.css \
-webkit-guide/css/css3_text-shadow.css \
-webkit-guide/css/css3_text-stroke.css \
-webkit-guide/css/form_tapper.css \
-webkit-guide/css/form_toggler.css \
-webkit-guide/css/layout_link-fmt.css \
-webkit-guide/css/layout_tbl-keyhole.css \
-webkit-guide/css/mob_condjs.css \
-webkit-guide/css/mobile.css \
-webkit-guide/css/mob_mediaquery.css \
-webkit-guide/css/mq_desktop.css \
-webkit-guide/css/mqlayout_desktop.css \
-webkit-guide/css/mqlayout_mobile.css \
-webkit-guide/css/mqlayout_touch.css \
-webkit-guide/css/mq_mobile.css \
-webkit-guide/css/mq_touch.css \
-webkit-guide/css/storage.css \
-webkit-guide/img/border-frame.png \
-webkit-guide/img/gal0.png \
-webkit-guide/img/gal1.png \
-webkit-guide/img/gal2.png \
-webkit-guide/img/gal3.png \
-webkit-guide/img/gal4.png \
-webkit-guide/img/gal5.png \
-webkit-guide/img/gal6.png \
-webkit-guide/img/gal7.png \
-webkit-guide/img/gal8.png \
-webkit-guide/img/gradient.jpg \
-webkit-guide/img/gray_icon_close.png \
-webkit-guide/img/ic_ag_016.png \
-webkit-guide/img/ic_ag_032.png \
-webkit-guide/img/ic_ag_036.png \
-webkit-guide/img/ic_ag_048.png \
-webkit-guide/img/ic_al_016.png \
-webkit-guide/img/ic_al_032.png \
-webkit-guide/img/ic_al_036.png \
-webkit-guide/img/ic_al_048.png \
-webkit-guide/img/ic_ar_016.png \
-webkit-guide/img/ic_ar_032.png \
-webkit-guide/img/ic_ar_036.png \
-webkit-guide/img/ic_ar_048.png \
-webkit-guide/img/ic_b_016.png \
-webkit-guide/img/ic_b_032.png \
-webkit-guide/img/ic_b_036.png \
-webkit-guide/img/ic_b_048.png \
-webkit-guide/img/ic_be_016.png \
-webkit-guide/img/ic_be_032.png \
-webkit-guide/img/ic_be_036.png \
-webkit-guide/img/ic_be_048.png \
-webkit-guide/img/ic_c_016.png \
-webkit-guide/img/ic_c_032.png \
-webkit-guide/img/ic_c_036.png \
-webkit-guide/img/ic_c_048.png \
-webkit-guide/img/ic_ca_016.png \
-webkit-guide/img/ic_ca_032.png \
-webkit-guide/img/ic_ca_036.png \
-webkit-guide/img/ic_ca_048.png \
-webkit-guide/img/ic_cl_016.png \
-webkit-guide/img/ic_cl_032.png \
-webkit-guide/img/ic_cl_036.png \
-webkit-guide/img/ic_cl_048.png \
-webkit-guide/img/ic_cu_016.png \
-webkit-guide/img/ic_cu_032.png \
-webkit-guide/img/ic_cu_036.png \
-webkit-guide/img/ic_cu_048.png \
-webkit-guide/img/ic_f_016.png \
-webkit-guide/img/ic_f_032.png \
-webkit-guide/img/ic_f_036.png \
-webkit-guide/img/ic_f_048.png \
-webkit-guide/img/ic_fe_016.png \
-webkit-guide/img/ic_fe_032.png \
-webkit-guide/img/ic_fe_036.png \
-webkit-guide/img/ic_fe_048.png \
-webkit-guide/img/ic_h_016.png \
-webkit-guide/img/ic_h_032.png \
-webkit-guide/img/ic_h_036.png \
-webkit-guide/img/ic_h_048.png \
-webkit-guide/img/ic_he_016.png \
-webkit-guide/img/ic_he_032.png \
-webkit-guide/img/ic_he_036.png \
-webkit-guide/img/ic_he_048.png \
-webkit-guide/img/ic_k_016.png \
-webkit-guide/img/ic_k_032.png \
-webkit-guide/img/ic_k_036.png \
-webkit-guide/img/ic_k_048.png \
-webkit-guide/img/ic_li_016.png \
-webkit-guide/img/ic_li_032.png \
-webkit-guide/img/ic_li_036.png \
-webkit-guide/img/ic_li_048.png \
-webkit-guide/img/ic_mg_016.png \
-webkit-guide/img/ic_mg_032.png \
-webkit-guide/img/ic_mg_036.png \
-webkit-guide/img/ic_mg_048.png \
-webkit-guide/img/ic_n_016.png \
-webkit-guide/img/ic_n_032.png \
-webkit-guide/img/ic_n_036.png \
-webkit-guide/img/ic_n_048.png \
-webkit-guide/img/ic_na_016.png \
-webkit-guide/img/ic_na_032.png \
-webkit-guide/img/ic_na_036.png \
-webkit-guide/img/ic_na_048.png \
-webkit-guide/img/ic_ne_016.png \
-webkit-guide/img/ic_ne_032.png \
-webkit-guide/img/ic_ne_036.png \
-webkit-guide/img/ic_ne_048.png \
-webkit-guide/img/ic_ni_016.png \
-webkit-guide/img/ic_ni_032.png \
-webkit-guide/img/ic_ni_036.png \
-webkit-guide/img/ic_ni_048.png \
-webkit-guide/img/ic_o_016.png \
-webkit-guide/img/ic_o_032.png \
-webkit-guide/img/ic_o_036.png \
-webkit-guide/img/ic_o_048.png \
-webkit-guide/img/icon_check.png \
-webkit-guide/img/icon_check_x24green.png \
-webkit-guide/img/icon_dismiss.png \
-webkit-guide/img/icon_dismiss_x22.png \
-webkit-guide/img/icon_drill-down.png \
-webkit-guide/img/icon_drill-down_x32.png \
-webkit-guide/img/icon_drill-up.png \
-webkit-guide/img/icon_drill-up_x32.png \
-webkit-guide/img/icon_expand-nav.png \
-webkit-guide/img/icon_head-collapsed.png \
-webkit-guide/img/icon_head-collapsed_x13.png \
-webkit-guide/img/icon_head-expanded.png \
-webkit-guide/img/icon_head-expanded_x13.png \
-webkit-guide/img/icon_info.png \
-webkit-guide/img/icon_info_x24.png \
-webkit-guide/img/icon_link-doc.png \
-webkit-guide/img/icon_link-email.png \
-webkit-guide/img/icon_link-external.png \
-webkit-guide/img/icon_link-pdf.png \
-webkit-guide/img/icon_link-ppt.png \
-webkit-guide/img/icon_link-rss.png \
-webkit-guide/img/icon_link-sms.png \
-webkit-guide/img/icon_link-tel.png \
-webkit-guide/img/icon_link-xls.png \
-webkit-guide/img/icon_list-all_circ.png \
-webkit-guide/img/icon_list-all.png \
-webkit-guide/img/icon_nav_end.png \
-webkit-guide/img/icon_nav-start.png \
-webkit-guide/img/icon_nav-top.png \
-webkit-guide/img/icon_nav-up.png \
-webkit-guide/img/icon_question.png \
-webkit-guide/img/icon_scroll-left.png \
-webkit-guide/img/icon_scroll-right.png \
-webkit-guide/img/icon_trash.png \
-webkit-guide/img/ic_pt_016.png \
-webkit-guide/img/ic_pt_032.png \
-webkit-guide/img/ic_pt_036.png \
-webkit-guide/img/ic_pt_048.png \
-webkit-guide/img/ic_si_016.png \
-webkit-guide/img/ic_si_032.png \
-webkit-guide/img/ic_si_036.png \
-webkit-guide/img/ic_si_048.png \
-webkit-guide/img/ic_zn_016.png \
-webkit-guide/img/ic_zn_032.png \
-webkit-guide/img/ic_zn_036.png \
-webkit-guide/img/ic_zn_048.png \
-webkit-guide/img/land1.png \
-webkit-guide/img/land2.png \
-webkit-guide/img/land3.png \
-webkit-guide/img/land4.png \
-webkit-guide/img/land5.png \
-webkit-guide/img/land6.png \
-webkit-guide/img/land7.png \
-webkit-guide/img/land8.png \
-webkit-guide/img/mask.png \
-webkit-guide/img/tnail_gal1.png \
-webkit-guide/img/tnail_gal2.png \
-webkit-guide/img/tnail_gal3.png \
-webkit-guide/img/tnail_gal4.png \
-webkit-guide/img/tnail_gal5.png \
-webkit-guide/img/tnail_gal6.png \
-webkit-guide/img/tnail_gal7.png \
-webkit-guide/img/tnail_gal8.png \
-webkit-guide/js/anim_accord.js \
-webkit-guide/js/anim_gallery.js \
-webkit-guide/js/anim_panel.js \
-webkit-guide/js/anim_skew.js \
-webkit-guide/js/css3_backgrounds.js \
-webkit-guide/js/css3_border-img.js \
-webkit-guide/js/css3_grad-radial.js \
-webkit-guide/js/css3_mask-grad.js \
-webkit-guide/js/css3_mask-img.js \
-webkit-guide/js/css3_text-overflow.js \
-webkit-guide/js/form_tapper.js \
-webkit-guide/js/mob_condjs.js \
-webkit-guide/js/mobile.js \
-webkit-guide/js/storage.js \
-
+ webkit-guide/anim_demo-rotate.htm \
+ webkit-guide/anim_demo-scale.htm \
+ webkit-guide/anim_demo-skew.htm \
+ webkit-guide/anim_gallery.htm \
+ webkit-guide/anim_panel.htm \
+ webkit-guide/anim_pulse.htm \
+ webkit-guide/anim_skew.htm \
+ webkit-guide/anim_slide1.htm \
+ webkit-guide/anim_slide2.htm \
+ webkit-guide/anim_slide3.htm \
+ webkit-guide/anim_tabbedSkew.htm \
+ webkit-guide/_copyright.txt \
+ webkit-guide/css3_backgrounds.htm \
+ webkit-guide/css3_border-img.htm \
+ webkit-guide/css3_gradientBack.htm \
+ webkit-guide/css3_gradientBackStop.htm \
+ webkit-guide/css3_gradientButton.htm \
+ webkit-guide/css3_grad-radial.htm \
+ webkit-guide/css3_mask-grad.htm \
+ webkit-guide/css3_mask-img.htm \
+ webkit-guide/css3_multicol.htm \
+ webkit-guide/css3_reflect.htm \
+ webkit-guide/css3_scroll.htm \
+ webkit-guide/css3_sel-nth.htm \
+ webkit-guide/css3_shadow.htm \
+ webkit-guide/css3_text-overflow.htm \
+ webkit-guide/css3_text-shadow.htm \
+ webkit-guide/css3_text-stroke.htm \
+ webkit-guide/form_tapper.htm \
+ webkit-guide/form_toggler.htm \
+ webkit-guide/_image_assets.htm \
+ webkit-guide/_index.html \
+ webkit-guide/layout_link-fmt.htm \
+ webkit-guide/layout_tbl-keyhole.htm \
+ webkit-guide/mob_condjs.htm \
+ webkit-guide/mob_layout.htm \
+ webkit-guide/mob_mediaquery.htm \
+ webkit-guide/storage.htm \
+ webkit-guide/css/anim_accord.css \
+ webkit-guide/css/anim_demo-rotate.css \
+ webkit-guide/css/anim_demo-scale.css \
+ webkit-guide/css/anim_demo-skew.css \
+ webkit-guide/css/anim_gallery.css \
+ webkit-guide/css/anim_panel.css \
+ webkit-guide/css/anim_pulse.css \
+ webkit-guide/css/anim_skew.css \
+ webkit-guide/css/anim_slide.css \
+ webkit-guide/css/anim_tabbedSkew.css \
+ webkit-guide/css/css3_backgrounds.css \
+ webkit-guide/css/css3_border-img.css \
+ webkit-guide/css/css3_gradientBack.css \
+ webkit-guide/css/css3_gradientBackStop.css \
+ webkit-guide/css/css3_gradientButton.css \
+ webkit-guide/css/css3_grad-radial.css \
+ webkit-guide/css/css3_mask-grad.css \
+ webkit-guide/css/css3_mask-img.css \
+ webkit-guide/css/css3_multicol.css \
+ webkit-guide/css/css3_reflect.css \
+ webkit-guide/css/css3_scroll.css \
+ webkit-guide/css/css3_sel-nth.css \
+ webkit-guide/css/css3_shadowBlur.css \
+ webkit-guide/css/css3_shadow.css \
+ webkit-guide/css/css3_text-overflow.css \
+ webkit-guide/css/css3_text-shadow.css \
+ webkit-guide/css/css3_text-stroke.css \
+ webkit-guide/css/form_tapper.css \
+ webkit-guide/css/form_toggler.css \
+ webkit-guide/css/layout_link-fmt.css \
+ webkit-guide/css/layout_tbl-keyhole.css \
+ webkit-guide/css/mob_condjs.css \
+ webkit-guide/css/mobile.css \
+ webkit-guide/css/mob_mediaquery.css \
+ webkit-guide/css/mq_desktop.css \
+ webkit-guide/css/mqlayout_desktop.css \
+ webkit-guide/css/mqlayout_mobile.css \
+ webkit-guide/css/mqlayout_touch.css \
+ webkit-guide/css/mq_mobile.css \
+ webkit-guide/css/mq_touch.css \
+ webkit-guide/css/storage.css \
+ webkit-guide/img/border-frame.png \
+ webkit-guide/img/gal0.png \
+ webkit-guide/img/gal1.jpg \
+ webkit-guide/img/gal2.jpg \
+ webkit-guide/img/gal3.jpg \
+ webkit-guide/img/gal4.jpg \
+ webkit-guide/img/gal5.jpg \
+ webkit-guide/img/gal6.jpg \
+ webkit-guide/img/gal7.jpg \
+ webkit-guide/img/gal8.jpg \
+ webkit-guide/img/gradient.jpg \
+ webkit-guide/img/gray_icon_close.png \
+ webkit-guide/img/ic_ag_016.png \
+ webkit-guide/img/ic_ag_032.png \
+ webkit-guide/img/ic_ag_036.png \
+ webkit-guide/img/ic_ag_048.png \
+ webkit-guide/img/ic_al_016.png \
+ webkit-guide/img/ic_al_032.png \
+ webkit-guide/img/ic_al_036.png \
+ webkit-guide/img/ic_al_048.png \
+ webkit-guide/img/ic_ar_016.png \
+ webkit-guide/img/ic_ar_032.png \
+ webkit-guide/img/ic_ar_036.png \
+ webkit-guide/img/ic_ar_048.png \
+ webkit-guide/img/ic_b_016.png \
+ webkit-guide/img/ic_b_032.png \
+ webkit-guide/img/ic_b_036.png \
+ webkit-guide/img/ic_b_048.png \
+ webkit-guide/img/ic_be_016.png \
+ webkit-guide/img/ic_be_032.png \
+ webkit-guide/img/ic_be_036.png \
+ webkit-guide/img/ic_be_048.png \
+ webkit-guide/img/ic_c_016.png \
+ webkit-guide/img/ic_c_032.png \
+ webkit-guide/img/ic_c_036.png \
+ webkit-guide/img/ic_c_048.png \
+ webkit-guide/img/ic_ca_016.png \
+ webkit-guide/img/ic_ca_032.png \
+ webkit-guide/img/ic_ca_036.png \
+ webkit-guide/img/ic_ca_048.png \
+ webkit-guide/img/ic_cl_016.png \
+ webkit-guide/img/ic_cl_032.png \
+ webkit-guide/img/ic_cl_036.png \
+ webkit-guide/img/ic_cl_048.png \
+ webkit-guide/img/ic_cu_016.png \
+ webkit-guide/img/ic_cu_032.png \
+ webkit-guide/img/ic_cu_036.png \
+ webkit-guide/img/ic_cu_048.png \
+ webkit-guide/img/ic_f_016.png \
+ webkit-guide/img/ic_f_032.png \
+ webkit-guide/img/ic_f_036.png \
+ webkit-guide/img/ic_f_048.png \
+ webkit-guide/img/ic_fe_016.png \
+ webkit-guide/img/ic_fe_032.png \
+ webkit-guide/img/ic_fe_036.png \
+ webkit-guide/img/ic_fe_048.png \
+ webkit-guide/img/ic_h_016.png \
+ webkit-guide/img/ic_h_032.png \
+ webkit-guide/img/ic_h_036.png \
+ webkit-guide/img/ic_h_048.png \
+ webkit-guide/img/ic_he_016.png \
+ webkit-guide/img/ic_he_032.png \
+ webkit-guide/img/ic_he_036.png \
+ webkit-guide/img/ic_he_048.png \
+ webkit-guide/img/ic_k_016.png \
+ webkit-guide/img/ic_k_032.png \
+ webkit-guide/img/ic_k_036.png \
+ webkit-guide/img/ic_k_048.png \
+ webkit-guide/img/ic_li_016.png \
+ webkit-guide/img/ic_li_032.png \
+ webkit-guide/img/ic_li_036.png \
+ webkit-guide/img/ic_li_048.png \
+ webkit-guide/img/ic_mg_016.png \
+ webkit-guide/img/ic_mg_032.png \
+ webkit-guide/img/ic_mg_036.png \
+ webkit-guide/img/ic_mg_048.png \
+ webkit-guide/img/ic_n_016.png \
+ webkit-guide/img/ic_n_032.png \
+ webkit-guide/img/ic_n_036.png \
+ webkit-guide/img/ic_n_048.png \
+ webkit-guide/img/ic_na_016.png \
+ webkit-guide/img/ic_na_032.png \
+ webkit-guide/img/ic_na_036.png \
+ webkit-guide/img/ic_na_048.png \
+ webkit-guide/img/ic_ne_016.png \
+ webkit-guide/img/ic_ne_032.png \
+ webkit-guide/img/ic_ne_036.png \
+ webkit-guide/img/ic_ne_048.png \
+ webkit-guide/img/ic_ni_016.png \
+ webkit-guide/img/ic_ni_032.png \
+ webkit-guide/img/ic_ni_036.png \
+ webkit-guide/img/ic_ni_048.png \
+ webkit-guide/img/ic_o_016.png \
+ webkit-guide/img/ic_o_032.png \
+ webkit-guide/img/ic_o_036.png \
+ webkit-guide/img/ic_o_048.png \
+ webkit-guide/img/icon_check.png \
+ webkit-guide/img/icon_check_x24green.png \
+ webkit-guide/img/icon_dismiss.png \
+ webkit-guide/img/icon_dismiss_x22.png \
+ webkit-guide/img/icon_drill-down.png \
+ webkit-guide/img/icon_drill-down_x32.png \
+ webkit-guide/img/icon_drill-up.png \
+ webkit-guide/img/icon_drill-up_x32.png \
+ webkit-guide/img/icon_expand-nav.png \
+ webkit-guide/img/icon_head-collapsed.png \
+ webkit-guide/img/icon_head-collapsed_x13.png \
+ webkit-guide/img/icon_head-expanded.png \
+ webkit-guide/img/icon_head-expanded_x13.png \
+ webkit-guide/img/icon_info.png \
+ webkit-guide/img/icon_info_x24.png \
+ webkit-guide/img/icon_link-doc.png \
+ webkit-guide/img/icon_link-email.png \
+ webkit-guide/img/icon_link-external.png \
+ webkit-guide/img/icon_link-pdf.png \
+ webkit-guide/img/icon_link-ppt.png \
+ webkit-guide/img/icon_link-rss.png \
+ webkit-guide/img/icon_link-sms.png \
+ webkit-guide/img/icon_link-tel.png \
+ webkit-guide/img/icon_link-xls.png \
+ webkit-guide/img/icon_list-all_circ.png \
+ webkit-guide/img/icon_list-all.png \
+ webkit-guide/img/icon_nav_end.png \
+ webkit-guide/img/icon_nav-start.png \
+ webkit-guide/img/icon_nav-top.png \
+ webkit-guide/img/icon_nav-up.png \
+ webkit-guide/img/icon_question.png \
+ webkit-guide/img/icon_scroll-left.png \
+ webkit-guide/img/icon_scroll-right.png \
+ webkit-guide/img/icon_trash.png \
+ webkit-guide/img/ic_pt_016.png \
+ webkit-guide/img/ic_pt_032.png \
+ webkit-guide/img/ic_pt_036.png \
+ webkit-guide/img/ic_pt_048.png \
+ webkit-guide/img/ic_si_016.png \
+ webkit-guide/img/ic_si_032.png \
+ webkit-guide/img/ic_si_036.png \
+ webkit-guide/img/ic_si_048.png \
+ webkit-guide/img/ic_zn_016.png \
+ webkit-guide/img/ic_zn_032.png \
+ webkit-guide/img/ic_zn_036.png \
+ webkit-guide/img/ic_zn_048.png \
+ webkit-guide/img/land1.jpg \
+ webkit-guide/img/land2.jpg \
+ webkit-guide/img/land3.jpg \
+ webkit-guide/img/land4.jpg \
+ webkit-guide/img/land5.jpg \
+ webkit-guide/img/land6.jpg \
+ webkit-guide/img/land7.jpg \
+ webkit-guide/img/land8.jpg \
+ webkit-guide/img/mask.png \
+ webkit-guide/img/tnail_gal1.png \
+ webkit-guide/img/tnail_gal2.png \
+ webkit-guide/img/tnail_gal3.png \
+ webkit-guide/img/tnail_gal4.png \
+ webkit-guide/img/tnail_gal5.png \
+ webkit-guide/img/tnail_gal6.png \
+ webkit-guide/img/tnail_gal7.png \
+ webkit-guide/img/tnail_gal8.png \
+ webkit-guide/js/anim_accord.js \
+ webkit-guide/js/anim_gallery.js \
+ webkit-guide/js/anim_panel.js \
+ webkit-guide/js/anim_skew.js \
+ webkit-guide/js/css3_backgrounds.js \
+ webkit-guide/js/css3_border-img.js \
+ webkit-guide/js/css3_grad-radial.js \
+ webkit-guide/js/css3_mask-grad.js \
+ webkit-guide/js/css3_mask-img.js \
+ webkit-guide/js/css3_text-overflow.js \
+ webkit-guide/js/form_tapper.js \
+ webkit-guide/js/mob_condjs.js \
+ webkit-guide/js/mobile.js \
+ webkit-guide/js/storage.js
diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
index a69d7a1b8b..8dc17af741 100644
--- a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
@@ -24,7 +24,7 @@ HTML.postheader = \
" </div>\n" \
" <div id=\"shortCut\">\n" \
" <ul>\n" \
- " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \
+ " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.8</a></span></li>\n" \
" <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL VERSIONS" \
" </a></li>\n" \
" </ul>\n" \
diff --git a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
index ed2162e7b0..e7e822090f 100644
--- a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
@@ -24,7 +24,7 @@ HTML.postheader = \
" </div>\n" \
" <div id=\"shortCut\">\n" \
" <ul>\n" \
- " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \
+ " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.8</a></span></li>\n" \
" <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL VERSIONS" \
" </a></li>\n" \
" </ul>\n" \
diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf
index d03dfd2ef4..fca65456a5 100644
--- a/tools/qdoc3/test/qt-project.qdocconf
+++ b/tools/qdoc3/test/qt-project.qdocconf
@@ -5,8 +5,8 @@ include(qt-defines.qdocconf)
project = Qt
description = Qt Reference Documentation
-url = http://qt.nokia.com/doc/4.7
-version = 4.7.3
+url = http://qt.nokia.com/doc/4.8
+version = 4.8.0
sourceencoding = UTF-8
outputencoding = UTF-8
@@ -15,14 +15,14 @@ naturallanguage = en_US
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.473
+qhp.Qt.namespace = com.trolltech.qt.480
qhp.Qt.virtualFolder = qdoc
qhp.Qt.indexTitle = Qt Reference Documentation
qhp.Qt.indexRoot =
-qhp.Qt.filterAttributes = qt 4.7.3 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.7.3
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.3
+qhp.Qt.filterAttributes = qt 4.8.0 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.8.0
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.8.0
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 5667c7a08c..f398358f64 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -65,6 +65,8 @@
#include <signal.h>
#endif
+QString pluginImportPath;
+
void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject *> *metas)
{
if (! meta || metas->contains(meta))
@@ -194,7 +196,7 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode,
code += " {}\n";
QDeclarativeComponent c(engine);
- c.setData(code, QUrl("typeinstance"));
+ c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml"));
QObject *object = c.create();
if (object)
@@ -334,6 +336,10 @@ private:
qml->writeStartObject("Property");
qml->writeScriptBinding(QLatin1String("name"), enquote(QString::fromUtf8(prop.name())));
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 4))
+ if (int revision = prop.revision())
+ qml->writeScriptBinding(QLatin1String("revision"), QString::number(revision));
+#endif
writeTypeProperties(prop.typeName(), prop.isWritable());
qml->writeEndObject();
@@ -362,6 +368,11 @@ private:
qml->writeScriptBinding(QLatin1String("name"), enquote(name));
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 4))
+ if (int revision = meth.revision())
+ qml->writeScriptBinding(QLatin1String("revision"), QString::number(revision));
+#endif
+
const QString typeName = convertToId(meth.typeName());
if (! typeName.isEmpty())
qml->writeScriptBinding(QLatin1String("type"), enquote(typeName));
@@ -451,7 +462,6 @@ int main(int argc, char *argv[])
QString pluginImportUri;
QString pluginImportVersion;
- QString pluginImportPath;
bool relocatable = true;
bool pathImport = false;
if (args.size() >= 3) {
@@ -488,7 +498,7 @@ int main(int argc, char *argv[])
qWarning() << "Incorrect number of positional arguments";
return EXIT_INVALIDARGUMENTS;
}
- pluginImportPath = positionalArgs[1];
+ pluginImportPath = QDir::fromNativeSeparators(positionalArgs[1]);
if (positionalArgs.size() == 3)
pluginImportVersion = positionalArgs[2];
}
@@ -500,7 +510,7 @@ int main(int argc, char *argv[])
engine->addImportPath(pluginImportPath);
// find all QMetaObjects reachable from the builtin module
- QByteArray importCode("import QtQuick 1.0\n");
+ QByteArray importCode("import QtQuick 1.1\n");
QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects(importCode, engine);
// this will hold the meta objects we want to dump information of
@@ -514,7 +524,7 @@ int main(int argc, char *argv[])
importCode += QString("import %0 %1\n").arg(pluginImportUri, pluginImportVersion).toAscii();
} else {
// pluginImportVersion can be empty
- importCode += QString("import \"%1\" %2\n").arg(pluginImportPath, pluginImportVersion).toAscii();
+ importCode += QString("import \".\" %2\n").arg(pluginImportVersion).toAscii();
}
// create a component with these imports to make sure the imports are valid
@@ -524,7 +534,7 @@ int main(int argc, char *argv[])
code += "QtObject {}";
QDeclarativeComponent c(engine);
- c.setData(code, QUrl("typelist"));
+ c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typelist.qml"));
c.create();
if (!c.errors().isEmpty()) {
foreach (const QDeclarativeError &error, c.errors())
diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp
index d5a0bdeea4..a677a0425c 100644
--- a/tools/qtconfig/mainwindow.cpp
+++ b/tools/qtconfig/mainwindow.cpp
@@ -75,7 +75,9 @@
#include <phonon/phononnamespace.h>
#endif
+#ifdef Q_WS_X11
#include <QtGui/private/qt_x11_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -263,10 +265,15 @@ MainWindow::MainWindow()
connect(ui->buttonMainColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette()));
connect(ui->buttonWindowColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette()));
+#ifdef Q_WS_X11
if (X11->desktopEnvironment == DE_KDE)
ui->colorConfig->hide();
else
ui->kdeNoteLabel->hide();
+#else
+ ui->colorConfig->hide();
+ ui->kdeNoteLabel->hide();
+#endif
QFontDatabase db;
QStringList families = db.families();
@@ -384,7 +391,7 @@ MainWindow::MainWindow()
ui->inputStyleCombo->setCurrentIndex(ui->inputStyleCombo->findText(settingsInputStyle));
#else
ui->inputStyleCombo->hide();
- ui->inputStyleComboLabel->hide();
+ ui->inputStyleLabel->hide();
#endif
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
@@ -407,7 +414,7 @@ MainWindow::MainWindow()
ui->inputMethodCombo->setCurrentIndex(inputMethodComboIndex);
#else
ui->inputMethodCombo->hide();
- ui->inputMethodComboLabel->hide();
+ ui->inputMethodLabel->hide();
#endif
ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true)
diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts
index a3169ab233..5c990deb50 100644
--- a/translations/assistant_ja.ts
+++ b/translations/assistant_ja.ts
@@ -610,7 +610,7 @@ Reason:
</message>
<message>
<source>Next</source>
- <translation>進む</translation>
+ <translation>次へ</translation>
</message>
<message>
<source>Case Sensitive</source>
diff --git a/translations/designer_ja.ts b/translations/designer_ja.ts
index ab876448d5..7fcc66d21d 100644
--- a/translations/designer_ja.ts
+++ b/translations/designer_ja.ts
@@ -764,7 +764,7 @@
</message>
<message>
<source>The skin configuration file &apos;%1&apos; could not be opened.</source>
- <translation>スキンの設定ファイル &apos;%1&apos; がオープンできませんでした。</translation>
+ <translation>スキンの設定ファイル &apos;%1&apos; を開けませんでした。</translation>
</message>
<message>
<source>Syntax error: %1</source>
@@ -1060,7 +1060,7 @@ Parsing grid layout minimum size values</extracomment>
</message>
<message>
<source>&amp;Open...</source>
- <translation>オープン(&amp;O)...</translation>
+ <translation>開く(&amp;O)...</translation>
</message>
<message>
<source>&amp;Recent Forms</source>
@@ -1304,7 +1304,7 @@ UI ファイルの記述が矛盾しています。</translation>
</message>
<message>
<source>Unknown error</source>
- <translation>不明なエラー</translation>
+ <translation>未知のエラー</translation>
</message>
<message>
<source>An error occurred while running the script for %1: %2
@@ -1451,7 +1451,7 @@ Do you want to update the file location or generate a new form?</source>
</message>
<message>
<source>Could not open file</source>
- <translation>ファイルをオープンできませんでした</translation>
+ <translation>ファイルを開けませんでした</translation>
</message>
<message>
<source>Saved image %1.</source>
@@ -1471,7 +1471,7 @@ Do you want to update the file location or generate a new form?</source>
</message>
<message>
<source>Could not write file</source>
- <translation>ファイルに書き込むことができませんでした</translation>
+ <translation>ファイルに書き込めませんでした</translation>
</message>
<message>
<source>&amp;Close Preview</source>
@@ -1491,7 +1491,7 @@ Do you want to update the file location or generate a new form?</source>
</message>
<message>
<source>Save &amp;As...</source>
- <translation>名前をつけて保存(&amp;A)...</translation>
+ <translation>名前を付けて保存(&amp;A)...</translation>
</message>
<message>
<source>Save A&amp;ll</source>
@@ -1525,7 +1525,7 @@ Do you want to update the file location or generate a new form?</source>
<source>The file %1 could not be opened.
Reason: %2
Would you like to retry or select a different file?</source>
- <translation>ファイル %1 はオープンできませんでした。
+ <translation>ファイル %1 を開けませんでした。
原因: %2
リトライしますか、それとも他のファイルを選択しますか?</translation>
</message>
@@ -1533,7 +1533,7 @@ Would you like to retry or select a different file?</source>
<source>It was not possible to write the entire file %1 to disk.
Reason:%2
Would you like to retry?</source>
- <translation>ファイル %1 の全体をディスクに書き込むことができませんでした。
+ <translation>ファイル %1 の全体をディスクに書き込めませんでした。
原因: %2
リトライしますか?</translation>
</message>
@@ -1876,7 +1876,7 @@ Container pages should only be added by specifying them in XML returned by the d
</message>
<message>
<source>The file &lt;b&gt;%1&lt;/b&gt; could not be opened.</source>
- <translation>ファイル &lt;b&gt;%1&lt;/b&gt; はオープンできませんでした。</translation>
+ <translation>ファイル &lt;b&gt;%1&lt;/b&gt; を開けませんでした。</translation>
</message>
<message numerus="yes">
<source>There are %n forms with unsaved changes. Do you want to review these changes before quitting?</source>
@@ -2164,7 +2164,7 @@ Empty class name passed to widget factory method</extracomment>
</message>
<message>
<source>What&apos;s This</source>
- <translation>ヘルプ</translation>
+ <translation>ヒント</translation>
</message>
<message>
<source>Busy</source>
@@ -2190,7 +2190,7 @@ Empty class name passed to widget factory method</extracomment>
</message>
<message>
<source>Italic</source>
- <translation>イタリック</translation>
+ <translation>斜体</translation>
</message>
<message>
<source>Underline</source>
@@ -2778,7 +2778,7 @@ to
</message>
<message>
<source>Could not write %1: %2</source>
- <translation>%1 に書き込むことが出来ませんでした: %2</translation>
+ <translation>%1 に書き込めませんでした: %2</translation>
</message>
<message>
<source>Open Resource File</source>
@@ -2790,11 +2790,11 @@ to
</message>
<message>
<source>Move Up</source>
- <translation>上へ移動</translation>
+ <translation>上に移動</translation>
</message>
<message>
<source>Move Down</source>
- <translation>下へ移動</translation>
+ <translation>下に移動</translation>
</message>
<message>
<source>Add Prefix</source>
@@ -3082,7 +3082,7 @@ Do you want overwrite the template?</source>
</message>
<message>
<source>There was an error opening template %1 for writing. Reason: %2</source>
- <translation>%1 というテンプレートを書き込み用にオープンしようとしてエラーになりました。理由: %2</translation>
+ <translation>%1 というテンプレートを書き込み用に開こうととしてエラーになりました。理由: %2</translation>
</message>
<message>
<source>Write Error</source>
@@ -3534,7 +3534,7 @@ Do you want overwrite the template?</source>
</message>
<message>
<source>The file %1 could not be opened: %2</source>
- <translation>ファイル %1 はオープンできませんでした: %2</translation>
+ <translation>ファイル %1 を開けませんでした: %2</translation>
</message>
<message>
<source>The file %1 could not be written: %2</source>
@@ -3797,19 +3797,19 @@ Do you want overwrite the template?</source>
</message>
<message>
<source>Unable to open the file &apos;%1&apos; for writing: %2</source>
- <translation>ファイル &apos;%1&apos; を書き込み用にオープンできませんでした: %2</translation>
+ <translation>ファイル &apos;%1&apos; を書き込み用に開けません: %2</translation>
</message>
<message>
<source>Open profile</source>
- <translation>プロファイルをオープン</translation>
+ <translation>プロファイルを開く</translation>
</message>
<message>
<source>Open Profile - Error</source>
- <translation>プロファイルをオープン - Error</translation>
+ <translation>プロファイルを開く - エラー</translation>
</message>
<message>
<source>Unable to open the file &apos;%1&apos; for reading: %2</source>
- <translation>ファイル &apos;%1&apos; を読み込み用にオープンできませんでした: %2</translation>
+ <translation>ファイル &apos;%1&apos; を読み込み用に開けません: %2</translation>
</message>
<message>
<source>&apos;%1&apos; is not a valid profile: %2</source>
@@ -4558,7 +4558,7 @@ Please select another name.</source>
</message>
<message>
<source>Unable to open the form template file &apos;%1&apos;: %2</source>
- <translation>フォームのテンプレートファイル &apos;%1&apos; をオープンできません: %2</translation>
+ <translation>フォームのテンプレートファイル &apos;%1&apos; を開けません: %2</translation>
</message>
<message>
<source>Internal error: No template selected.</source>
@@ -4761,7 +4761,7 @@ Please select another name.</source>
</message>
<message>
<source>Refresh</source>
- <translation>リフレッシュ</translation>
+ <translation>更新</translation>
</message>
<message>
<source>Scan for newly installed custom widget plugins.</source>
@@ -5256,7 +5256,7 @@ Class: %2</source>
</message>
<message>
<source>&amp;OK</source>
- <translation>OK(&amp;O)</translation>
+ <translation>&amp;OK</translation>
</message>
<message>
<source>&amp;Cancel</source>
@@ -5287,7 +5287,7 @@ Class: %2</source>
</message>
<message>
<source>Italic</source>
- <translation>イタリック</translation>
+ <translation>斜体</translation>
</message>
<message>
<source>CTRL+I</source>
@@ -5730,7 +5730,7 @@ Class: %2</source>
</message>
<message>
<source>List View</source>
- <translation>リスト表示</translation>
+ <translation>一覧表示</translation>
</message>
<message>
<source>Icon View</source>
@@ -5792,7 +5792,7 @@ UI ファイルに矛盾が発生しています。</translation>
<name>qdesigner_internal::WizardContainerWidgetTaskMenu</name>
<message>
<source>Next</source>
- <translation>進む</translation>
+ <translation>次へ</translation>
</message>
<message>
<source>Back</source>
diff --git a/translations/linguist_ja.ts b/translations/linguist_ja.ts
index 40bb778248..9164b75a39 100644
--- a/translations/linguist_ja.ts
+++ b/translations/linguist_ja.ts
@@ -84,6 +84,10 @@
<context>
<name>DataModel</name>
<message>
+ <source>The translation file &apos;%1&apos; will not be loaded because it is empty.</source>
+ <translation>翻訳ファイル &apos;%1&apos; が空のためロードできません。</translation>
+ </message>
+ <message>
<source>&lt;qt&gt;Duplicate messages found in &apos;%1&apos;:</source>
<translation>&lt;qt&gt;&apos;%1&apos; に重複したメッセージが見つかりました:</translation>
</message>
@@ -345,7 +349,7 @@ Return value:
2 on read failures
3 on write failures
</source>
- <translation type="unfinished">
+ <translation>
使い方:
lconvert [オプション] &lt;入力ファイル&gt; [&lt;入力ファイル&gt;...]
@@ -365,8 +369,8 @@ lconvert は Qt Linguist ツールチェインの一部です。
-i &lt;入力ファイル&gt;
--input-file &lt;入力ファイル&gt;
入力ファイルを指定します。&lt;入力ファイル&gt; の指定はダッシュ記号で始まっていてもよいです。
- This option can be used several times to merge inputs.
- May be &apos;-&apos; (標準入力) for use in a pipe.
+ このオプションはマージする入力ファイルを指定する際に複数回使用できます。
+ パイプで利用する場合には &apos;-&apos; で標準入力を指定します。
-o &lt;出力ファイル&gt;
--output-file &lt;出力ファイル&gt;
@@ -382,29 +386,30 @@ lconvert は Qt Linguist ツールチェインの一部です。
出力形式を指定します。-if を参照してください。
--input-codec &lt;コーデック&gt;
- Specify encoding for QM and PO input files. Default is &apos;Latin1&apos;
- for QM and &apos;UTF-8&apos; for PO files. UTF-8 is always tried as well for
- QM, corresponding to the possible use of the trUtf8() function.
+ QM や PO ファイルのエンコーディングを指定します。デフォルトでは
+ QM ファイルでは &apos;Latin1&apos; を PO ファイルでは &apos;UTF-8&apos; を使用します。
+ QM ファイルでは通常 trUtf8() 関数が組み合わせて利用されるため、
+ UTF-8 の利用も試みます。
--output-codec &lt;コーデック&gt;
- Specify encoding for PO output files.デフォルトは &apos;UTF-8&apos; です。
+ PO 出力ファイルのエンコーディングを指定します。デフォルトは &apos;UTF-8&apos; です。
--drop-tags &lt;正規表現&gt;
- Drop named extra tags when writing TS or XLIFF files.
- May be specified repeatedly.
+ TS ファイルや XLIFF ファイルに出力する際に名前付き拡張タグを削除します。
+ 複数回指定可能です。
--drop-translations
- Drop existing translations and reset the status to &apos;unfinished&apos;.
- 注意: --no-obsolete と同等です。
+ 既存の翻訳を削除してステータスを&apos;未完了&apos;にリセットします。
+ 注意: --no-obsolete の指定を含みます。
--source-language &lt;language&gt;[_&lt;region&gt;]
- Specify/override the language of the source strings. Defaults to
- POSIX if not specified and the file does not name it yet.
+ ソーステキストの言語を指定もしくは上書きします。
+ 未指定でファイルにも記述されていない場合、POSIX をデフォルトで使用します。
--target-language &lt;language&gt;[_&lt;region&gt;]
- Specify/override the language of the translation.
- The target language is guessed from the file name if this option
- is not specified and the file contents name no language yet.
+ 翻訳で使用される言語を指定もしくは上書きします。
+ オプションやファイル内で言語が指定されていない場合は、
+ ファイル名から言語を推測します。
--no-obsolete
未使用のメッセージを取り除きます。
@@ -416,14 +421,14 @@ lconvert は Qt Linguist ツールチェインの一部です。
出力する TS ファイル内のコンテキストをアルファベット順にソートします。
--locations {absolute|relative|none}
- Override how source code references are saved in TS files.
- Default is absolute.
+ TS ファイル内に保存されているソースコードへの参照を上書きします。
+ デフォルトは absolute (絶対パス) です。
--no-ui-lines
UI ファイルを参照している行番号を取り除きます。
--verbose
- be a bit more verbose
+ より詳しいログを出力します。
長すぎるオプションの指定はダッシュ記号で括る事で1つにできます。
@@ -489,13 +494,14 @@ Options:
-version
Display the version of lrelease and exit
</source>
- <translation type="unfinished">使い方:
+ <translation>使い方:
lrelease [オプション] project-file
lrelease [オプション] ts-files [-qm qm-file]
-lrelease is part of Qt&apos;s Linguist tool chain. It can be used as a
-stand-alone tool to convert XML-based translations files in the TS
-format into the &apos;compiled&apos; QM format used by QTranslator objects.
+lrelease は Qt Linguist ツールチェインの一部です。
+XMLベースの翻訳ファイルであるTSフォーマットを
+QTranslatorで利用可能な「コンパイル済み」のQMフォーマットに
+変換する事ができるスタンドアロンのツールです。
オプション:
-help このヘルプを表示して終了します
@@ -506,13 +512,13 @@ format into the &apos;compiled&apos; QM format used by QTranslator objects.
-nounfinished
未完了の翻訳をインクルードしません
-removeidentical
- If the translated text is the same as
- the source text, do not include the message
+ 翻訳後の文字列がソースと同じ場合、
+ メッセージをQMファイルに組み込みません
-markuntranslated &lt;プレフィクス&gt;
- If a message has no real translation, use the source text
- prefixed with the given string instead
+ メッセージが翻訳されていない場合、ソースの文字列に
+ &lt;プレフィックス&gt;を追加した文字列を代わりに使用します
-silent
- 完了した事を通知しません
+ 実行内容を表示しません
-version
lrelease のバージョンを表示して終了します
</translation>
@@ -823,62 +829,62 @@ Options:
@lst-file
Read additional file names (one per line) from lst-file.
</source>
- <translation type="unfinished">使い方:
+ <translation>使い方:
lupdate [オプション] [プロジェクトファイル]...
lupdate [オプション] [source-file|path|@lst-file]... -ts ts-files|@lst-file
-lupdate は Qt&apos; Linguist ツールチェインの一部です。Qt UI ファイル、C++ 、Java、
+lupdate は Qt Linguist ツールチェインの一部です。Qt UI ファイル、C++ 、Java、
JavaScript/QtScript のソースコードからメッセージを抽出します。
-Extracted messages are stored in textual translation source files (typically
-Qt TS XML). 新しく追加されたり変更されたメッセージは既存の TS ファイル内のメッセージから
-マージされます。
+抽出されたメッセージは原文として翻訳ソースファイル(通常は Qt TS XML)に保存されます。
+新しく追加されたり変更されたメッセージは既存の TS ファイル内のメッセージからマージされます。
オプション:
-help このヘルプを表示して終了します。
-no-obsolete
- すべての未使用の文字列を取り除きます。
+ すべての未使用の文字列を取り除きます。
-extensions &lt;ext&gt;[,&lt;ext&gt;]...
- 与えられた拡張子のファイルだけ処理します。
- 拡張子のリストはカンマで区切り、空白スペースを含んではいけません。
- デフォルト: &apos;%1&apos;
+ 与えられた拡張子のファイルだけを処理します。
+ 拡張子のリストはカンマで区切り、空白スペースを含んではいけません。
+ デフォルト: &apos;%1&apos;
-pluralonly
- 複数形のメッセージだけインクルードします。
+ 複数形のメッセージだけインクルードします。
-silent
- 完了した事を通知しません
+ 完了した事を通知しません
-no-sort
- TS ファイル内のコンテキストをソートしません。
+ TS ファイル内のコンテキストをソートしません。
-no-recursive
- ディレクトリ内を再帰的に処理しません。
+ ディレクトリ内を再帰的に処理しません。
-recursive
- ディレクトリ内を再帰的に処理します。(デフォルト)
+ ディレクトリ内を再帰的に処理します。(デフォルト)
-I &lt;includepath&gt; or -I&lt;includepath&gt;
- Additional location to look for include files.
- May be specified multiple times.
+ include ファイルを検索するパスを追加します。
+ 複数回の指定が可能です。
-locations {absolute|relative|none}
- Specify/override how source code references are saved in TS files.
- Default is absolute.
+ TS ファイルに保存されるソースコードの参照方法を指定/上書きします。
+ デフォルトは absolute (絶対パス)です。
-no-ui-lines
- UI ファイルを参照する行番号を記録しません。
+ UI ファイルを参照する行番号を記録しません。
-disable-heuristic {sametext|similartext|number}
- Disable the named merge heuristic. Can be specified multiple times.
+ 指定された手法のあいまいマージを行いません。複数回の指定が可能です。
-pro &lt;ファイル名&gt;
- .pro ファイルの名前を指定します。Useful for files with .pro file syntax but
- different file suffix. Projects are recursed into and merged.
+ .pro ファイルの名前を指定します。.pro ファイルの書式に従いながら、
+ 拡張子が異なる場合に有用です。
+ プロジェクトは再帰的に検索し、複数指定時はマージされます。
-source-language &lt;language&gt;[_&lt;region&gt;]
- Specify the language of the source strings for new files.
- Defaults to POSIX if not specified.
+ 新しくファイルを作成する場合のソース文字列の言語を指定します。
+ 指定されない場合のデフォルトは POSIX です。
-target-language &lt;language&gt;[_&lt;region&gt;]
- Specify the language of the translations for new files.
- Guessed from the file name if not specified.
+ 新しくファイルを作成する場合の翻訳言語を指定します。
+ 指定されない場合はファイル名から推測されます。
-ts &lt;ts-file&gt;...
- 出力ファイルを指定します。This will override the TRANSLATIONS
- and nullify the CODECFORTR from possibly specified project files.
+ 出力ファイルを指定します。プロジェクトファイルで指定された
+ TRANSLATIONS と CODECFORTR は無視されます。
-codecfortr &lt;codec&gt;
- Specify the codec assumed for tr() calls. Effective only with -ts.
+ tr() の呼び出し時に想定されるコーデックを指定します。-ts オプションを指定した場合にのみ有効です。
-version
- lupdate のバージョン情報を表示して終了します。
+ lupdate のバージョン情報を表示して終了します。
@lst-file
- Read additional file names (one per line) from lst-file.
+ lst-file を使って追加で読み込むファイル名(1行に1ファイル)を指定します。
</translation>
</message>
<message>
diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index 92a9e1d161..e0aa93bb77 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -2219,6 +2219,40 @@ nach
</message>
</context>
<context>
+ <name>QDeclarativeTypeData</name>
+ <message>
+ <source>Type %1 unavailable</source>
+ <translation type="obsolete">Der Typ %1 ist nicht verfügbar</translation>
+ </message>
+ <message>
+ <source>Namespace %1 cannot be used as a type</source>
+ <translation type="obsolete">Der Namensraum %1 kann nicht als Typangabe verwendet werden</translation>
+ </message>
+ <message>
+ <source>%1 %2</source>
+ <translation type="obsolete">%1 %2</translation>
+ </message>
+</context>
+<context>
+ <name>QDeclarativeTypeLoader</name>
+ <message>
+ <source>Script %1 unavailable</source>
+ <translation>Das Skript %1 ist nicht verfügbar</translation>
+ </message>
+ <message>
+ <source>Type %1 unavailable</source>
+ <translation>Der Typ %1 ist nicht verfügbar</translation>
+ </message>
+ <message>
+ <source>Namespace %1 cannot be used as a type</source>
+ <translation>Der Namensraum %1 kann nicht als Typangabe verwendet werden</translation>
+ </message>
+ <message>
+ <source>%1 %2</source>
+ <translation>%1 %2</translation>
+ </message>
+</context>
+<context>
<name>QDeclarativeVME</name>
<message>
<source>Unable to create object of type %1</source>
diff --git a/translations/qt_help_ja.ts b/translations/qt_help_ja.ts
index 2a725cab02..59036e05b1 100644
--- a/translations/qt_help_ja.ts
+++ b/translations/qt_help_ja.ts
@@ -43,7 +43,7 @@
</message>
<message>
<source>Cannot open collection file: %1</source>
- <translation>コレクションファイルをオープンできません: %1</translation>
+ <translation>コレクションファイルを開けません: %1</translation>
</message>
<message>
<source>Cannot create tables in file %1!</source>
@@ -67,7 +67,7 @@
</message>
<message>
<source>Cannot open database &apos;%1&apos; to optimize!</source>
- <translation>最適化用にデータベース &apos;%1&apos; をオープンできません!</translation>
+ <translation>最適化用にデータベース &apos;%1&apos; を開けません!</translation>
</message>
<message>
<source>Cannot create directory: %1</source>
@@ -83,7 +83,7 @@
</message>
<message>
<source>Cannot open documentation file %1!</source>
- <translation>ドキュメントファイル %1 をオープンできません!</translation>
+ <translation>ドキュメントファイル %1 を開けません!</translation>
</message>
<message>
<source>The namespace %1 was not registered!</source>
@@ -99,14 +99,14 @@
<message>
<source>Cannot open database &apos;%1&apos; &apos;%2&apos;: %3</source>
<extracomment>The placeholders are: %1 - The name of the database which cannot be opened %2 - The unique id for the connection %3 - The actual error string</extracomment>
- <translation>データベース &apos;%1&apos; &apos;%2&apos; がオープンできません: %3</translation>
+ <translation>データベース &apos;%1&apos; &apos;%2&apos; を開けません: %3</translation>
</message>
</context>
<context>
<name>QHelpEngineCore</name>
<message>
<source>Cannot open documentation file %1: %2!</source>
- <translation>ドキュメントファイル %1 をオープンできません: %2!</translation>
+ <translation>ドキュメントファイル %1 を開けません: %2!</translation>
</message>
<message>
<source>The specified namespace does not exist!</source>
@@ -133,7 +133,7 @@
</message>
<message>
<source>Cannot open data base file %1!</source>
- <translation>データベースファイル %1 をオープンできません!</translation>
+ <translation>データベースファイル %1 を開けません!</translation>
</message>
<message>
<source>Cannot register namespace %1!</source>
@@ -177,7 +177,7 @@
</message>
<message>
<source>Cannot open file %1! Skipping it.</source>
- <translation>ファイル %1 をオープンできません! スキップします。</translation>
+ <translation>ファイル %1 を開けません! スキップします。</translation>
</message>
<message>
<source>The filter %1 is already registered!</source>
@@ -209,7 +209,7 @@
</message>
<message>
<source>File &apos;%1&apos; cannot be opened.</source>
- <translation>ファイル &apos;%1&apos; をオープンできません。</translation>
+ <translation>ファイル &apos;%1&apos; を開けません。</translation>
</message>
<message>
<source>File &apos;%1&apos; contains an invalid link to file &apos;%2&apos;</source>
@@ -256,7 +256,7 @@
</message>
<message>
<source>The input file %1 could not be opened!</source>
- <translation>入力ファイル %1 がオープンできません!</translation>
+ <translation>入力ファイル %1 を開けません!</translation>
</message>
</context>
<context>
diff --git a/translations/qt_ja.ts b/translations/qt_ja.ts
index db8a917116..094e34db19 100644
--- a/translations/qt_ja.ts
+++ b/translations/qt_ja.ts
@@ -75,7 +75,7 @@
</message>
<message>
<source>Accessibility</source>
- <translation>アクセシビリティ</translation>
+ <translation>ユーザー補助</translation>
</message>
</context>
<context>
@@ -136,7 +136,7 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>Could not open media source.</source>
- <translation>メディアソースを開くことができません。</translation>
+ <translation>メディアソースを開けませんでした。</translation>
</message>
<message>
<source>Invalid source type.</source>
@@ -148,11 +148,11 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>Could not open audio device. The device is already in use.</source>
- <translation>オーディオデバイスを開くことができません。デバイスは既に他のプロセスにより使用されています。</translation>
+ <translation>オーディオデバイスを開けませんでした。デバイスは既に他のプロセスにより使用されています。</translation>
</message>
<message>
<source>Could not decode media source.</source>
- <translation>メディアソースを開くことができません。見つからないか、未知の形式です。</translation>
+ <translation>メディアソースを開けませんでした。見つからないか、未知の形式です。</translation>
</message>
</context>
<context>
@@ -320,6 +320,10 @@ libgstreamer-plugins-base はインストールされていますか。</transla
<source>Playback complete</source>
<translation>再生が終了しました</translation>
</message>
+ <message>
+ <source>Download error</source>
+ <translation>ダウンロードエラー</translation>
+ </message>
</context>
<context>
<name>Phonon::MMF::AbstractVideoPlayer</name>
@@ -439,6 +443,10 @@ libgstreamer-plugins-base はインストールされていますか。</transla
<source>Error opening source: media type could not be determined</source>
<translation>ソースのオープン時にエラーが発生しました: メディアのタイプが不明です</translation>
</message>
+ <message>
+ <source>Failed to set requested IAP</source>
+ <translation>要求されたIAPのセットに失敗しました</translation>
+ </message>
</context>
<context>
<name>Phonon::MMF::StereoWidening</name>
@@ -511,7 +519,7 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>Open </source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
<message>
<source>Select a Directory</source>
@@ -559,7 +567,7 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>&amp;OK</source>
- <translation>OK(&amp;O)</translation>
+ <translation>&amp;OK</translation>
</message>
<message>
<source>Look &amp;in:</source>
@@ -607,7 +615,7 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>Read-only</source>
- <translation>読み込み専用</translation>
+ <translation>読み取り専用</translation>
</message>
<message>
<source>Write-only</source>
@@ -643,7 +651,7 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
<message>
<source>Save As</source>
@@ -651,7 +659,7 @@ libgstreamer-plugins-base はインストールされていますか。</transla
</message>
<message>
<source>&amp;Open</source>
- <translation>オープン(&amp;O)</translation>
+ <translation>開く(&amp;O)</translation>
</message>
<message>
<source>&amp;Save</source>
@@ -1168,7 +1176,7 @@ to
<name>QComboBox</name>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
<message>
<source>False</source>
@@ -1216,6 +1224,11 @@ to
<translation>%1: リソース不足です</translation>
</message>
<message>
+ <source>%1: permission denied</source>
+ <comment>QSystemSemaphore</comment>
+ <translation>%1: 許可されていません</translation>
+ </message>
+ <message>
<source>%1: unknown error %2</source>
<comment>QSystemSemaphore</comment>
<translation>%1: 未知のエラー %2</translation>
@@ -1290,11 +1303,11 @@ to
<name>QDeclarativeAbstractAnimation</name>
<message>
<source>Cannot animate non-existent property &quot;%1&quot;</source>
- <translation>存在しないプロパティ &quot;%1&quot; はアニメーション出来ません</translation>
+ <translation>存在しないプロパティ &quot;%1&quot; はアニメーションできません</translation>
</message>
<message>
<source>Cannot animate read-only property &quot;%1&quot;</source>
- <translation>読込専用のプロパティ &quot;%1&quot; はアニメーション出来ません</translation>
+ <translation>読込専用のプロパティ &quot;%1&quot; はアニメーションできません</translation>
</message>
<message>
<source>Animation is an abstract class</source>
@@ -1320,7 +1333,7 @@ to
</message>
<message>
<source>Cannot anchor to an item that isn&apos;t a parent or sibling.</source>
- <translation>親でも兄弟でもない要素にはアンカー出来ません。</translation>
+ <translation>親でも兄弟でもない要素にはアンカーできません。</translation>
</message>
<message>
<source>Possible anchor loop detected on vertical anchor.</source>
@@ -1336,15 +1349,15 @@ to
</message>
<message>
<source>Cannot anchor to a null item.</source>
- <translation>空の要素にはアンカー出来ません。</translation>
+ <translation>空の要素にはアンカーできません。</translation>
</message>
<message>
<source>Cannot anchor a horizontal edge to a vertical edge.</source>
- <translation>横方向のエッジから縦方向のエッジへはアンカー出来ません。</translation>
+ <translation>横方向のエッジから縦方向のエッジへはアンカーできません。</translation>
</message>
<message>
<source>Cannot anchor item to self.</source>
- <translation>自分自身へはアンカー出来ません。</translation>
+ <translation>自分自身へはアンカーできません。</translation>
</message>
<message>
<source>Cannot specify top, bottom, and vcenter anchors.</source>
@@ -1356,7 +1369,7 @@ to
</message>
<message>
<source>Cannot anchor a vertical edge to a horizontal edge.</source>
- <translation>縦方向のエッジから横方向のエッジへはアンカー出来ません。</translation>
+ <translation>縦方向のエッジから横方向のエッジへはアンカーできません。</translation>
</message>
</context>
<context>
@@ -1367,6 +1380,13 @@ to
</message>
</context>
<context>
+ <name>QDeclarativeApplication</name>
+ <message>
+ <source>Application is an abstract class</source>
+ <translation>Application は抽象クラスです</translation>
+ </message>
+</context>
+<context>
<name>QDeclarativeBehavior</name>
<message>
<source>Cannot change the animation assigned to a Behavior.</source>
@@ -1494,12 +1514,20 @@ to
<translation>仕様が空であるコンポーネントは作成できません</translation>
</message>
<message>
+ <source>&quot;%1.%2&quot; is not available in %3 %4.%5.</source>
+ <translation>%3 %4.%5 で &quot;%1.%2&quot; は利用できません。</translation>
+ </message>
+ <message>
+ <source>&quot;%1.%2&quot; is not available due to component versioning.</source>
+ <translation>コンポーネントのバージョンの問題により &quot;%1.%2&quot; は利用できません。</translation>
+ </message>
+ <message>
<source>Incorrectly specified signal assignment</source>
<translation>仕様と異なるシグナルが割り当てられています</translation>
</message>
<message>
<source>Cannot assign a value to a signal (expecting a script to be run)</source>
- <translation>値をシグナルに割り当てることはできません(ただし、スクリプトは除きます)</translation>
+ <translation>値はシグナルに割り当てできません(ただし、スクリプトは除きます)</translation>
</message>
<message>
<source>Empty signal assignment</source>
@@ -1551,7 +1579,7 @@ to
</message>
<message>
<source>Cannot assign a value directly to a grouped property</source>
- <translation>グループ化されたプロパティに直接値を割り当てることはできません</translation>
+ <translation>グループ化されたプロパティに直接値を割り当てできません</translation>
</message>
<message>
<source>Invalid property use</source>
@@ -1563,15 +1591,15 @@ to
</message>
<message>
<source>Single property assignment expected</source>
- <translation>プロパティに複数の値は割り当てられません</translation>
+ <translation>プロパティに複数の値は割り当てできません</translation>
</message>
<message>
<source>Unexpected object assignment</source>
- <translation>オブジェクトを割り当てることはできません</translation>
+ <translation>オブジェクトを割り当てできません</translation>
</message>
<message>
<source>Cannot assign object to list</source>
- <translation>オブジェクトをリストに割り当てることはできません</translation>
+ <translation>オブジェクトをリストに割り当てできません</translation>
</message>
<message>
<source>Can only assign one binding to lists</source>
@@ -1579,19 +1607,23 @@ to
</message>
<message>
<source>Cannot assign primitives to lists</source>
- <translation>プリミティブをリストに割り当てることはできません</translation>
+ <translation>プリミティブをリストに割り当てできません</translation>
</message>
<message>
<source>Cannot assign multiple values to a script property</source>
- <translation>複数の値をスクリプトプロパティに割り当てることはできません</translation>
+ <translation>複数の値をスクリプトプロパティに割り当てできません</translation>
</message>
<message>
<source>Invalid property assignment: script expected</source>
<translation>無効なプロパティの値: スクリプトを指定してください</translation>
</message>
<message>
+ <source>Cannot assign multiple values to a singular property</source>
+ <translation>複数の値を単数プロパティに割り当てできません</translation>
+ </message>
+ <message>
<source>Cannot assign object to property</source>
- <translation>オブジェクトをプロパティに割り当てることはできません</translation>
+ <translation>オブジェクトをプロパティに割り当てできません</translation>
</message>
<message>
<source>&quot;%1&quot; cannot operate on &quot;%2&quot;</source>
@@ -1647,7 +1679,7 @@ to
</message>
<message>
<source>Cannot override FINAL property</source>
- <translation>FINAL プロパティを上書きすることはできません</translation>
+ <translation>FINAL プロパティは上書きできません</translation>
</message>
<message>
<source>Invalid property type</source>
@@ -1675,19 +1707,27 @@ to
</message>
<message>
<source>No property alias location</source>
- <translation>プロパティのエイリアスのパスがありません</translation>
+ <translation>プロパティのエイリアスへのパスがありません</translation>
</message>
<message>
<source>Invalid alias location</source>
<translation>無効なエイリアスのパス</translation>
</message>
<message>
+ <source>Invalid alias reference. An alias reference must be specified as &lt;id&gt;, &lt;id&gt;.&lt;property&gt; or &lt;id&gt;.&lt;value property&gt;.&lt;property&gt;</source>
+ <translation>無効なエイリアスの参照です。エイリアスの参照先は &lt;ID&gt;, &lt;ID&gt;.&lt;プロパティ&gt; もしくは &lt;ID&gt;.&lt;値プロパティ&gt;.&lt;プロパティ&gt; のいずれかでなくてはいけません</translation>
+ </message>
+ <message>
+ <source>Alias property exceeds alias bounds</source>
+ <translation>エイリアスプロパティがエイリアスの境界を越えています</translation>
+ </message>
+ <message>
<source>Invalid alias reference. An alias reference must be specified as &lt;id&gt; or &lt;id&gt;.&lt;property&gt;</source>
- <translation>無効なエイリアスの参照です。エイリアスの参照先は &lt;ID&gt; もしくは &lt;ID&gt;.&lt;プロパティ&gt; でなくてはいけません</translation>
+ <translation type="obsolete">無効なエイリアスの参照です。エイリアスの参照先は &lt;ID&gt; もしくは &lt;ID&gt;.&lt;プロパティ&gt; でなくてはいけません</translation>
</message>
<message>
<source>Invalid alias reference. Unable to find id &quot;%1&quot;</source>
- <translation>無効なエイリアスの参照です。 ID &quot;%1&quot; が見つかりません</translation>
+ <translation>無効なエイリアスの参照です。ID &quot;%1&quot; が見つかりません</translation>
</message>
</context>
<context>
@@ -1696,6 +1736,10 @@ to
<source>Invalid empty URL</source>
<translation>空の URL は無効です</translation>
</message>
+ <message>
+ <source>createObject: value is not an object</source>
+ <translation>createObject: 値がオブジェクトではありません</translation>
+ </message>
</context>
<context>
<name>QDeclarativeCompositeTypeManager</name>
@@ -1776,6 +1820,10 @@ to
<context>
<name>QDeclarativeImportDatabase</name>
<message>
+ <source>cannot load module &quot;%1&quot;: File name case mismatch for &quot;%2&quot;</source>
+ <translation>モジュール &quot;%1&quot; がロードできません: ファイル名の大文字小文字が &quot;%2&quot; に合っていません</translation>
+ </message>
+ <message>
<source>module &quot;%1&quot; definition &quot;%2&quot; not readable</source>
<translation>&quot;%1&quot; モジュールの定義 &quot;%2&quot; が読めません</translation>
</message>
@@ -1831,19 +1879,34 @@ to
<source>is not a type</source>
<translation>は型ではありません</translation>
</message>
+ <message>
+ <source>File name case mismatch for &quot;%2&quot;</source>
+ <translation>ファイル名の大文字小文字が &quot;%2&quot; に合っていません</translation>
+ </message>
</context>
<context>
<name>QDeclarativeKeyNavigationAttached</name>
<message>
<source>KeyNavigation is only available via attached properties</source>
- <translation>KeyNavigation はアタッチド・プロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます</translation>
+ <translation>KeyNavigation はアタッチされたプロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます</translation>
</message>
</context>
<context>
<name>QDeclarativeKeysAttached</name>
<message>
<source>Keys is only available via attached properties</source>
- <translation>Keys はアタッチド・プロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます</translation>
+ <translation>Keys はアタッチされたプロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます</translation>
+ </message>
+</context>
+<context>
+ <name>QDeclarativeLayoutMirroringAttached</name>
+ <message>
+ <source>LayoutDirection attached property only works with Items</source>
+ <translation>アタッチされたプロパティ LayoutDirection はアイテムでのみ利用できます</translation>
+ </message>
+ <message>
+ <source>LayoutMirroring is only available via attached properties</source>
+ <translation>LayoutMirroring はアタッチされたプロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます</translation>
</message>
</context>
<context>
@@ -2146,7 +2209,7 @@ to
</message>
<message>
<source>Cannot assign object type %1 with no default method</source>
- <translation>型 %1 のオブジェクトをデフォルトメソッドなしに割り当てることはできません</translation>
+ <translation>デフォルトメソッドの無い型 %1 のオブジェクトは割り当てできません</translation>
</message>
<message>
<source>Cannot connect mismatched signal/slot %1 %vs. %2</source>
@@ -2220,7 +2283,7 @@ to
<name>QDialog</name>
<message>
<source>What&apos;s This?</source>
- <translation>ヒント?</translation>
+ <translation>ヒント</translation>
</message>
<message>
<source>Done</source>
@@ -2267,7 +2330,7 @@ to
</message>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
<message>
<source>&amp;Cancel</source>
@@ -2323,7 +2386,7 @@ to
</message>
<message>
<source>&amp;OK</source>
- <translation>OK(&amp;O)</translation>
+ <translation>&amp;OK</translation>
</message>
</context>
<context>
@@ -2397,7 +2460,7 @@ to
</message>
<message>
<source>&amp;OK</source>
- <translation>OK(&amp;O)</translation>
+ <translation>&amp;OK</translation>
</message>
</context>
<context>
@@ -2420,7 +2483,7 @@ to
</message>
<message>
<source>Cannot open for output</source>
- <translation>コピー先のファイルをオープンできません</translation>
+ <translation>コピー先のファイルを開けません</translation>
</message>
<message>
<source>Failure to write block</source>
@@ -2451,7 +2514,7 @@ to
</message>
<message>
<source>&amp;Open</source>
- <translation>オープン(&amp;O)</translation>
+ <translation>開く(&amp;O)</translation>
</message>
<message>
<source>&amp;Save</source>
@@ -2459,7 +2522,7 @@ to
</message>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
<message>
<source>%1 already exists.
@@ -2477,7 +2540,7 @@ Please verify the correct file name was given.</source>
</message>
<message>
<source>My Computer</source>
- <translation>マイ コンピュータ</translation>
+ <translation>マイコンピュータ</translation>
</message>
<message>
<source>%1
@@ -2692,7 +2755,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>My Computer</source>
- <translation>マイ コンピュータ</translation>
+ <translation>マイコンピュータ</translation>
</message>
<message>
<source>Computer</source>
@@ -2732,7 +2795,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Italic</source>
- <translation>イタリック</translation>
+ <translation>斜体</translation>
</message>
<message>
<source>Oblique</source>
@@ -3207,7 +3270,7 @@ Do you want to delete it anyway?</source>
<name>QIBaseDriver</name>
<message>
<source>Error opening database</source>
- <translation>データベースのオープンでエラーが発生しました</translation>
+ <translation>データベースのオープン時にエラーが発生しました</translation>
</message>
<message>
<source>Could not start transaction</source>
@@ -3234,7 +3297,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Unable to open BLOB</source>
- <translation>バイナリラージオブジェクトをオープンできません</translation>
+ <translation>バイナリラージオブジェクトを開けません</translation>
</message>
<message>
<source>Unable to read BLOB</source>
@@ -3390,11 +3453,11 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Cannot load library %1: %2</source>
- <translation>ライブラリ &apos;%1&apos; を読み込むことができません: %2</translation>
+ <translation>ライブラリ &apos;%1&apos; を読み込めません: %2</translation>
</message>
<message>
<source>Cannot unload library %1: %2</source>
- <translation>ライブラリ %1 を解放することができません: %2</translation>
+ <translation>ライブラリ %1 を解放できません: %2</translation>
</message>
<message>
<source>Cannot resolve symbol &quot;%1&quot; in %2: %3</source>
@@ -3502,7 +3565,7 @@ Do you want to delete it anyway?</source>
<name>QMYSQLDriver</name>
<message>
<source>Unable to open database &apos;</source>
- <translation>データベースをオープンできません &apos;</translation>
+ <translation>データベースを開けません &apos;</translation>
</message>
<message>
<source>Unable to connect</source>
@@ -3659,7 +3722,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
<message>
<source>Execute</source>
@@ -3833,7 +3896,7 @@ Do you want to delete it anyway?</source>
<name>QNetworkAccessCacheBackend</name>
<message>
<source>Error opening %1</source>
- <translation>オープンのエラー %1</translation>
+ <translation>オープン時のエラー %1</translation>
</message>
</context>
<context>
@@ -3870,7 +3933,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Error opening %1: %2</source>
- <translation>%1 をオープンする時にエラーが発生しました: %2</translation>
+ <translation>%1 のオープン時にエラーが発生しました: %2</translation>
</message>
<message>
<source>Write error writing to %1: %2</source>
@@ -3878,7 +3941,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Cannot open %1: Path is a directory</source>
- <translation>%1 をオープンできません。指定されたパスはディレクトリです</translation>
+ <translation>%1 を開けません。指定されたパスはディレクトリです</translation>
</message>
<message>
<source>Read error reading from %1: %2</source>
@@ -3893,7 +3956,7 @@ Do you want to delete it anyway?</source>
</message>
<message>
<source>Cannot open %1: is a directory</source>
- <translation>%1 をオープンできません。指定されたパスはディレクトリです</translation>
+ <translation>%1 を開けません。指定されたパスはディレクトリです</translation>
</message>
<message>
<source>Logging in to %1 failed: authentication required</source>
@@ -4623,7 +4686,7 @@ Please choose a different file name.</source>
<name>QPrintPreviewDialog</name>
<message>
<source>Page Setup</source>
- <translation>ページの設定</translation>
+ <translation>ページ設定</translation>
</message>
<message>
<source>%1%</source>
@@ -4691,7 +4754,7 @@ Please choose a different file name.</source>
</message>
<message>
<source>Page setup</source>
- <translation>ページの設定</translation>
+ <translation>ページ設定</translation>
</message>
<message>
<source>Close</source>
@@ -4847,11 +4910,11 @@ Please choose a different file name.</source>
<name>QProcess</name>
<message>
<source>Could not open input redirection for reading</source>
- <translation>標準入力リダイレクトを読み込みのためにオープンすることができません</translation>
+ <translation>標準入力リダイレクトを読み込みのために開けませんでした</translation>
</message>
<message>
<source>Could not open output redirection for writing</source>
- <translation>標準出力リダイレクトを書き込みのためにオープンすることができません</translation>
+ <translation>標準出力リダイレクトを書き込みのために開けませんでした</translation>
</message>
<message>
<source>Resource error (fork failure): %1</source>
@@ -4893,7 +4956,7 @@ Please choose a different file name.</source>
<name>QPushButton</name>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
</context>
<context>
@@ -4954,7 +5017,7 @@ Please choose a different file name.</source>
<name>QSQLite2Driver</name>
<message>
<source>Error opening database</source>
- <translation>データベースのオープンでエラーが発生しました</translation>
+ <translation>データベースのオープン時にエラーが発生しました</translation>
</message>
<message>
<source>Unable to begin transaction</source>
@@ -4984,11 +5047,11 @@ Please choose a different file name.</source>
<name>QSQLiteDriver</name>
<message>
<source>Error opening database</source>
- <translation>データベースのオープンでエラーが発生しました</translation>
+ <translation>データベースのオープン時にエラーが発生しました</translation>
</message>
<message>
<source>Error closing database</source>
- <translation>データベースのクローズでエラーが発生しました</translation>
+ <translation>データベースのクローズ時にエラーが発生しました</translation>
</message>
<message>
<source>Unable to begin transaction</source>
@@ -5495,11 +5558,11 @@ Please choose a different file name.</source>
</message>
<message>
<source>Pause</source>
- <translation>Pause</translation>
+ <translation>一時停止</translation>
</message>
<message>
<source>Print</source>
- <translation>Print</translation>
+ <translation>印刷</translation>
</message>
<message>
<source>SysReq</source>
@@ -6113,11 +6176,11 @@ Please choose a different file name.</source>
</message>
<message>
<source>Insert</source>
- <translation>Insert</translation>
+ <translation>挿入</translation>
</message>
<message>
<source>Delete</source>
- <translation>Delete</translation>
+ <translation>削除</translation>
</message>
<message>
<source>Escape</source>
@@ -6129,7 +6192,7 @@ Please choose a different file name.</source>
</message>
<message>
<source>Select</source>
- <translation>Select</translation>
+ <translation>選択</translation>
</message>
<message>
<source>Yes</source>
@@ -6430,7 +6493,7 @@ Please choose a different file name.</source>
</message>
<message>
<source>Select</source>
- <translation>セレクト</translation>
+ <translation>選択</translation>
</message>
<message>
<source>Done</source>
@@ -6554,6 +6617,10 @@ Please choose a different file name.</source>
<translation>SSL ハンドシェーク時にエラーが発生しました: %1</translation>
</message>
<message>
+ <source>The peer certificate is blacklisted</source>
+ <translation>通信相手の証明書がブラックリストに載っています</translation>
+ </message>
+ <message>
<source>No error</source>
<translation>エラーはありません</translation>
</message>
@@ -6760,7 +6827,7 @@ Please choose a different file name.</source>
</message>
<message>
<source>Open</source>
- <translation>オープン</translation>
+ <translation>開く</translation>
</message>
</context>
<context>
@@ -6906,7 +6973,7 @@ Please choose a different file name.</source>
<message>
<source>Choose File</source>
<comment>title for file button used in HTML forms</comment>
- <translation>ファイルを選ぶ</translation>
+ <translation>ファイルを選択</translation>
</message>
<message>
<source>No file selected</source>
@@ -7061,7 +7128,7 @@ Please choose a different file name.</source>
<message>
<source>Italic</source>
<comment>Italic context menu item</comment>
- <translation>イタリック</translation>
+ <translation>斜体</translation>
</message>
<message>
<source>Underline</source>
@@ -7141,7 +7208,7 @@ Please choose a different file name.</source>
<message>
<source>Slider</source>
<comment>Media controller element</comment>
- <translation>スライダ</translation>
+ <translation>スライダー</translation>
</message>
<message>
<source>Slider Thumb</source>
@@ -7586,7 +7653,7 @@ Please choose a different file name.</source>
<name>QWhatsThisAction</name>
<message>
<source>What&apos;s This?</source>
- <translation>ヒント?</translation>
+ <translation>ヒント</translation>
</message>
</context>
<context>
diff --git a/translations/qtconfig_ja.ts b/translations/qtconfig_ja.ts
index cf3ec13aa0..8440389e8c 100644
--- a/translations/qtconfig_ja.ts
+++ b/translations/qtconfig_ja.ts
@@ -4,6 +4,26 @@
<context>
<name>MainWindow</name>
<message>
+ <source>&lt;p&gt;&lt;b&gt;&lt;font size+=2&gt;Appearance&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;Use this tab to customize the appearance of your Qt applications.&lt;/p&gt;&lt;p&gt;You can select the default GUI Style from the drop down list and customize the colors.&lt;/p&gt;&lt;p&gt;Any GUI Style plugins in your plugin path will automatically be added to the list of built-in Qt styles. (See the Library Paths tab for information on adding new plugin paths.)&lt;/p&gt;&lt;p&gt;When you choose 3-D Effects and Window Background colors, the Qt Configuration program will automatically generate a palette for you. To customize colors further, press the Tune Palette button to open the advanced palette editor.&lt;p&gt;The Preview Window shows what the selected Style and colors look like.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;b&gt;&lt;font size+=2&gt;Fonts&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;Use this tab to select the default font for your Qt applications. The selected font is shown (initially as &apos;Sample Text&apos;) in the line edit below the Family, Style and Point Size drop down lists.&lt;/p&gt;&lt;p&gt;Qt has a powerful font substitution feature that allows you to specify a list of substitute fonts. Substitute fonts are used when a font cannot be loaded, or if the specified font doesn&apos;t have a particular character.&lt;p&gt;For example, if you select the font Lucida, which doesn&apos;t have Korean characters, but need to show some Korean text using the Mincho font family you can do so by adding Mincho to the list. Once Mincho is added, any Korean characters that are not found in the Lucida font will be taken from the Mincho font. Because the font substitutions are lists, you can also select multiple families, such as Song Ti (for use with Chinese text).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;b&gt;&lt;font size+=2&gt;Interface&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;Use this tab to customize the feel of your Qt applications.&lt;/p&gt;&lt;p&gt;If the Resolve Symlinks checkbox is checked Qt will follow symlinks when handling URLs. For example, in the file dialog, if this setting is turned on and /usr/tmp is a symlink to /var/tmp, entering the /usr/tmp directory will cause the file dialog to change to /var/tmp. With this setting turned off, symlinks are not resolved or followed.&lt;/p&gt;&lt;p&gt;The Global Strut setting is useful for people who require a minimum size for all widgets (e.g. when using a touch panel or for users who are visually impaired). Leaving the Global Strut width and height at 0 will disable the Global Strut feature&lt;/p&gt;&lt;p&gt;XIM (Extended Input Methods) are used for entering characters in languages that have large character sets, for example, Chinese and Japanese.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;b&gt;&lt;font size+=2&gt;Printer&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;Use this tab to configure the way Qt generates output for the printer.You can specify if Qt should try to embed fonts into its generated output.If you enable font embedding, the resulting postscript will be more portable and will more accurately reflect the visual output on the screen; however the resulting postscript file size will be bigger.&lt;p&gt;When using font embedding you can select additional directories where Qt should search for embeddable font files. By default, the X server font path is used.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;b&gt;&lt;font size+=2&gt;Phonon&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;Use this tab to configure the Phonon GStreamer multimedia backend. &lt;p&gt;It is reccommended to leave all settings on &quot;Auto&quot; to let Phonon determine your settings automatically.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Desktop Settings (Default)</source>
<translation>デスクトップの設定(デフォルト)</translation>
</message>
@@ -364,7 +384,7 @@
</message>
<message>
<source>Browse...</source>
- <translation>ブラウズ...</translation>
+ <translation>参照...</translation>
</message>
<message>
<source>Press the &lt;b&gt;Browse&lt;/b&gt; button or enter a directory and press Enter to add them to the list.</source>